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 A8B55A034F; Wed, 13 May 2020 15:15:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7CE931D5AF; Wed, 13 May 2020 15:15:02 +0200 (CEST) Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90130.outbound.protection.outlook.com [40.107.9.130]) by dpdk.org (Postfix) with ESMTP id B888A1D5AC for ; Wed, 13 May 2020 15:15:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VmNiDIDtoRvGRKjjMdCKGCOwjKsr5xad5u2vXucifyWak+CTVhqOl0j6VW7Mk57OXiImvuGtKZ2Dm/aufnbbGpWziMtxTGf0RaXIiYKmusPlk3egF/w9HqcqdiATMF7ur+oV0KCwFAgsSgW4M9lOFuz7rwgc5v+DflgZT7VfzFysGSsI27GBryJD4H4ziCWTUxVtbHktXoq8wihYTDPjWW+7LZFubMfVeS5PrxVnkvRQTj4rqeiAQSwwT0Tnt7O1QAtPBf+ScfiC5sM55Gvlp90rW8ux93LwnEihYEezSsMBlHckrRDlYHjaAA8Vcx0A24TEBDBeSe9X4ibAP2AF+Q== 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=D0oKBIw+7Haqs0Qhl/RfNecUFAMF+UHxdZKhJY3M+jQ=; b=hf43Vtwv/qt/mMVnGxWqW0Hvoq9SFx/e6C1iT0JIDEx+Gg1/HWRlySqrcUecHeyKuyjlEgrr7oaN3fbkrFtfp2J+cmlTKb46+X1YiNThZ8X2hJCj1JavyAEQb5UrOy7MrD9SRipmuoQ5upSaxpGxvzuqeEq1y10AZXiZgalwsTk+lNeu59oXE1JYjVZNQZw4o4yTg7D3JGMwogkFtdIVZQ1DrRg5krurPT17RHn+S9K631cCXHgvgZHqL30O0k9/MrNtOL9bIVZEICiE5WmbqMQsHh2CeBWTsESRlvJiGu/9SgpC4Ud1Vsj3EftKzxnFzJqEE01bEq8qP5P77uVNkA== 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=D0oKBIw+7Haqs0Qhl/RfNecUFAMF+UHxdZKhJY3M+jQ=; b=uZJeNPd4Y+j8Jub5o4faiYKzDT4hjG64HRhoZIJt8oQ3aZcnNvndS5ZqiYcLOFzMSeSlx+/OVhevOVwQatUApiUfaoLCJE7fsni7hK0Kt2SqWTPJ0YJRg7Cs5SNA/5m5v25YMSeerrA6VIJOEm820GMRe9RObkuS8P248PW6O4s= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=ekinops.com; Received: from MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM (52.134.49.19) by MRXP264MB0359.FRAP264.PROD.OUTLOOK.COM (52.134.50.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Wed, 13 May 2020 13:15:00 +0000 Received: from MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM ([fe80::41a7:e761:6112:5c08]) by MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM ([fe80::41a7:e761:6112:5c08%7]) with mapi id 15.20.2979.033; Wed, 13 May 2020 13:15:00 +0000 From: Renata Saiakhova To: dev@dpdk.org Cc: Renata Saiakhova Date: Wed, 13 May 2020 15:14:21 +0200 Message-Id: <20200513131425.27817-1-Renata.Saiakhova@ekinops.com> X-Mailer: git-send-email 2.17.2 Content-Type: text/plain X-ClientProxiedBy: AM0PR06CA0123.eurprd06.prod.outlook.com (2603:10a6:208:ab::28) To MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:22::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from renataOAB.oneaccess.intra (91.183.184.98) by AM0PR06CA0123.eurprd06.prod.outlook.com (2603:10a6:208:ab::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Wed, 13 May 2020 13:15:00 +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: c60690e9-256e-45fc-a822-08d7f73fa409 X-MS-TrafficTypeDiagnostic: MRXP264MB0359: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0402872DA1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FqoNj1MxJ1Uisx35c3BgGhT80u/3OnnRYcMDmoEuCRN5N1L8SNA1BxY3yWyhGZkJkJrXXxUxHapxpC0VaQKr/JRJWivRFjDkhXAMnshp0xE63pJew37HIUdpW6/BKIWhaoesdUq3CQmATIFuBBV9nbOhM2be39QlM/xqGYL/tiLtd69x45Biz81Ds2U3Ip4fgzWSFHRsuzXC/8BoxelosC5+uBYb35Wkdu7Kfa5KJ12+i6/zP9otQ2818WWJDPhCPHydWMTRKr1asbnaTbA3m+7l6MjU30qs1fKPCiD+pGSk/yxZmalrFzJSgsj0RtIgugQ5noYd+HTX1DlePtBcFPrdqkq60bxnYsTO1Te3tFggPFUE3w55di26QrMNVfw6fkpfGuugTtNDXb9twQXWxQIipJKwEh9DdBfgchToC0SlhVzAxOFw1TTmtJbryFdawp+Bvh06w3zR1Q9wI5R0cekoO5lMtPfPssWxqMzIaqMm8b42NJcSftYxikZWfBtSzbAq1LZJwWuJLSn+efS8FQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(346002)(376002)(136003)(366004)(39850400004)(396003)(33430700001)(16526019)(33440700001)(8936002)(6486002)(5660300002)(2616005)(86362001)(956004)(6512007)(107886003)(66476007)(66556008)(316002)(66946007)(4326008)(6506007)(2906002)(26005)(6666004)(36756003)(52116002)(186003)(6916009)(478600001)(8676002)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: JLpMjq+9Dt6eMyNgBaqfpJOBKaaRmqHVjYR743SAwobl5tZ3lM1dwLGqFlQp4CO2q0f3cXwdHFdGvEy1sFTmVAW0X2MjqDZH8JDY6IxmdYlRjegS9mVlRr2u5ejnrc8aPf7sjeKSik8MoJroldnwbt6zJmXXm0oq+1jzKZ7cM6ds1bc+Mp4vUtR14HSHMZPQA4k1Ur0prh9e/x3/WJMAcz6raB1SfouC3kqyHE/XKYjxjQWWy7YWgjNSnLw2NTisxdqlYgFn5W1OibGMfamhdHXfc/0DoDYS9fPuOgURF0aXrKuBQyboof8nCHi6AuXYLttQlTNl175nAB4WFttgdIIPCKOU3LMrorGZI8M0oTwxaM+O8/uA8MS2yYic0kCl+fJ+kAxkIWi9SjMTVAuZIpgoV0bv4lAtX3gWv+E1YYvK464BiqW4Rt8gaOb6VgwH0E7ZLJ4c6Vg35WodbY5prHPioRpPFPbmPMl2Pgq+J2tVlKhZ6Xe6KPuVELBZeoYM X-OriginatorOrg: ekinops.com X-MS-Exchange-CrossTenant-Network-Message-Id: c60690e9-256e-45fc-a822-08d7f73fa409 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2020 13:15:00.4840 (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: KHRQ/erZ/sD1DgKk/sxlR80uU9tpGzMlMg2EAIKPLknGSIeTbZwOIJs1lxFLkS/NC9XAu3xNsPqbK493HaxSmZZYK+qbfUzXBlQz3XodJic= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MRXP264MB0359 Subject: [dpdk-dev] [PATCH v3 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. 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): librte_ethdev: Introduce a 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_rxtx.c | 2 ++ drivers/net/ice/ice_rxtx.c | 2 ++ drivers/net/ixgbe/ixgbe_rxtx.c | 2 ++ lib/librte_ethdev/rte_ethdev.c | 28 ++++++++++++++++++++++-- lib/librte_ethdev/rte_ethdev_driver.h | 20 +++++++++++++++++ lib/librte_ethdev/rte_ethdev_version.map | 1 + 8 files changed, 57 insertions(+), 2 deletions(-) -- 2.17.2