lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLiknyPntcYXrhsVkz5Mpt9kep0cnkYBGVb1f74x5+HS4Cg@mail.gmail.com>
Date: Mon, 7 Oct 2024 00:30:09 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Joe Damato <jdamato@...tly.com>
Cc: netdev@...r.kernel.org, Pavan Chebbi <pavan.chebbi@...adcom.com>, 
	Michael Chan <mchan@...adcom.com>, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [net-next v3 2/2] tg3: Link queues to NAPIs

On Sat, Oct 5, 2024 at 7:57 AM Joe Damato <jdamato@...tly.com> wrote:
>
> Link queues to NAPIs using the netdev-genl API so this information is
> queryable.
>
> $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
>                          --dump queue-get --json='{"ifindex": 2}'
>
> [{'id': 0, 'ifindex': 2, 'napi-id': 8194, 'type': 'rx'},
>  {'id': 1, 'ifindex': 2, 'napi-id': 8195, 'type': 'rx'},
>  {'id': 2, 'ifindex': 2, 'napi-id': 8196, 'type': 'rx'},
>  {'id': 3, 'ifindex': 2, 'napi-id': 8197, 'type': 'rx'},
>  {'id': 0, 'ifindex': 2, 'napi-id': 8193, 'type': 'tx'}]
>
> Signed-off-by: Joe Damato <jdamato@...tly.com>

>  static void tg3_napi_enable(struct tg3 *tp)
>  {
> +       int txq_idx = 0, rxq_idx = 0;
> +       struct tg3_napi *tnapi;
>         int i;
>
> -       for (i = 0; i < tp->irq_cnt; i++)
> -               napi_enable(&tp->napi[i].napi);
> +       for (i = 0; i < tp->irq_cnt; i++) {
> +               tnapi = &tp->napi[i];
> +               napi_enable(&tnapi->napi);
> +               if (tnapi->tx_buffers) {
> +                       netif_queue_set_napi(tp->dev, txq_idx,
> +                                            NETDEV_QUEUE_TYPE_TX,
> +                                            &tnapi->napi);
> +                       txq_idx++;
> +               } else if (tnapi->rx_rcb) {

Shouldn't this be "if" instead of "else if" ?  A napi can be for both
a TX ring and an RX ring in some cases.
Thanks.

> +                       netif_queue_set_napi(tp->dev, rxq_idx,
> +                                            NETDEV_QUEUE_TYPE_RX,
> +                                            &tnapi->napi);
> +                       rxq_idx++;
> +               }
> +       }
>  }

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ