On Fri, May 2, 2025 at 3:03 AM Kevin Traynor <ktray...@redhat.com> wrote:
>
> On 29/04/2025 13:00, Daniel Ding wrote:
> > The broadcom nic needs allow extended mbufs for rx-ag ring.
> >
> > Output warn log like:
> >   dpdk|WARN|bnxt_init_one_rx_ring(): init'ed AG ring 8 with 512/8192 mbufs 
> > only
> >   dpdk|WARN|bnxt_init_one_rx_ring(): init'ed rx ring 9 with 0/2048 mbufs 
> > only
> > ---
> >  lib/netdev-dpdk.c | 22 +++++++++++++++++++---
> >  1 file changed, 19 insertions(+), 3 deletions(-)
> >
>
> +cc: Ajit (DPDK bnxt maintainer)
>
> H Daniel,
>
> It seems like you are using an EoL DPDK/OVS. i.e.
>
> bnxt_init_one_rx_ring(): init'ed AG ring 8 with 512/8192 mbufs only
> bnxt_init_one_rx_ring(): init'ed rx ring 9 with 0/2048 mbufs only
>
> these logs were replaced in:
>
> commit f9f0b5121f62d8701165d20bfdd14638bc72654d
> Author: Ajit Khaparde <ajit.khapa...@broadcom.com>
> Date:   Wed Nov 17 13:10:09 2021 -0800
>
>     net/bnxt: fail init when mbuf allocation fails
>
>     ...
>
> and that commit is merged since DPDK 21.11:
>
> $ git tag --contains f9f0b5121f6 | head -1
> v21.11
>
> The oldest maintained DPDK LTS is 22.11, but the oldest DPDK LTS
> actually used in a maintained OVS branch is DPDK 23.11 (for OVS branch-3.3).
>
> Even if it still exists for the current code, I don't see an issue with
> the OVS code, so it looks like it should be fixed in the DPDK driver.
>
> In general, we don't want to take code in OVS for specific NICs as they
> should work through the DPDK API.
>
> Also, in this case, it is impacting OVS user functionality by changing
> the amount of requested memory and overriding some of the user memory
> config options. See
> https://docs.openvswitch.org/en/latest/topics/dpdk/memory/ .
>
> Is this still an issue with maintained versions ? I suggest to discuss
> more with Ajit on DPDK mailing list or submit a bug at https://bugs.dpdk.org
Right. The logs have been removed and the code has been modified to
attempt mbuf reallocation in a different method.
Please try with the latest and let us know.

Thanks
Ajit
>
> thanks,
> Kevin.
>
>
> > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> > index 29a6bf032..b1b37b75b 100644
> > --- a/lib/netdev-dpdk.c
> > +++ b/lib/netdev-dpdk.c
> > @@ -610,6 +610,15 @@ netdev_dpdk_get_ingress_policer(const struct 
> > netdev_dpdk *dev);
> >  static void netdev_dpdk_mbuf_dump(const char *prefix, const char *message,
> >                                    const struct rte_mbuf *);
> >
> > +static bool
> > +is_dpdk_driver(struct netdev_dpdk *dev, const char *name)
> > +{
> > +    struct rte_eth_dev_info info;
> > +
> > +    rte_eth_dev_info_get(dev->port_id, &info);
> > +    return !strcmp(info.driver_name, name);
> > +}
> > +
> >  static bool
> >  is_dpdk_class(const struct netdev_class *class)
> >  {
> > @@ -770,6 +779,10 @@ dpdk_calculate_mbufs(struct netdev_dpdk *dev, int mtu)
> >                    + MIN_NB_MBUF;
> >      }
> >
> > +    if (is_dpdk_driver(dev, "net_bnxt")) { // Alloc mbufs for bnxt rx-ag 
> > ring.
> > +        n_mbufs += dev->requested_n_rxq * dev->requested_rxq_size * 4;
> > +    }
> > +
> >      return n_mbufs;
> >  }
> >
> > @@ -891,9 +904,10 @@ dpdk_mp_get(struct netdev_dpdk *dev, int mtu)
> >      bool reuse = false;
> >
> >      ovs_mutex_lock(&dpdk_mp_mutex);
> > +
> >      /* Check if shared memory is being used, if so check existing mempools
> >       * to see if reuse is possible. */
> > -    if (!per_port_memory) {
> > +    if (!per_port_memory && !is_dpdk_driver(dev, "net_bnxt")) {
> >          /* If user has provided defined mempools, check if one is suitable
> >           * and get new buffer size.*/
> >          mtu = dpdk_get_user_adjusted_mtu(mtu, dev->requested_mtu,
> > @@ -922,7 +936,8 @@ dpdk_mp_get(struct netdev_dpdk *dev, int mtu)
> >               * dmp to point to the existing entry and increment the 
> > refcount
> >               * to avoid being freed at a later stage.
> >               */
> > -            if (per_port_memory && rte_errno == EEXIST) {
> > +            if ((per_port_memory || is_dpdk_driver(dev, "net_bnxt"))
> > +                && rte_errno == EEXIST) {
> >                  LIST_FOR_EACH (next, list_node, &dpdk_mp_list) {
> >                      if (dmp->mp == next->mp) {
> >                          rte_free(dmp);
> > @@ -971,7 +986,8 @@ netdev_dpdk_mempool_configure(struct netdev_dpdk *dev)
> >      /* With shared memory we do not need to configure a mempool if the MTU
> >       * and socket ID have not changed, the previous configuration is still
> >       * valid so return 0 */
> > -    if (!per_port_memory && dev->mtu == dev->requested_mtu
> > +    if (!per_port_memory && !is_dpdk_driver(dev, "net_bnxt")
> > +        && dev->mtu == dev->requested_mtu
> >          && dev->socket_id == dev->requested_socket_id) {
> >          return ret;
> >      }
>
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to