netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/2] bnxt: don't reject XDP installation when HDS isn't forced on
@ 2025-02-20  0:53 Jakub Kicinski
  2025-02-20  0:53 ` [PATCH net 2/2] selftests: drv-net: test installing XDP with HDS set to auto Jakub Kicinski
  2025-02-20  1:58 ` [PATCH net 1/2] bnxt: don't reject XDP installation when HDS isn't forced on Daniel Xu
  0 siblings, 2 replies; 5+ messages in thread
From: Jakub Kicinski @ 2025-02-20  0:53 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, andrew+netdev, horms, dxu,
	Jakub Kicinski, daniel, hawk, john.fastabend, michael.chan,
	pavan.chebbi, ap420073

HDS flag is often set because GRO-HW is enabled. But we call
bnxt_set_rx_skb_mode() later, which will clear it. So make
sure we reject XDP when user asked for HDS, not when it's
enabled for other reasons.

Fixes: 87c8f8496a05 ("bnxt_en: add support for tcp-data-split ethtool command")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: daniel@iogearbox.net
CC: hawk@kernel.org
CC: john.fastabend@gmail.com
CC: michael.chan@broadcom.com
CC: pavan.chebbi@broadcom.com
CC: ap420073@gmail.com
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
index e6c64e4bd66c..ff208c4b7d70 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
@@ -11,10 +11,12 @@
 #include <linux/pci.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/ethtool_netlink.h>
 #include <linux/if_vlan.h>
 #include <linux/bpf.h>
 #include <linux/bpf_trace.h>
 #include <linux/filter.h>
+#include <net/netdev_queues.h>
 #include <net/page_pool/helpers.h>
 #include "bnxt_hsi.h"
 #include "bnxt.h"
@@ -395,7 +397,7 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
 			    bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);
 		return -EOPNOTSUPP;
 	}
-	if (prog && bp->flags & BNXT_FLAG_HDS) {
+	if (prog && dev->cfg->hds_config == ETHTOOL_TCP_DATA_SPLIT_ENABLED) {
 		netdev_warn(dev, "XDP is disallowed when HDS is enabled.\n");
 		return -EOPNOTSUPP;
 	}
-- 
2.48.1


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

end of thread, other threads:[~2025-02-20  3:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20  0:53 [PATCH net 1/2] bnxt: don't reject XDP installation when HDS isn't forced on Jakub Kicinski
2025-02-20  0:53 ` [PATCH net 2/2] selftests: drv-net: test installing XDP with HDS set to auto Jakub Kicinski
2025-02-20  1:58 ` [PATCH net 1/2] bnxt: don't reject XDP installation when HDS isn't forced on Daniel Xu
2025-02-20  2:14   ` Jakub Kicinski
2025-02-20  3:33     ` Taehee Yoo

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).