All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ixgbe: let the xdpdrv work with more than 64 cpus
@ 2021-08-24 10:49 ` kerneljasonxing
  0 siblings, 0 replies; 20+ messages in thread
From: kerneljasonxing @ 2021-08-24 10:49 UTC (permalink / raw)
  To: jesse.brandeburg, anthony.l.nguyen, davem, kuba, ast, daniel,
	hawk, john.fastabend, andrii, kafai, songliubraving, yhs,
	kpsingh
  Cc: intel-wired-lan, netdev, linux-kernel, bpf, kerneljasonxing,
	Jason Xing, Shujin Li

From: Jason Xing <xingwanli@kuaishou.com>

Originally, ixgbe driver doesn't allow the mounting of xdpdrv if the
server is equipped with more than 64 cpus online. So it turns out that
the loading of xdpdrv causes the "NOMEM" failure.

Actually, we can adjust the algorithm and then make it work, which has
no harm at all, only if we set the maxmium number of xdp queues.

Fixes: 33fdc82f08 ("ixgbe: add support for XDP_TX action")
Co-developed-by: Shujin Li <lishujin@kuaishou.com>
Signed-off-by: Shujin Li <lishujin@kuaishou.com>
Signed-off-by: Jason Xing <xingwanli@kuaishou.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c  | 2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index 0218f6c..5953996 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -299,7 +299,7 @@ static void ixgbe_cache_ring_register(struct ixgbe_adapter *adapter)
 
 static int ixgbe_xdp_queues(struct ixgbe_adapter *adapter)
 {
-	return adapter->xdp_prog ? nr_cpu_ids : 0;
+	return adapter->xdp_prog ? min_t(int, MAX_XDP_QUEUES, nr_cpu_ids) : 0;
 }
 
 #define IXGBE_RSS_64Q_MASK	0x3F
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 14aea40..b36d16b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -10130,9 +10130,6 @@ static int ixgbe_xdp_setup(struct net_device *dev, struct bpf_prog *prog)
 			return -EINVAL;
 	}
 
-	if (nr_cpu_ids > MAX_XDP_QUEUES)
-		return -ENOMEM;
-
 	old_prog = xchg(&adapter->xdp_prog, prog);
 	need_reset = (!!prog != !!old_prog);
 
-- 
1.8.3.1


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

end of thread, other threads:[~2021-08-26 14:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 10:49 [PATCH] ixgbe: let the xdpdrv work with more than 64 cpus kerneljasonxing
2021-08-24 10:49 ` [Intel-wired-lan] " kerneljasonxing
2021-08-24 13:32 ` Jesper Dangaard Brouer
2021-08-24 13:32   ` [Intel-wired-lan] " Jesper Dangaard Brouer
2021-08-24 15:23   ` Jason Xing
2021-08-24 15:23     ` [Intel-wired-lan] " Jason Xing
2021-08-24 15:32     ` Maciej Fijalkowski
2021-08-24 15:32       ` [Intel-wired-lan] " Maciej Fijalkowski
2021-08-25 11:59       ` Jason Xing
2021-08-25 11:59         ` [Intel-wired-lan] " Jason Xing
2021-08-25 12:02         ` [PATCH v2] " kerneljasonxing
2021-08-25 12:02           ` [Intel-wired-lan] " kerneljasonxing
2021-08-26  8:51           ` Maciej Fijalkowski
2021-08-26  8:51             ` [Intel-wired-lan] " Maciej Fijalkowski
2021-08-26 10:56             ` Jason Xing
2021-08-26 10:56               ` [Intel-wired-lan] " Jason Xing
2021-08-26 14:01               ` [PATCH v3] " kerneljasonxing
2021-08-26 14:01                 ` [Intel-wired-lan] " kerneljasonxing
2021-08-26 14:04                 ` Jason Xing
2021-08-26 14:04                   ` [Intel-wired-lan] " Jason Xing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.