[PATCH v2 net-next 13/14] net: dsa: netc: initialize buffer bool table and implement flow-control
Wei Fang
wei.fang at nxp.com
Wed Mar 25 12:53:32 AEDT 2026
> > +static u32 netc_get_buffer_pool_num(struct netc_switch *priv)
> > +{
> > + return netc_base_rd(&priv->regs, NETC_BPCAPR) & BPCAPR_NUM_BP;
> > +}
> > +
> > +static void netc_port_set_pbpmcr(struct netc_port *np, u64 mapping)
> > +{
> > + u32 pbpmcr0 = lower_32_bits(mapping);
> > + u32 pbpmcr1 = upper_32_bits(mapping);
> > +
> > + netc_port_wr(np, NETC_PBPMCR0, pbpmcr0);
> > + netc_port_wr(np, NETC_PBPMCR1, pbpmcr1);
> > +}
> > +
> > +static void netc_ipv_to_buffer_pool_mapping(struct netc_switch *priv)
> > +{
> > + int num_port_bp = priv->num_bp / priv->info->num_ports;
> > + int q = NETC_IPV_NUM / num_port_bp;
> > ^^^^
>
> Can this cause a division by zero? If netc_get_buffer_pool_num() reads
More information about the Linuxppc-dev
mailing list