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 24DACA034F; Wed, 6 May 2020 12:40:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 085C71D710; Wed, 6 May 2020 12:40:18 +0200 (CEST) Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120092.outbound.protection.outlook.com [40.107.12.92]) by dpdk.org (Postfix) with ESMTP id A356F1D580 for ; Tue, 5 May 2020 13:19:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mspJWjNnbcYCDdOxn/ffYMJsm8QyD9L9kEVPFLPG8LlKATZH5hgs40CzX2+njQ5uZb/GXCP+kHJcsASPFJfR8SbLDNrQlXTzK4y8OtAgJfvHKNKCWYO+kqH1mxNJ6T49ENKj/oPy9ki1ivmPCg91oR9MRAMN0eZMGI6gUdoWlXXkRIjnYmDLujRzwgzKhpAcdwcl4OBKh1IfzOf0ZKtwx6A+Cgo+tEWz9kGrbZtLwpM7mQ+ZEOCNmurmrPTkyRpbfLj1LVayAPvDWX7G4eFvDzrCnmgUcJpgqgCy5QRQs0cQZZGp6lmebjWyZe9A6nROiOACZSEJV3wtQkfw61AJSw== 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=9yx7LMlwbh29u5pGi844SqJdbiYNbuL6TbxIbJfK7bA=; b=BACk3b8HCIh/N0OBlkgaFaGuwC3eDmlvs5VaD6te6+mQmXT+9XaL2mvGrkqs1n6aas3k1qZ0IEuZvZNE6WjK0U4AGc5LD60IHIIiGaDEZAX3BEs9dh/XRzkZ1VFLCrr8Jtnb5Spu0LdEqZYMydg5qF4BtOYpcxx4CphohTGWG/V9P86D/uRe5MZbT6pRoUoNVL5Hi1J+JeghQEYcSRXO7v8OduTtTdwtuOlvDhZJLL6fEcFsEFr3E6MXit1NSDhRuwURprdE1dv//hC0f60D02t1K0T1g7m0aynbYs1MSJQxqk1elKkeC+8sMByPT6knZ8u9Cn/DQZXL5t3WxiEMxQ== 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=9yx7LMlwbh29u5pGi844SqJdbiYNbuL6TbxIbJfK7bA=; b=uqiapQqXcy3XgYUjiyEXkvixPmU9yde3GWjW/aPuEZZHtMaTMyveZr+a+r6uQ6P5edvh6tS7mYzEr6tDRS1hrGz1TGWcrqMeGxrBtvL6jDpU3fCFDJDsx1hVrBEDh6VJteOaKCW24BmnxxApmY25NR6LmhWXZuv5P69XKdIqcEk= Received: from MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM (52.134.49.19) by MRXP264MB0422.FRAP264.PROD.OUTLOOK.COM (52.134.44.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Tue, 5 May 2020 11:19:31 +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.2958.030; Tue, 5 May 2020 11:19:30 +0000 From: Renata Saiakhova To: Thomas Monjalon CC: "dev@dpdk.org" , "ferruh.yigit@intel.com" , "arybchenko@solarflare.com" Thread-Topic: [dpdk-dev] [PATCH 0/2] Memory corruption due to HW rings allocation Thread-Index: AQHWIWekPWb4eiP2qkCvpdxbvCe0jqiZVkAAgAABEYY= Date: Tue, 5 May 2020 11:19:30 +0000 Message-ID: References: <20200503162636.5233-1-Renata.Saiakhova@ekinops.com>, <2456587.k3LOHGUjKi@thomas> In-Reply-To: <2456587.k3LOHGUjKi@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=ekinops.com; x-originating-ip: [2a02:a03f:8b18:1c00:1508:b5de:e9ba:7c4e] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 648a4327-3850-480d-e224-08d7f0e62e85 x-ms-traffictypediagnostic: MRXP264MB0422: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0394259C80 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yk60EW20yUEFc/5e6fQfn1ooN+Yi4NCWmQJVJl/8f4xSjS8A6mHSbtE0kRx5WEoqUsg35vL8wgCSfiUsQe9TABeqqyIhl4xEKwDVy1eZ1qA+mbnpVnZnRBBfERdtHJxNRLgqSC/54GroUue8JaEXko4dv/cyX/3HRLwB0JdWNFMjlE2+i4cIUjHBNCWpOBk3Px5qsTW+GiZe0IIYSa/IN9U5xQevJMRzQ/9wANWwRggyuLXKBgAByjjKNFjlZSeAe/3WOh1xE3fc13WBtDKIQh7dh0HkZYemYqMzzf21GMHIg8P6qsHaon+7xFtJ4MgJ/s520pqZp3BqmrOEn48nbfIm33oA3/ysTOGPeklsR1M/PV4tA44pwUKXRNtERW4y+Cayw2W+eSwS+h37USYivgUmmfSsfyFgVuao2KjTNiEv9WuRPuVAp7YRf1NGB4nLpWcI8aMc/7btTz0uncX6njQa/gPrrOB+Fkk6XKKsKoi0aX8X4/TQAUtT8Sg6y2reGc6/HLacwFWaEguR2TTDNQ== 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)(39850400004)(346002)(376002)(136003)(33430700001)(71200400001)(44832011)(6916009)(54906003)(53546011)(6506007)(7696005)(186003)(86362001)(2906002)(478600001)(8676002)(8936002)(76116006)(33656002)(66476007)(4326008)(316002)(55016002)(9686003)(19627405001)(64756008)(66446008)(66946007)(33440700001)(66556008)(5660300002)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: zYR9dzYpVRWVCB9Fs5OJ8VW9MIe/W4EDjHYJeDDOGprH3DKuYWmfIhKB+bZWMQ9ncBNhEWPrA3vZ6h0sHqbfY2nSKwR83qShuaGEJEV4a6BIGlTgKRhTIuwLUdSVcixO7axVYjZfYuLQuF0lBVbCPRVjD6DHj8Zm4QY3BkW75JOqRf3En8wUOemj89F6WlDjbUeJXyhXPHqDXjEdI8u+Gk05E0iE2jIEA6GKgc8LcetDCsmnpo1PKKrJXHksOTInJTrjOwmuzJ7D6e+/kNk9BxVlag8d5kFGLQz/VqJm5xwOFboRix4xDdLYzULS6xjN1esyFsYTZ5eoHBOVkl82jY8y6BtrRcPq8R6jOxum5UnRdQkmUwIP9Zci7ImLCBLySXrtn4HD7ccuZhoN9Jk4swr4GVh1Ltkzv1H4j9quLXGEKkxmS0Ze/ihmK/PAZldSQ2xjc/Uu2TYp1Bg9ig67TP/zWWBnLiwpQK5XHuI4UU4FYjvM7/UCZEG69X6vln+W4hBvlVkFk8ydjSOFgu6GVU5KPzyjsCKh4mFQydNPJ3Qh+Eb2lD2BZ+JpDKXWPQoc2D6N0nAWpt17r3jYRxIQAlxwoJjLoIZ3Xf6SG4Xt0Dr6kxKbStzERpSXgmEhDzZRPadYf0pLE9F11PbsXPAlFS0V+QqZoNP7Pgd+oo/lgQZTTxE+ymjKioUMMGMsvCuazTpSY+8IclcR7K2CPxlnXCGGV5oQ34U51gxHIcmG7QNZw+zGHVoWCX/Y7XSFt8qKSVhfTUwA+9PVooiINK3q4iQJa6ef6svENi9NpfssPr94r47Dv8PUYp+qID67e7mFlx7QZVT3HGVg69lkJECXyXHcwSJqhKOI91z9YISVPSM1Ngr88wJNuH7KgU5ZLPGi x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: ekinops.com X-MS-Exchange-CrossTenant-Network-Message-Id: 648a4327-3850-480d-e224-08d7f0e62e85 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2020 11:19:30.9355 (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: IK1Sup0VuwMjF1nO8adI+TyiNpg+mwrI3Q+KXVzCfcmwJP/Whd4ogvVriml1Frymt33mxgDe5sJ9Dzmdg4NHk1eDxSxuKySB6TARxoesI/A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MRXP264MB0422 X-Mailman-Approved-At: Wed, 06 May 2020 12:40:16 +0200 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 0/2] 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" Hi Thomas, In our application dpdk port can be connected and disconnected: Connect: new_port_id =3D netdev_dpdk_get_port_by_devargs(dpdk_port->pci_addr_str); if (!rte_eth_dev_is_valid_port(new_port_id)) { /* Device not found in DPDK, attempt to attach it */ if (rte_dev_probe(dpdk_port->pci_addr_str)) { new_port_id =3D DPDK_ETH_PORT_ID_INVALID; } else { new_port_id =3D netdev_dpdk_get_port_by_devargs(dpdk_port->pci_add= r_str); if (rte_eth_dev_is_valid_port(new_port_id)) { LO_TRACE("Device '%s' attached to DPDK", dpdk_port->pci_addr_st= r); } else { /* Attach unsuccessful */ new_port_id =3D DPDK_ETH_PORT_ID_INVALID; } } } Disconnect: dp_ConfigureRxQueues(dpdk_port, FALSE); rte_eth_dev_set_link_down(port_id); rte_eth_dev_stop(port_id); rte_eth_dev_close(port_id); and yes, exactly, port id is recycled by eth_dev. Next time, switching from= igb port to ixgbe with the same port and using HW rings of bigger size for= ixgbe creates memory corruption. Kind regards, Renata ________________________________ From: Thomas Monjalon Sent: Tuesday, May 5, 2020 1:01 PM To: Renata Saiakhova Cc: dev@dpdk.org ; ferruh.yigit@intel.com ; arybchenko@solarflare.com Subject: Re: [dpdk-dev] [PATCH 0/2] Memory corruption due to HW rings alloc= ation 03/05/2020 18:26, Renata Saiakhova: > igb and ixgbe 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 socke= t_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 i= t > to another type of interface (ixgbe) for the same port id, potentially cr= eates > memory overlap and corruption, because it may require memzone of bigger s= ize. > That's what is happening from switching from igb to ixgbe having the same= port > id. I don't understand the use case. Do you mean you close one port and open another one, so the port id is recycled by ethdev? Please could you elaborate with some code snippet?