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 F0327A046B for ; Mon, 19 Aug 2019 20:45:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ADE0E23D; Mon, 19 Aug 2019 20:45:38 +0200 (CEST) Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 3EC9523D for ; Mon, 19 Aug 2019 20:45:37 +0200 (CEST) Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1hzmet-0003PI-Rp; Mon, 19 Aug 2019 14:45:35 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id x7JIZ5UE032760; Mon, 19 Aug 2019 14:35:05 -0400 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id x7JIZ5Me032759; Mon, 19 Aug 2019 14:35:05 -0400 Date: Mon, 19 Aug 2019 14:35:05 -0400 From: "John W. Linville" To: abhishek.sachan@altran.com Cc: stable@dpdk.org Message-ID: <20190819183505.GB17726@tuxdriver.com> References: <1566220460-6324-1-git-send-email-abhishek.sachan@altran.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566220460-6324-1-git-send-email-abhishek.sachan@altran.com> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-stable] [PATCH 18.11] net/af_packet: fix for stale sockets 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" As indicated, I've already seen this patch. Please merge it as Abhishek is requesting. Thanks, John On Mon, Aug 19, 2019 at 06:44:20PM +0530, abhishek.sachan@altran.com wrote: > From: abhishek sachan > > 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 > > 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 264cfc0..657ad85 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) > { > 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); > > 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.7.4 > > -- John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready.