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 9CFFEA0350; Tue, 23 Jun 2020 15:42:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6EC021D646; Tue, 23 Jun 2020 15:42:48 +0200 (CEST) Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90122.outbound.protection.outlook.com [40.107.9.122]) by dpdk.org (Postfix) with ESMTP id 3B16E1C43A for ; Tue, 23 Jun 2020 15:42:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AA0lCH055L5vuazpb+hihiW7z+LGJrF3wzcMB57uFvi4ongC8R+5LFPGcZIEiKO0u155/qIiiAgPkQ3p4c5gMK1vqrUDd1RjhGiPeFS3I47uK/hhVHpqhKnhXzQX+5OC+7jJl23hiffuBudz335nC8KljiyZMhPsf9Bor291ThvnPG/CT9LXmC4zd2f0JoILNo2m4Bo5Lx/3WLgMhRbC+DMXLNF25igFlqn8pI82sEn3U3VH3FzAf1bHbVaUZn03Bgppp6xwwofGRTkVaJzIdZT7nSzjAFl0XzKVLxH3jCdqDEhX3/FTYrjQApDhWuqy0tneGUzonAOPbXJW5ARAcQ== 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=Ao2qD8TWiJvNW5rww4fQM/BUoqIq8xFUCwIFMoc3aco=; b=gpAhZyn1Z0i+cK0SkX9+mrwDM7ro5A+MZM+myvefaX+3UA/6s2lBGFRBXpvn6IEJXP42G27B6MItSSfjXCGn6gXEghcx5jjRPLDtddAsc6fFjl5X6pS0AExmnTHWC11o9HgsSfKUNG06wwkYLHIBjB0hh2ldinxa0U1ttwahMfVfaoU3mk2G2QLl4xyN6uWhH5LG9Q75VDHz9xFMIirg0wb/uzh+qJdXdGRygbgbEviBEUpsa4Z8DratxYWAiqr0MB95cJuXEK1lRlxtA5s2hFgvZx9Yx67ixJ9xVEFUsGQG+upKipajTwYiPFdVwWHO12NtQY+AWzHb92vzhs5kmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ekinops.com; dmarc=pass action=none header.from=ekinops.com; dkim=pass header.d=ekinops.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ekinops.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ao2qD8TWiJvNW5rww4fQM/BUoqIq8xFUCwIFMoc3aco=; b=vEEDI6wiNFY0UzPivGD6p8KZ5z+Rv3k5doW8CkC/+OVFRqyZE1sOW03RT4qsCBYq3RSf/0Lhi5YQJWgCpc/NbVjIZ4SMRMZqCcwxHBnWmVRX3slQiEFjCFC1f7gAZmtXubtgmH3m8073lwg6zR2SYB3Y7y17ZnQSgwWWp1LjudY= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=ekinops.com; Received: from MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1b::10) by MRXP264MB0694.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:19::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:42:46 +0000 Received: from MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM ([fe80::b9c3:a77c:6837:2548]) by MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM ([fe80::b9c3:a77c:6837:2548%6]) with mapi id 15.20.3109.027; Tue, 23 Jun 2020 13:42:46 +0000 From: Renata Saiakhova To: dev@dpdk.org Cc: Renata Saiakhova Date: Tue, 23 Jun 2020 15:42:11 +0200 Message-Id: <20200623134215.31092-1-Renata.Saiakhova@ekinops.com> X-Mailer: git-send-email 2.17.2 Content-Type: text/plain X-ClientProxiedBy: AM0PR01CA0079.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::20) To MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1b::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from renataOAB.oneaccess.intra (91.183.184.98) by AM0PR01CA0079.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:42:45 +0000 X-Mailer: git-send-email 2.17.2 X-Originating-IP: [91.183.184.98] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b3bfa99-9730-475a-864e-08d8177b4fae X-MS-TrafficTypeDiagnostic: MRXP264MB0694: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 04433051BF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pw7NpcCm0zNRMM+o0T2evamoTolBlNCMlCD8MWNw4k1Jq8OHopu7A19Yzr8Sc4BAHijRZAL2hteAwZaoKPk01qnkZIcLKTglIyQa8uNqTCxEDZcxAr+RxeBqYsYr+icRCcenafMU92g7nVKN7t7cCewwXAXRyy4Kq+42jbbiugxLxWu9st5TvEl+aKbCQwUIODABgc+XoJzuBwnEagKkiFchzTXZ1p39OBdKhh15zb240F2PmiR9EyU/PYHPNQ2A7Z+0BYqJsFDwXSI3aZKZzTJYhNldLUcQoxC9RJtjHwuil6VNDVa+uhTGU8TmaNGOdrtYcVDr3Vb1+cBXOAlmdg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(366004)(6486002)(956004)(2616005)(8676002)(6512007)(36756003)(52116002)(86362001)(26005)(107886003)(186003)(16526019)(6506007)(4326008)(1076003)(8936002)(498600001)(5660300002)(66476007)(66946007)(6666004)(66556008)(6916009)(83380400001)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: DdfHXh8efrDCMDTBAgfiZ4dDYiWu+Pk20fbnCigJZcy2dihaOf1RaDv7xNymK/AcJspOpYhK76tXVSAWNYIeZHkEVcI32M78ZnRZCQ+ZYvy0HEK0Ru92nccYbu2Ye2I+anMfIP+DECaMvYAVxjx2CXKb7+PxbPupSRAr5W2UrePpp9IRx0GqsP2aBDJYmqT5Bnx3hc0fU4bx1L/2WlFZCDxfyAz95SzQu9a4Q2BreNAQ9dZd6uOFb45xEPYX/9MTxdJCISczs0C3r86y6QXWYCTF1ONpz698X1l9oDHb4xPowRQnnLbEF8wZmiHlTTQ42/utvahZSY2rMV36zOdzxcpJ3W5q00eX+C8ILv+LJ6y4Cev7BdYwDCJ6D6ZiDo+g5/l2g2yU2urqs1yJ6dmvLgoaC0wdO7Gl43MshkGT6wL47lF10mp2XmTa3u9gYOH5V5cxp+1UdnJ/02iEtlfP0bns5VbDmpXM63cQlxAbTrU= X-OriginatorOrg: ekinops.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b3bfa99-9730-475a-864e-08d8177b4fae X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:42:45.9558 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f57b78a6-c654-4771-a72f-837275f46179 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8QtzG9Sb1vby4svwfpTAZ3pHlDk1e6ELGoz5vTwDiwGWiIwYcyyLZ59dECMcRkXY80de5obSh2wUcFFLGXKv4QRttzoz68HnH1vV/4yC/oA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MRXP264MB0694 Subject: [dpdk-dev] [PATCH v5 0/4] Memory corruption due to HW rings allocation 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" igb and ixgbe and some other drivers allocate HW rings using rte_eth_dma_zone_reserve(), which checks first if the memzone exists for a given name, consisting of port id, queue_id, rx/tx direction, but not for the size, alignment, and socket_id. If the memzone with a given name exists it is returned, otherwise it is allocated. Disconnecting dpdk port from one type of interface (igb) and connecting it to another type of interface (ixgbe) for the same port id, potentially creates memory overlap and corruption, because it may require memzone of bigger size. That's what is happening from switching from igb to ixgbe having the same port id. v4->v5: rte_eth_dma_zone_free() marked as __rte_internal instead of __rte_experimental v3->v4: Improve return code in rte_eth_dma_zone_free() in case mz is not found; Release explicitly i40e Flow Director rx/tx rings by calling rte_eth_dma_zone_free(). v2->v3: Remove #undef ETH_DMA_MZONE_NAME and minor changes in code standard. v1->v2: Minor changes on code standard and additional fixes in i40e em and ice drivers. Renata Saiakhova (4): ethdev: add function to release HW rings drivers/net: fix in igb and ixgbe HW rings memory drivers/net: fix in i40e HW rings memory overlap drivers/net: fix in em and ice HW rings memory overlap drivers/net/e1000/em_rxtx.c | 2 ++ drivers/net/e1000/igb_rxtx.c | 2 ++ drivers/net/i40e/i40e_fdir.c | 3 +++ drivers/net/i40e/i40e_rxtx.c | 2 ++ drivers/net/ice/ice_rxtx.c | 2 ++ drivers/net/ixgbe/ixgbe_rxtx.c | 2 ++ lib/librte_ethdev/rte_ethdev.c | 30 ++++++++++++++++++++++-- lib/librte_ethdev/rte_ethdev_driver.h | 17 ++++++++++++++ lib/librte_ethdev/rte_ethdev_version.map | 7 ++++++ 9 files changed, 65 insertions(+), 2 deletions(-) -- 2.17.2