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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLikjbHjsJivN5iff5B4gQ5fOi=4WPgd-6XYjBStrJnU_ow@mail.gmail.com>
Date:   Thu, 4 Jan 2018 20:35:40 -0800
From:   Michael Chan <michael.chan@...adcom.com>
To:     Jesper Dangaard Brouer <brouer@...hat.com>
Cc:     Daniel Borkmann <borkmann@...earbox.net>,
        Alexei Starovoitov <alexei.starovoitov@...il.com>,
        Netdev <netdev@...r.kernel.org>, David Ahern <dsahern@...il.com>,
        Björn Töpel <bjorn.topel@...el.com>,
        Andy Gospodarek <gospo@...adcom.com>,
        Andy Gospodarek <andy@...yhouse.net>
Subject: Re: [bpf-next V4 PATCH 07/14] bnxt_en: setup xdp_rxq_info

On Wed, Jan 3, 2018 at 2:25 AM, Jesper Dangaard Brouer
<brouer@...hat.com> wrote:
> Driver hook points for xdp_rxq_info:
>  * reg  : bnxt_alloc_rx_rings
>  * unreg: bnxt_free_rx_rings
>
> This driver should be updated to re-register when changing
> allocation mode of RX rings.
>
> Tested on actual hardware.
>
> Cc: Andy Gospodarek <andy@...yhouse.net>
> Cc: Michael Chan <michael.chan@...adcom.com>
> Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>

Looks good, thanks.  Just one comment below.
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c     |   10 ++++++++++
>  drivers/net/ethernet/broadcom/bnxt/bnxt.h     |    2 ++
>  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |    1 +
>  3 files changed, 13 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 9efbdc6f1fcb..89c3c8760a78 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -2247,6 +2247,9 @@ static void bnxt_free_rx_rings(struct bnxt *bp)
>                 if (rxr->xdp_prog)
>                         bpf_prog_put(rxr->xdp_prog);
>
> +               if (xdp_rxq_info_is_reg(&rxr->xdp_rxq))
> +                       xdp_rxq_info_unreg(&rxr->xdp_rxq);
> +
>                 kfree(rxr->rx_tpa);
>                 rxr->rx_tpa = NULL;
>
> @@ -2280,6 +2283,10 @@ static int bnxt_alloc_rx_rings(struct bnxt *bp)
>
>                 ring = &rxr->rx_ring_struct;
>
> +               rc = xdp_rxq_info_reg(&rxr->xdp_rxq, bp->dev, i);

We can optimize it a bit by only making this call if
BNXT_RX_PAGE_MODE() is true.  We can only run XDP if
BNXT_RX_PAGE_MODE() is true.

> +               if (rc < 0)
> +                       return rc;
> +
>                 rc = bnxt_alloc_ring(bp, ring);
>                 if (rc)
>                         return rc;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ