diff mbox series

[net-next,v2,11/11] bnxt: XDP multibuffer enablement

Message ID 1647806284-8529-12-git-send-email-michael.chan@broadcom.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series bnxt: Support XDP multi buffer | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/cc_maintainers warning 6 maintainers not CCed: daniel@iogearbox.net ast@kernel.org hawk@kernel.org john.fastabend@gmail.com pabeni@redhat.com bpf@vger.kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Michael Chan March 20, 2022, 7:58 p.m. UTC
From: Andy Gospodarek <gospo@broadcom.com>

Allow aggregation buffers to be in place in the receive path and
allow XDP programs to be attached when using a larger than 4k MTU.

Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 3 +--
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 5 -----
 2 files changed, 1 insertion(+), 7 deletions(-)

Comments

Jakub Kicinski March 22, 2022, 6:09 a.m. UTC | #1
On Sun, 20 Mar 2022 15:58:04 -0400 Michael Chan wrote:
> From: Andy Gospodarek <gospo@broadcom.com>
> 
> Allow aggregation buffers to be in place in the receive path and
> allow XDP programs to be attached when using a larger than 4k MTU.
> 
> Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 3 +--
>  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 5 -----
>  2 files changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 84c89ee7dc2f..4f7213af1955 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -1937,8 +1937,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
>  		xdp_active = true;
>  	}
>  
> -	/* skip running XDP prog if there are aggregation bufs */
> -	if (!agg_bufs && xdp_active) {
> +	if (xdp_active) {
>  		if (bnxt_rx_xdp(bp, rxr, cons, xdp, data, &len, event)) {
>  			rc = 1;
>  			goto next_rx;
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> index adbd92971209..3780b491a1d4 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> @@ -374,11 +374,6 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
>  	int tx_xdp = 0, rc, tc;
>  	struct bpf_prog *old;
>  
> -	if (prog && bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) {

This seems to be missing taking prog->aux->xdp_has_frags into account.

> -		netdev_warn(dev, "MTU %d larger than largest XDP supported MTU %d.\n",
> -			    bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);
> -		return -EOPNOTSUPP;
> -	}
>  	if (!(bp->flags & BNXT_FLAG_SHARED_RINGS)) {
>  		netdev_warn(dev, "ethtool rx/tx channels must be combined to support XDP.\n");
>  		return -EOPNOTSUPP;
Andy Gospodarek March 22, 2022, 10:26 a.m. UTC | #2
On Mon, Mar 21, 2022 at 11:09:58PM -0700, Jakub Kicinski wrote:
> On Sun, 20 Mar 2022 15:58:04 -0400 Michael Chan wrote:
> > From: Andy Gospodarek <gospo@broadcom.com>
> > 
> > Allow aggregation buffers to be in place in the receive path and
> > allow XDP programs to be attached when using a larger than 4k MTU.
> > 
> > Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
> > Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> > ---
> >  drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 3 +--
> >  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 5 -----
> >  2 files changed, 1 insertion(+), 7 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > index 84c89ee7dc2f..4f7213af1955 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > @@ -1937,8 +1937,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
> >  		xdp_active = true;
> >  	}
> >  
> > -	/* skip running XDP prog if there are aggregation bufs */
> > -	if (!agg_bufs && xdp_active) {
> > +	if (xdp_active) {
> >  		if (bnxt_rx_xdp(bp, rxr, cons, xdp, data, &len, event)) {
> >  			rc = 1;
> >  			goto next_rx;
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > index adbd92971209..3780b491a1d4 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > @@ -374,11 +374,6 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
> >  	int tx_xdp = 0, rc, tc;
> >  	struct bpf_prog *old;
> >  
> > -	if (prog && bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) {
> 
> This seems to be missing taking prog->aux->xdp_has_frags into account.
> 

Thanks for the review!  I've sent Michael an updated patch and we should be
able to get a v3 out this morning to cover this.

> > -		netdev_warn(dev, "MTU %d larger than largest XDP supported MTU %d.\n",
> > -			    bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);
> > -		return -EOPNOTSUPP;
> > -	}
> >  	if (!(bp->flags & BNXT_FLAG_SHARED_RINGS)) {
> >  		netdev_warn(dev, "ethtool rx/tx channels must be combined to support XDP.\n");
> >  		return -EOPNOTSUPP;
>
Michael Chan March 22, 2022, 6:04 p.m. UTC | #3
On Tue, Mar 22, 2022 at 3:26 AM Andy Gospodarek
<andrew.gospodarek@broadcom.com> wrote:
>
> On Mon, Mar 21, 2022 at 11:09:58PM -0700, Jakub Kicinski wrote:
> > On Sun, 20 Mar 2022 15:58:04 -0400 Michael Chan wrote:
> > > From: Andy Gospodarek <gospo@broadcom.com>
> > >
> > > Allow aggregation buffers to be in place in the receive path and
> > > allow XDP programs to be attached when using a larger than 4k MTU.
> > >
> > > Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
> > > Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> > > ---
> > >  drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 3 +--
> > >  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 5 -----
> > >  2 files changed, 1 insertion(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > > index 84c89ee7dc2f..4f7213af1955 100644
> > > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > > @@ -1937,8 +1937,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
> > >             xdp_active = true;
> > >     }
> > >
> > > -   /* skip running XDP prog if there are aggregation bufs */
> > > -   if (!agg_bufs && xdp_active) {
> > > +   if (xdp_active) {
> > >             if (bnxt_rx_xdp(bp, rxr, cons, xdp, data, &len, event)) {
> > >                     rc = 1;
> > >                     goto next_rx;
> > > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > > index adbd92971209..3780b491a1d4 100644
> > > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > > @@ -374,11 +374,6 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
> > >     int tx_xdp = 0, rc, tc;
> > >     struct bpf_prog *old;
> > >
> > > -   if (prog && bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) {
> >
> > This seems to be missing taking prog->aux->xdp_has_frags into account.
> >
>
> Thanks for the review!  I've sent Michael an updated patch and we should be
> able to get a v3 out this morning to cover this.
>

We'll send v3 when net-next opens up again in 2 weeks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 84c89ee7dc2f..4f7213af1955 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1937,8 +1937,7 @@  static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
 		xdp_active = true;
 	}
 
-	/* skip running XDP prog if there are aggregation bufs */
-	if (!agg_bufs && xdp_active) {
+	if (xdp_active) {
 		if (bnxt_rx_xdp(bp, rxr, cons, xdp, data, &len, event)) {
 			rc = 1;
 			goto next_rx;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
index adbd92971209..3780b491a1d4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
@@ -374,11 +374,6 @@  static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
 	int tx_xdp = 0, rc, tc;
 	struct bpf_prog *old;
 
-	if (prog && bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) {
-		netdev_warn(dev, "MTU %d larger than largest XDP supported MTU %d.\n",
-			    bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);
-		return -EOPNOTSUPP;
-	}
 	if (!(bp->flags & BNXT_FLAG_SHARED_RINGS)) {
 		netdev_warn(dev, "ethtool rx/tx channels must be combined to support XDP.\n");
 		return -EOPNOTSUPP;