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: <CACKFLi=if7dtWvvOnKPwxn-hmfzGMCMzfSacNhOQm=GvfJThQQ@mail.gmail.com>
Date: Wed, 29 Nov 2023 21:52:30 -0800
From: Michael Chan <michael.chan@...adcom.com>
To: Amritha Nambiar <amritha.nambiar@...el.com>
Cc: netdev@...r.kernel.org, kuba@...nel.org, pabeni@...hat.com, 
	edumazet@...gle.com, ast@...nel.org, sdf@...gle.com, lorenzo@...nel.org, 
	tariqt@...dia.com, daniel@...earbox.net, anthony.l.nguyen@...el.com, 
	lucien.xin@...il.com, sridhar.samudrala@...el.com, 
	Andrew Gospodarek <gospo@...adcom.com>
Subject: Re: [net-next PATCH v10 11/11] eth: bnxt: link NAPI instances to
 queues and IRQs

On Wed, Nov 29, 2023 at 4:11 PM Amritha Nambiar
<amritha.nambiar@...el.com> wrote:
>
> From: Jakub Kicinski <kuba@...nel.org>
>
> Make bnxt compatible with the newly added netlink queue GET APIs.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> Signed-off-by: Amritha Nambiar <amritha.nambiar@...el.com>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index e35e7e02538c..08793e24e0ee 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -3845,6 +3845,9 @@ static int bnxt_init_one_rx_ring(struct bnxt *bp, int ring_nr)
>         ring = &rxr->rx_ring_struct;
>         bnxt_init_rxbd_pages(ring, type);
>
> +       netif_queue_set_napi(bp->dev, ring_nr, NETDEV_QUEUE_TYPE_RX,
> +                            &rxr->bnapi->napi);
> +
>         if (BNXT_RX_PAGE_MODE(bp) && bp->xdp_prog) {
>                 bpf_prog_add(bp->xdp_prog, 1);
>                 rxr->xdp_prog = bp->xdp_prog;
> @@ -3921,6 +3924,9 @@ static int bnxt_init_tx_rings(struct bnxt *bp)
>                 struct bnxt_ring_struct *ring = &txr->tx_ring_struct;
>
>                 ring->fw_ring_id = INVALID_HW_RING_ID;
> +
> +               netif_queue_set_napi(bp->dev, i, NETDEV_QUEUE_TYPE_TX,
> +                                    &txr->bnapi->napi);

This will include the XDP TX rings that are internal to the driver.  I
think we need to exclude these XDP rings and do something like this:

if (i > bp->tx_nr_rings_xdp)
        netif_queue_set_napi(bp->dev, i - bp->tx_nr_rings_xdp,
                             NETDEV_QUEUE_TYPE_TX, &txr->bnapi->napi);

>         }
>
>         return 0;
> @@ -9754,6 +9760,7 @@ static int bnxt_request_irq(struct bnxt *bp)
>                 if (rc)
>                         break;
>
> +               netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector);
>                 irq->requested = 1;
>
>                 if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) {
> @@ -9781,6 +9788,11 @@ static void bnxt_del_napi(struct bnxt *bp)
>         if (!bp->bnapi)
>                 return;
>
> +       for (i = 0; i < bp->rx_nr_rings; i++)
> +               netif_queue_set_napi(bp->dev, i, NETDEV_QUEUE_TYPE_RX, NULL);
> +       for (i = 0; i < bp->tx_nr_rings; i++)

Similarly,

for (i = 0; i < bp->tx_nr_rings - bp->tx_nr_rings_xdp; i++)

> +               netif_queue_set_napi(bp->dev, i, NETDEV_QUEUE_TYPE_TX, NULL);
> +
>         for (i = 0; i < bp->cp_nr_rings; i++) {
>                 struct bnxt_napi *bnapi = bp->bnapi[i];
>
>

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