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 8BB7FA034F; Wed, 13 May 2020 11:17:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E6AF1D171; Wed, 13 May 2020 11:17:11 +0200 (CEST) Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120101.outbound.protection.outlook.com [40.107.12.101]) by dpdk.org (Postfix) with ESMTP id A31B71D15D for ; Wed, 13 May 2020 11:17:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LgPJFFl373bBi7cP5FlP5wRQ23UTefapHCMoJbT8b13JHkZv5TyltDZCH5zjb13IVbuYexTTtdxOkcSj9JMmgCKaWMAUWq/UVy54TdsBtq0JM/f1+Te/Ec5S4Sszi4M/1KT+rMVGwGycPYbsQcOk6avNnjnWebd06EHW5QHGWh1C3jUHIzpCJ3M4U8CEV0JGKmyjA0CtpWr4XcybyoTqVOdFZk7wVzVYcrEAG1C6dvfwUx00fKosybKsVPzMq0VBZIYPxFdJmWKY04d1WIiIBxmgDNUtjl+6xIFzlW1VrKwKr4CmnK2hwAEh30QBRCxl6BuqdjOlPNNzbFkKaMIbpw== 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=Os5D6pmdb/KjW5fzHEyyI93o+XgKbIkcKcfsuAsK3Ho=; b=Gxl4Yl2T/ef4rt/Ti7Low6tHhMfSlCSRknSr+zqjdkrOlw+XslLFu87y1wztlTCTUarw/yHgzxzoca49q1m1XWTYNKhRxJaGlX+RcsUqsETW5giiMKhwo3s77R9tfGq1AMAspP1VQlflbTFGr8WrIZL/U/OzHqoaeGx/ZvdB15I0vUsf08+p7PSBFCn/NMbaSxi+olA0qCUj2pRb5AvAYpWlYgMiXqECymjzdjc1qm+Fk7R8BADDBp63PxglutVe1hvgblHJ49duNuQ3ik2hEuPet10BhiyPOynZ223VnIjA/4qKkZ2ixoIR4WE4S9IJvaApu6MdCZKaKtlTIFLSDQ== 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=Os5D6pmdb/KjW5fzHEyyI93o+XgKbIkcKcfsuAsK3Ho=; b=giUo/Rx91jPAeIWy9ucVF1NgGVxF3Zr3YN1SLqPdZWHKNgh/troI24/0JZqZL0ccfL825aAReoLtThiGQbB3Kf24hDs8Me+PE9UL+Cjdbf7EK3hh/GmNryFXImYZXBt3PV7coj09xrbmPuI3Eavtm7k4pKnzT5waKECtZN2tUdY= 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 MRXP264MB0183.FRAP264.PROD.OUTLOOK.COM (52.134.44.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Wed, 13 May 2020 09:17:07 +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 09:17:07 +0000 From: Renata Saiakhova To: Cc: dev@dpdk.org, Renata Saiakhova Date: Wed, 13 May 2020 11:15:43 +0200 Message-Id: <20200513091547.19658-1-Renata.Saiakhova@ekinops.com> X-Mailer: git-send-email 2.17.2 Content-Type: text/plain X-ClientProxiedBy: AM4PR05CA0018.eurprd05.prod.outlook.com (2603:10a6:205::31) 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 AM4PR05CA0018.eurprd05.prod.outlook.com (2603:10a6:205::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.30 via Frontend Transport; Wed, 13 May 2020 09:17:07 +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: 3c83b482-7539-44f9-2365-08d7f71e689a X-MS-TrafficTypeDiagnostic: MRXP264MB0183: 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: PcQhNtOridhaS9Wf1AjTKTTT0kfi4jrIlBj612XFmwwC/EcaZ78Somviqa+ZZzTXr4NOY41gpj3ThaQVfITxPSLUVV9Qvmq6WfnrW7BL48Mu/QQptCC1kMedxcibo/1bDXVoJEh4ZNTiwIYOBRnM2DBZzh7WSTT0leP+IoVgmIOUu7MJINbhjR4mcB7ICdT1zNzv2fAOjQW/BkEJ91LlK21dbQR82f3ypooAD2+PYrcC8x4B7mFCoKwwL42O1VJOh1FHP9hZs3Crsy0OY00HAJ9qdHxCB0oQJ5WwnssrOACJBrjNe6ispk2TWl708n/mMRwmaW9BZ7zfOUo98CUbZ+dNMFHmXmkLUihH8O7ack5OLd4rBPO7/tO8nXOzlYS9/Q9w3/KT06bNA/4MbYlkxq3DyxTWGE20EJq2Oq1RQQF6rS0+2WIjaE/bpkFOZrKo9uaITcpKWdo8F91m4TtIdeSnyrScpffqumzlmxIqNlStKDaFRk4KBKI78AO4gGAoIU1pmTxPWXeEycmhz2nrZbrw1dy0KaTpPaGT2W+/cXw= 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:(366004)(396003)(346002)(376002)(39840400004)(136003)(33430700001)(33440700001)(2616005)(66946007)(2906002)(956004)(86362001)(66556008)(66476007)(6486002)(4326008)(316002)(6512007)(8676002)(8936002)(16526019)(6506007)(107886003)(6666004)(5660300002)(26005)(1076003)(36756003)(478600001)(186003)(52116002)(109986005)(266003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: QIPB6r92UaT8u3Cvm+ax9vL8pT6/NZW+EF6lW8sQ+5tHEnC+0x/G4jX+LcldNHU/nRKuHxI5kXxC7hx2Bcw/eMIMgYMQXIGG+Nj8Gi3XOaWsZH6dV3M6JCP1VO0eHgs+L3CNRgHcOOY7m6SjfaZwQ65vzni1g3rBg/Z2jhxCaXOVLl3uR5fptVNwwNI5OzgjulYGrq/tq/UKzJetI9lJp4BNOl6CHFF2XpewTnY4WvMrEarTBMUzAKl7p40otnfW5w9jswtgVDemW/Hlr/rKMbP4EcPfRlHEyVq5Vvfr74QXN9be+V6MvvcGqwB2pOy9t2yBtpmW6b++ZAsIeR23pMHgZ/AUxcxac7ZehEj7FncAI6yabtgrCOu16dTtfj2q7j2Kxr5qtNQSyU5/NbK3XrV9kVm4eDyIpygwImDJHKftdHnKRMyU1hVrGGYalOauLI+VKh5JdwVX9p5EXGvD9aZBxhdyOiYgMskHwUhIyrY= X-OriginatorOrg: ekinops.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c83b482-7539-44f9-2365-08d7f71e689a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2020 09:17:07.3335 (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: tlFAB+6xf0HorM584BOZZtfSa46C0pC6vvg5TUsbwOY9Iywpm42lGUHoBp+EnLJT2gB2MqactXsaCWAKJMMEupwvQgWP56PJ6hjYhn9MpOM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MRXP264MB0183 Subject: [dpdk-dev] [PATCH v2 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. 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 | 30 ++++++++++++++++++++++-- lib/librte_ethdev/rte_ethdev_driver.h | 19 +++++++++++++++ lib/librte_ethdev/rte_ethdev_version.map | 1 + 8 files changed, 58 insertions(+), 2 deletions(-) -- 2.17.2