From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1010CA04C3 for ; Fri, 22 Nov 2019 15:42:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08ED6237; Fri, 22 Nov 2019 15:42:02 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id CF2B2237 for ; Fri, 22 Nov 2019 15:41:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574433719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UWdIRs3Dj3lBHBA69ClnVv88sIxzusDAk/hSnnQ2ZHE=; b=SH1HrRB3aJI1Nq697v3XHi6yjySv87ThPg2CCLFKMu4qvTzoITEbEeGyJyT2qS2I79rl80 dv1Yw3Upyt6cSGq0JWTlG3++9gqCwN28015HnGum1FywiSCG6h0J51HasM9NArKPhgOp2N LX/c3YJGoYUSR5pc9Wv6yINvNxW1DPo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-df_0Pa8UOD-FhkiBYnBs0w-1; Fri, 22 Nov 2019 09:41:56 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 90F26107B7E7; Fri, 22 Nov 2019 14:41:55 +0000 (UTC) Received: from rh.redhat.com (unknown [10.36.118.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F51B6E713; Fri, 22 Nov 2019 14:41:53 +0000 (UTC) From: Kevin Traynor To: Abhishek Sachan Cc: "John W . Linville" , dpdk stable Date: Fri, 22 Nov 2019 14:40:52 +0000 Message-Id: <20191122144131.21231-6-ktraynor@redhat.com> In-Reply-To: <20191122144131.21231-1-ktraynor@redhat.com> References: <20191122144131.21231-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: df_0Pa8UOD-FhkiBYnBs0w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/af_packet: fix stale sockets' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 rebasi= ng (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/007d5fe26392de60ce= f606f254a6b94318f740c4 Thanks. Kevin. --- >From 007d5fe26392de60cef606f254a6b94318f740c4 Mon Sep 17 00:00:00 2001 From: Abhishek Sachan 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 Reviewed-by: John W. Linville --- 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_pac= ket/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) =09struct rte_eth_dev *eth_dev =3D NULL; =09struct pmd_internals *internals; +=09struct tpacket_req *req; =09unsigned q; =20 @@ -991,5 +992,8 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev) =20 =09internals =3D eth_dev->data->dev_private; +=09req =3D &internals->req; =09for (q =3D 0; q < internals->nb_queues; q++) { +=09=09munmap(internals->rx_queue[q].map, +=09=09=092 * req->tp_block_size * req->tp_block_nr); =09=09rte_free(internals->rx_queue[q].rd); =09=09rte_free(internals->tx_queue[q].rd); --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-11-22 14:36:55.539745133 +0000 +++ 0006-net-af_packet-fix-stale-sockets.patch=092019-11-22 14:36:55.123150= 867 +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@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)