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 267EFA046B for ; Fri, 23 Aug 2019 18:36:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5AEB1BF40; Fri, 23 Aug 2019 18:36:09 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 2F46D1BF40 for ; Fri, 23 Aug 2019 18:36:08 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84803315C012; Fri, 23 Aug 2019 16:36:06 +0000 (UTC) Received: from [10.36.116.83] (ovpn-116-83.ams2.redhat.com [10.36.116.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54F1D60A9F; Fri, 23 Aug 2019 16:36:04 +0000 (UTC) To: abhishek.sachan@altran.com, linville@tuxdriver.com Cc: stable@dpdk.org References: <1566220460-6324-1-git-send-email-abhishek.sachan@altran.com> From: Kevin Traynor Message-ID: <8cc9eb9d-906e-b746-059a-e847317866dc@redhat.com> Date: Fri, 23 Aug 2019 17:36:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <1566220460-6324-1-git-send-email-abhishek.sachan@altran.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 23 Aug 2019 16:36:07 +0000 (UTC) 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" On 19/08/2019 14:14, 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 > Thank you for the backport. I also see the patch on the ML for master - will pick up for stable after it is merged into master. Btw, if a patch on master has the right Fixes:/Cc:stable tags and applies reasonably cleanly to stable, then it will be picked up for stables as part of the normal process. Just fyi as it might save you some effort sometime. thanks, Kevin. > 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); > } >