linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx4_en: Fix bpf_prog_add ref_cnt in mlx4
@ 2016-11-09  7:35 Zhiyi Sun
  2016-11-09  9:05 ` Daniel Borkmann
  0 siblings, 1 reply; 8+ messages in thread
From: Zhiyi Sun @ 2016-11-09  7:35 UTC (permalink / raw)
  To: bblanco, Tariq Toukan, Yishai Hadas, netdev, linux-rdma, linux-kernel
  Cc: zhiyisun

There are rx_ring_num queues. Each queue will load xdp prog. So
bpf_prog_add() should add rx_ring_num to ref_cnt.

Signed-off-by: Zhiyi Sun <zhiyisun@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 12c99a2..d25e150 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2650,7 +2650,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
 	 */
 	if (priv->xdp_ring_num == xdp_ring_num) {
 		if (prog) {
-			prog = bpf_prog_add(prog, priv->rx_ring_num - 1);
+			prog = bpf_prog_add(prog, priv->rx_ring_num);
 			if (IS_ERR(prog))
 				return PTR_ERR(prog);
 		}
@@ -2680,7 +2680,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
 	}
 
 	if (prog) {
-		prog = bpf_prog_add(prog, priv->rx_ring_num - 1);
+		prog = bpf_prog_add(prog, priv->rx_ring_num);
 		if (IS_ERR(prog))
 			return PTR_ERR(prog);
 	}
-- 
2.9.3

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

end of thread, other threads:[~2016-11-09 19:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09  7:35 [PATCH] net/mlx4_en: Fix bpf_prog_add ref_cnt in mlx4 Zhiyi Sun
2016-11-09  9:05 ` Daniel Borkmann
2016-11-09  9:45   ` Zhiyi Sun
2016-11-09  9:57     ` Daniel Borkmann
2016-11-09 10:58       ` [PATCH net-next 1/2] bpf, mlx4: fix prog refcount in mlx4_en_try_alloc_resources error path kbuild test robot
2016-11-09 11:04         ` Daniel Borkmann
2016-11-09 17:06       ` [PATCH] net/mlx4_en: Fix bpf_prog_add ref_cnt in mlx4 Brenden Blanco
2016-11-09 19:05         ` Daniel Borkmann

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