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 0AB32A04F3 for ; Thu, 19 Dec 2019 15:35:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECB5B1B9BF; Thu, 19 Dec 2019 15:35:03 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 9E2EB1BE8E for ; Thu, 19 Dec 2019 15:35:02 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id q6so6184851wro.9 for ; Thu, 19 Dec 2019 06:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=19CzwcFP4SwEofpfIiRRLDBTTNouKz96BbJZgOD0Ejw=; b=Y6XmQgVe7qr7TtYyxqWV5aXOFkabpvGPU7J7bb/mncCMfVe1tg8rQDky4lvzh+z215 61JqyG8gUNrNx3HuY/cbm5bMV43d3Uuu3E8zG+lDNE2N/tRbIOOcNUdgdYEeoFD9hyTL P9c92S/lUgJW4g8xDH+yT4IX8J2sSciS58K7eeXNmpx+rWzDiw7de8yPbaag4HhTnwtp 5mgVWMko3dTe8jem1sThtip8WCL39OFmAWYv1bdkkmU/qA8x42eaxo1qGW/v3V6b+Wm8 H+sJFXtXhBcK1jkiJsFpeG7S05hGdvQrszM/vli0a1xmxqjbRD4y72GaiQnFDi865kEr QsRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=19CzwcFP4SwEofpfIiRRLDBTTNouKz96BbJZgOD0Ejw=; b=HZTqEhAufV39GiZ/TVs9SBT4k58ij7mkQw0UpdZq/Kun+Bq3FBCPa5JvWBIoyJ88E+ 1W+mX4CjlBoc+60jVQhwEzkYODPunF82q9+iILM+ul12fxaOclu2g36UEomxzkSfLEel ilK9Lcw2EputFYCVfuieKmmzo5f2wwq9s2NlopJ4N+VZfIWyVOVCOMy8k/QFuPm8mYku auPJiDGuM7BK8YpztSL4gQXxawb//Ki5gX4La2fePQq1K5sYGjw56PqC7aQe55clXsp6 9EcvwEECEXfNOWo1bknFRLfWdDVQcNHX3whYTlzP9Fp7pDULlGLl2Z0hg4aH5z7lgD5s yEiQ== X-Gm-Message-State: APjAAAV+hGPv+HT9KeyabjwXaynJsMsvi2qYngnTlD+2zqewqYiRcH9x qiBzfK61PceNkPwt/eOgHKWf2bBb X-Google-Smtp-Source: APXvYqybsAmDWIIUtG0YRnqpak4/F/U3uEVRpa8Rs1VwwSO7IviIIaCvThZlQgi4hTPD3+Pu7PbI+g== X-Received: by 2002:adf:d4ca:: with SMTP id w10mr9244579wrk.53.1576766102310; Thu, 19 Dec 2019 06:35:02 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id k13sm6560269wrx.59.2019.12.19.06.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:35:01 -0800 (PST) From: luca.boccassi@gmail.com To: Abhishek Sachan Cc: "John W . Linville" , dpdk stable Date: Thu, 19 Dec 2019 14:32:32 +0000 Message-Id: <20191219143447.21506-5-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/af_packet: fix stale sockets' has been queued to LTS release 17.11.10 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 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/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. Thanks. Luca Boccassi --- >From e07be862135bb569c11b1f9d6ef8a628ce1ae158 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_packet/rte_eth_af_packet.c index 5cb348f675..4735280902 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -982,6 +982,7 @@ 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; RTE_LOG(INFO, PMD, "Closing AF_PACKET ethdev on numa socket %u\n", @@ -996,7 +997,10 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev) return -1; 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.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:26.547087975 +0000 +++ 0005-net-af_packet-fix-stale-sockets.patch 2019-12-19 14:32:25.397283786 +0000 @@ -1,8 +1,10 @@ -From 7c3bcc7b6dc14623bd17960fa3236e6fa9e2711b Mon Sep 17 00:00:00 2001 +From e07be862135bb569c11b1f9d6ef8a628ce1ae158 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. @@ -13,7 +15,6 @@ Bugzilla ID: 339 Fixes: e6ee4db01b4d ("af_packet: make the device detachable") -Cc: stable@dpdk.org Signed-off-by: Abhishek Sachan Reviewed-by: John W. Linville @@ -22,19 +23,19 @@ 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 82bf2cd581..6df09f2828 100644 +index 5cb348f675..4735280902 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c -@@ -972,6 +972,7 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev) +@@ -982,6 +982,7 @@ 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; - PMD_LOG(INFO, "Closing AF_PACKET ethdev on numa socket %u", -@@ -992,7 +993,10 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev) - return rte_eth_dev_release_port(eth_dev); + RTE_LOG(INFO, PMD, "Closing AF_PACKET ethdev on numa socket %u\n", +@@ -996,7 +997,10 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev) + return -1; internals = eth_dev->data->dev_private; + req = &internals->req;