netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/4] bnxt_en: Bug fixes
@ 2022-08-22 15:06 Michael Chan
  2022-08-22 15:06 ` [PATCH net 1/4] bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use Michael Chan
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Michael Chan @ 2022-08-22 15:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, edumazet, pabeni, gospo

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

This series includes 2 fixes for regressions introduced by the XDP
multi-buffer feature, 1 devlink reload bug fix, and 1 SRIOV resource
accounting bug fix.

Pavan Chebbi (1):
  bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in
    use

Vikas Gupta (3):
  bnxt_en: set missing reload flag in devlink features
  bnxt_en: fix NQ resource accounting during vf creation on 57500 chips
  bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback

 drivers/net/ethernet/broadcom/bnxt/bnxt.c         |  5 +----
 drivers/net/ethernet/broadcom/bnxt/bnxt.h         |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c   |  2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c     | 10 ++++++++--
 5 files changed, 12 insertions(+), 7 deletions(-)

-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net 1/4] bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use
  2022-08-22 15:06 [PATCH net 0/4] bnxt_en: Bug fixes Michael Chan
@ 2022-08-22 15:06 ` Michael Chan
  2022-08-22 15:06 ` [PATCH net 2/4] bnxt_en: set missing reload flag in devlink features Michael Chan
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Chan @ 2022-08-22 15:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, edumazet, pabeni, gospo, Pavan Chebbi

[-- Attachment #1: Type: text/plain, Size: 2503 bytes --]

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

Using BNXT_PAGE_MODE_BUF_SIZE + offset as buffer length value is not
sufficient when running single buffer XDP programs doing redirect
operations. The stack will complain on missing skb tail room. Fix it
by using PAGE_SIZE when calling xdp_init_buff() for single buffer
programs.

Fixes: b231c3f3414c ("bnxt: refactor bnxt_rx_xdp to separate xdp_init_buff/xdp_prepare_buff")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 075c6206325c..b1b17f911300 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2130,6 +2130,7 @@ struct bnxt {
 #define BNXT_DUMP_CRASH		1
 
 	struct bpf_prog		*xdp_prog;
+	u8			xdp_has_frags;
 
 	struct bnxt_ptp_cfg	*ptp_cfg;
 	u8			ptp_all_rx_tstamp;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
index f53387ed0167..c3065ec0a479 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
@@ -181,6 +181,7 @@ void bnxt_xdp_buff_init(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
 			struct xdp_buff *xdp)
 {
 	struct bnxt_sw_rx_bd *rx_buf;
+	u32 buflen = PAGE_SIZE;
 	struct pci_dev *pdev;
 	dma_addr_t mapping;
 	u32 offset;
@@ -192,7 +193,10 @@ void bnxt_xdp_buff_init(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
 	mapping = rx_buf->mapping - bp->rx_dma_offset;
 	dma_sync_single_for_cpu(&pdev->dev, mapping + offset, *len, bp->rx_dir);
 
-	xdp_init_buff(xdp, BNXT_PAGE_MODE_BUF_SIZE + offset, &rxr->xdp_rxq);
+	if (bp->xdp_has_frags)
+		buflen = BNXT_PAGE_MODE_BUF_SIZE + offset;
+
+	xdp_init_buff(xdp, buflen, &rxr->xdp_rxq);
 	xdp_prepare_buff(xdp, *data_ptr - offset, offset, *len, false);
 }
 
@@ -397,8 +401,10 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
 		netdev_warn(dev, "ethtool rx/tx channels must be combined to support XDP.\n");
 		return -EOPNOTSUPP;
 	}
-	if (prog)
+	if (prog) {
 		tx_xdp = bp->rx_nr_rings;
+		bp->xdp_has_frags = prog->aux->xdp_has_frags;
+	}
 
 	tc = netdev_get_num_tc(dev);
 	if (!tc)
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/4] bnxt_en: set missing reload flag in devlink features
  2022-08-22 15:06 [PATCH net 0/4] bnxt_en: Bug fixes Michael Chan
  2022-08-22 15:06 ` [PATCH net 1/4] bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use Michael Chan
@ 2022-08-22 15:06 ` Michael Chan
  2022-08-22 15:06 ` [PATCH net 3/4] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips Michael Chan
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Chan @ 2022-08-22 15:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, edumazet, pabeni, gospo, Vikas Gupta

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

From: Vikas Gupta <vikas.gupta@broadcom.com>

Add missing devlink_set_features() API for callbacks reload_down
and reload_up to function.

Fixes: 228ea8c187d8 ("bnxt_en: implement devlink dev reload driver_reinit")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 059f96f7a96f..a36803e79e92 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -1306,6 +1306,7 @@ int bnxt_dl_register(struct bnxt *bp)
 	if (rc)
 		goto err_dl_port_unreg;
 
+	devlink_set_features(dl, DEVLINK_F_RELOAD);
 out:
 	devlink_register(dl);
 	return 0;
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 3/4] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips
  2022-08-22 15:06 [PATCH net 0/4] bnxt_en: Bug fixes Michael Chan
  2022-08-22 15:06 ` [PATCH net 1/4] bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use Michael Chan
  2022-08-22 15:06 ` [PATCH net 2/4] bnxt_en: set missing reload flag in devlink features Michael Chan
@ 2022-08-22 15:06 ` Michael Chan
  2022-08-22 15:06 ` [PATCH net 4/4] bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback Michael Chan
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Chan @ 2022-08-22 15:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, edumazet, pabeni, gospo, Vikas Gupta

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

From: Vikas Gupta <vikas.gupta@broadcom.com>

There are 2 issues:

1. We should decrement hw_resc->max_nqs instead of hw_resc->max_irqs
   with the number of NQs assigned to the VFs.  The IRQs are fixed
   on each function and cannot be re-assigned.  Only the NQs are being
   assigned to the VFs.

2. vf_msix is the total number of NQs to be assigned to the VFs.  So
   we should decrement vf_msix from hw_resc->max_nqs.

Fixes: b16b68918674 ("bnxt_en: Add SR-IOV support for 57500 chips.")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index 730febd19330..a4cba7cb2783 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -623,7 +623,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
 		hw_resc->max_stat_ctxs -= le16_to_cpu(req->min_stat_ctx) * n;
 		hw_resc->max_vnics -= le16_to_cpu(req->min_vnics) * n;
 		if (bp->flags & BNXT_FLAG_CHIP_P5)
-			hw_resc->max_irqs -= vf_msix * n;
+			hw_resc->max_nqs -= vf_msix;
 
 		rc = pf->active_vfs;
 	}
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 4/4] bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback
  2022-08-22 15:06 [PATCH net 0/4] bnxt_en: Bug fixes Michael Chan
                   ` (2 preceding siblings ...)
  2022-08-22 15:06 ` [PATCH net 3/4] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips Michael Chan
@ 2022-08-22 15:06 ` Michael Chan
  2022-08-23  3:04 ` [PATCH net 0/4] bnxt_en: Bug fixes Jakub Kicinski
  2022-08-23 22:40 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Chan @ 2022-08-22 15:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, edumazet, pabeni, gospo, Vikas Gupta

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

From: Vikas Gupta <vikas.gupta@broadcom.com>

LRO/GRO_HW should be disabled if there is an attached XDP program.
BNXT_FLAG_TPA is the current setting of the LRO/GRO_HW.  Using
BNXT_FLAG_TPA to disable LRO/GRO_HW will cause these features to be
permanently disabled once they are disabled.

Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index ba0f1ffac507..f46eefb5a029 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11178,10 +11178,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
 	if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp))
 		features &= ~NETIF_F_NTUPLE;
 
-	if (bp->flags & BNXT_FLAG_NO_AGG_RINGS)
-		features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
-
-	if (!(bp->flags & BNXT_FLAG_TPA))
+	if ((bp->flags & BNXT_FLAG_NO_AGG_RINGS) || bp->xdp_prog)
 		features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
 
 	if (!(features & NETIF_F_GRO))
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/4] bnxt_en: Bug fixes
  2022-08-22 15:06 [PATCH net 0/4] bnxt_en: Bug fixes Michael Chan
                   ` (3 preceding siblings ...)
  2022-08-22 15:06 ` [PATCH net 4/4] bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback Michael Chan
@ 2022-08-23  3:04 ` Jakub Kicinski
  2022-08-23 22:40 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2022-08-23  3:04 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, edumazet, pabeni, gospo

On Mon, 22 Aug 2022 11:06:50 -0400 Michael Chan wrote:
> This series includes 2 fixes for regressions introduced by the XDP
> multi-buffer feature, 1 devlink reload bug fix, and 1 SRIOV resource
> accounting bug fix.

Acked-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/4] bnxt_en: Bug fixes
  2022-08-22 15:06 [PATCH net 0/4] bnxt_en: Bug fixes Michael Chan
                   ` (4 preceding siblings ...)
  2022-08-23  3:04 ` [PATCH net 0/4] bnxt_en: Bug fixes Jakub Kicinski
@ 2022-08-23 22:40 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-23 22:40 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, kuba, edumazet, pabeni, gospo

Hello:

This series was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 22 Aug 2022 11:06:50 -0400 you wrote:
> This series includes 2 fixes for regressions introduced by the XDP
> multi-buffer feature, 1 devlink reload bug fix, and 1 SRIOV resource
> accounting bug fix.
> 
> Pavan Chebbi (1):
>   bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in
>     use
> 
> [...]

Here is the summary with links:
  - [net,1/4] bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use
    https://git.kernel.org/netdev/net/c/7dd3de7cb1d6
  - [net,2/4] bnxt_en: set missing reload flag in devlink features
    https://git.kernel.org/netdev/net/c/574b2bb9692f
  - [net,3/4] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips
    https://git.kernel.org/netdev/net/c/09a89cc59ad6
  - [net,4/4] bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback
    https://git.kernel.org/netdev/net/c/366c30474172

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-23 22:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 15:06 [PATCH net 0/4] bnxt_en: Bug fixes Michael Chan
2022-08-22 15:06 ` [PATCH net 1/4] bnxt_en: Use PAGE_SIZE to init buffer when multi buffer XDP is not in use Michael Chan
2022-08-22 15:06 ` [PATCH net 2/4] bnxt_en: set missing reload flag in devlink features Michael Chan
2022-08-22 15:06 ` [PATCH net 3/4] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips Michael Chan
2022-08-22 15:06 ` [PATCH net 4/4] bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback Michael Chan
2022-08-23  3:04 ` [PATCH net 0/4] bnxt_en: Bug fixes Jakub Kicinski
2022-08-23 22:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).