[dpdk-stable] patch 'net/af_packet: fix stale sockets' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Fri Nov 22 15:40:52 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/29/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/007d5fe26392de60cef606f254a6b94318f740c4

Thanks.

Kevin.

---
>From 007d5fe26392de60cef606f254a6b94318f740c4 Mon Sep 17 00:00:00 2001
From: Abhishek Sachan <abhishek.sachan at altran.com>
Date: Thu, 22 Aug 2019 11:55:36 +0530
Subject: [PATCH] net/af_packet: fix stale sockets

[ upstream commit 7c3bcc7b6dc14623bd17960fa3236e6fa9e2711b ]

af_packet driver is leaving stale socket after device is removed.

Ring buffers are memory mapped when device is added using rte_dev_probe.
There is no corresponding munmap call when device is removed/closed.

This commit fixes the issue by calling munmap
from rte_pmd_af_packet_remove().

Bugzilla ID: 339
Fixes: e6ee4db01b4d ("af_packet: make the device detachable")

Signed-off-by: Abhishek Sachan <abhishek.sachan at altran.com>
Reviewed-by: John W. Linville <linville at tuxdriver.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index cca223952..2e32b3d3c 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -971,4 +971,5 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)
 	struct rte_eth_dev *eth_dev = NULL;
 	struct pmd_internals *internals;
+	struct tpacket_req *req;
 	unsigned q;
 
@@ -991,5 +992,8 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)
 
 	internals = eth_dev->data->dev_private;
+	req = &internals->req;
 	for (q = 0; q < internals->nb_queues; q++) {
+		munmap(internals->rx_queue[q].map,
+			2 * req->tp_block_size * req->tp_block_nr);
 		rte_free(internals->rx_queue[q].rd);
 		rte_free(internals->tx_queue[q].rd);
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-11-22 14:36:55.539745133 +0000
+++ 0006-net-af_packet-fix-stale-sockets.patch	2019-11-22 14:36:55.123150867 +0000
@@ -1 +1 @@
-From 7c3bcc7b6dc14623bd17960fa3236e6fa9e2711b Mon Sep 17 00:00:00 2001
+From 007d5fe26392de60cef606f254a6b94318f740c4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7c3bcc7b6dc14623bd17960fa3236e6fa9e2711b ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 82bf2cd58..6df09f282 100644
+index cca223952..2e32b3d3c 100644
@@ -28 +29 @@
-@@ -973,4 +973,5 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)
+@@ -971,4 +971,5 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)
@@ -34 +35 @@
-@@ -993,5 +994,8 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)
+@@ -991,5 +992,8 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)



More information about the stable mailing list