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 733A1A046B for ; Thu, 22 Aug 2019 08:29:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 34D171BF6F; Thu, 22 Aug 2019 08:29:19 +0200 (CEST) Received: from mx07-001f8a01.pphosted.com (mx07-001f8a01.pphosted.com [62.209.51.162]) by dpdk.org (Postfix) with ESMTP id 60D701BF48; Thu, 22 Aug 2019 08:29:18 +0200 (CEST) Received: from pps.filterd (m0162091.ppops.net [127.0.0.1]) by mx07-001f8a01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7M6TIJH013173; Thu, 22 Aug 2019 08:29:18 +0200 Received: from ind01-bo1-obe.outbound.protection.outlook.com (mail-bo1ind01lp2054.outbound.protection.outlook.com [104.47.101.54]) by mx07-001f8a01.pphosted.com with ESMTP id 2uh8fksegf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 22 Aug 2019 08:29:17 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EcwIkf/g1B/3zTDUiC8fYQpyYsJabHnm5a2z3Xuve9UBCSJeoe9BaAHXz9zBaAkjAqOLG7Wh8wKIR7RhcdM6+mmkfXk6m0KPnBYFNHMGvmLTM6/2YGRUx8RApAM2UNQvsTk8RJ+VDuN4BMARYrx3RcHHrcT6pB38P7k9rY2B0cf4Y4j4LkoTDMKe3lvqakddtrWoiGCmlxZS8h8W7AXLYABDHi8mpBji2LU3+6IMTH2cw1q8ZPnlzLtmm5NrEaVYl0EA+EjvzHUoSN6YibxUE27I5WpAOcGiJxHp3uZ2EjCE+Dro8IdBohXCW/JYRLK3eFUh/++JzkZQ9w9xklc+KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=evmzIUCsSGxpOeBwfxgO//mpFOlLx4bom0gcUaq/5sk=; b=ZsXZ5iM1FS4gSqlGDy97DPCNGOdePOcjEtTnCjwnO95xZsAdIbUF7UxvI2u/HiWfBdYcoe76NTcNs+iw79dj7FiOUm+zYGrP+jeuSgwI6d8mEfw2IkRikziXquhkXD7oDxl+TuBG+YHI7zc0uJdSGn1Qgwq0JYxxqByI2CsDr1C5RTYbB6FRmhO+H7IqW5gWga5N+ao0tm/pGpre0008dB4lq9WNbRt/Aco5kD1b7GpEbq9GgB+8vnzoy+mINOCwH2pB2N4bkcQb5BSrdf868VMdFwCUfVkDYKIaA2OIOH6PS32RtUTRWUopB/yTr0K3q5LwU6xXQ4lB6+yzKnap9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 121.241.96.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=aricent.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=altran.com; dkim=none (message not signed); arc=none Received: from MAXPR0101CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::34) by MAXPR01MB2943.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:54::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Thu, 22 Aug 2019 06:28:50 +0000 Received: from HK2APC01FT027.eop-APC01.prod.protection.outlook.com (2a01:111:f400:7ebc::202) by MAXPR0101CA0072.outlook.office365.com (2603:1096:a00:e::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16 via Frontend Transport; Thu, 22 Aug 2019 06:28:49 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning aricent.com discourages use of 121.241.96.4 as permitted sender) Received: from GURHYBRID01.AD.ARICENT.COM (121.241.96.4) by HK2APC01FT027.mail.protection.outlook.com (10.152.248.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.13 via Frontend Transport; Thu, 22 Aug 2019 06:28:49 +0000 Received: from GURHYBRID02.AD.ARICENT.COM (10.203.26.140) by GURHYBRID02.AD.ARICENT.COM (10.203.26.140) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 22 Aug 2019 11:56:56 +0530 Received: from gurux105.gur.aricent.com (10.203.159.187) by GURHYBRID02.AD.ARICENT.COM (10.203.26.100) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 22 Aug 2019 11:56:56 +0530 Received: from gurux118.gur.aricent.com ([10.203.158.20]) by gurux105.gur.aricent.com (8.14.4/8.14.4) with ESMTP id x7M6QuCF015638; Thu, 22 Aug 2019 11:56:56 +0530 Received: from localhost.localdomain ([172.19.57.242]) by gurux118.gur.aricent.com (8.14.4/8.13.8) with ESMTP id x7M6QAEa008867; Thu, 22 Aug 2019 11:56:41 +0530 From: Abhishek Sachan To: CC: , Date: Thu, 22 Aug 2019 11:55:36 +0530 Message-ID: <1566455136-8496-1-git-send-email-abhishek.sachan@altran.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:121.241.96.4; IPV:CAL; SCL:-1; CTRY:IN; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(136003)(39860400002)(376002)(396003)(2980300002)(199004)(189003)(44832011)(54906003)(16586007)(2906002)(316002)(8676002)(2616005)(305945005)(8936002)(476003)(50226002)(486006)(51416003)(81156014)(26005)(478600001)(48376002)(50466002)(4326008)(47776003)(5660300002)(126002)(36756003)(42882007)(81166006)(336012)(2351001)(49486002)(6666004)(356004)(76130400001)(186003)(26826003)(70206006)(70586007)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:MAXPR01MB2943; H:GURHYBRID01.AD.ARICENT.COM; FPR:; SPF:SoftFail; LANG:en; PTR:121.241.96.4.static-delhi.vsnl.net.in; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0388b16-803a-45a2-e735-08d726c9fe52 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600166)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328); SRVR:MAXPR01MB2943; X-MS-TrafficTypeDiagnostic: MAXPR01MB2943: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:170; X-Forefront-PRVS: 01371B902F X-MS-Exchange-SenderADCheck: 2 X-Microsoft-Antispam-Message-Info: yMfn8tBHa4X6NYAbmcNizNpoxuQssYkmTZ/jl5GiGtH3qeW4VTPDVuj1oV3dAZ60wT5VmX+pcLClyilZWDXBw+GixFiEcZY0K1CRcjYgfhathyu+P4Bvcans+J6lxqyYa8wgbEX93Sc4GF4KeqRmw808pff0J8uuBee411X4d4n08K1zWlsForll/v0s3LAaguiiyWS5WXTMWOOWkOaJZI3CbdAXHjDEAyYtAlRWpFbZnmFvs6a2iZSR09Dzuhg8TWaPddRYq1af6YVRtrNP6DVizW/bivwbTyzyocbGfqyW01acUJFEEuupLm1wnGap9oZublRHaUCK2vKj94zmHH008hJ17XKe/smcd34pKSiMPQVIVCx9UeNKGavgAPKHL2goGhinxNcHVkjIL3VlH5djAMmiFQfmjDwegAfuKgE= X-OriginatorOrg: Aricent.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2019 06:28:49.0610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0388b16-803a-45a2-e735-08d726c9fe52 X-MS-Exchange-CrossTenant-Id: dbb4cbbe-57c5-469d-b342-a9814e1d2382 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=dbb4cbbe-57c5-469d-b342-a9814e1d2382; Ip=[121.241.96.4]; Helo=[GURHYBRID01.AD.ARICENT.COM] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MAXPR01MB2943 X-Proofpoint-Spam-Details: rule=outgoing_spam_policy_notspam policy=outgoing_spam_policy score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=941 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908220070 Subject: [dpdk-dev] [PATCH] net/af_packet: fix for stale sockets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Cc: stable@dpdk.org 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 82bf2cd..6df09f2 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