Message ID | 1508447540-11259-1-git-send-email-rasland@mellanox.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 18A511B2E4; Thu, 19 Oct 2017 23:12:37 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50082.outbound.protection.outlook.com [40.107.5.82]) by dpdk.org (Postfix) with ESMTP id 1A6F91B2E2 for <dev@dpdk.org>; Thu, 19 Oct 2017 23:12:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6zz3IBpB5L3l5OuxZimlDNU5OvbDkeHJusWDWg1yjOQ=; b=ZEHcIiWjKva+ueUkHyRHM00gwyqMHfsxyGZlBVNtDiDPDZxKI0u+cQZrmu308dBVO2/XaL9OxPBs656DObuSzP8KbjK1CudVA4y/ZMI72dv8/ti96FZWLqfmXQkbGxCyzTdTkJZJ95PTkFn5QB0GIggirEgaonxa/Ly672tumF0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM2PR05MB1220.eurprd05.prod.outlook.com (2a01:111:e400:8450::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 21:12:32 +0000 From: Raslan Darawsheh <rasland@mellanox.com> To: gaetan.rivet@6wind.com Cc: dev@dpdk.org, thomas@monjalon.net Date: Fri, 20 Oct 2017 00:12:20 +0300 Message-Id: <1508447540-11259-1-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: DB3PR0202CA0011.eurprd02.prod.outlook.com (2603:10a6:8:1::24) To AM2PR05MB1220.eurprd05.prod.outlook.com (2a01:111:e400:8450::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b555085-ea02-4244-fd9b-08d517361d6a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254172)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423095); SRVR:AM2PR05MB1220; X-Microsoft-Exchange-Diagnostics: 1; AM2PR05MB1220; 3:ixmxsUV/rabtqqZrhJVD324pQIJZoorOnXxbAFM2R0z52vBYmkjpgkSu8x+Jy7ngtDeqVzh/FUVIK9ZrLFITgBNEsZmFXcUxbPflcjIcRiECPi99t5bNUI4EQcK0a5C5XuQAOJ1Hg0Xw8yvWqGeGGLekDGvMEa7HdwFG8QtL7Cu4sr5MLQbEAzpT+UcqhMXnXyrqN+QctPcDJ/isx0g2B1xgWKzTy0GGk9nr6liKhDmEnGbwsnnp+pTHEZpPTlI0; 25:ai6WABjVAmUujsbMNPUBiuxGOMmFFr0Eb2beJ2/ow37+u5b3/+4av2Jg0Hl8AxrcX7js80AKCtwe+lEURk/ZDnWwmoV1HTGRSVgLQwCScOQAPsSiilHDwSEWqrweFjNWWjL4X1jRbgmyelqeOdGNVMb2adxX0tfxWBdmqvhaYWTjaqHSduQXuo6zofa16+dzBCVlfcB37+3Gnh70qDDgEueTcKJHF4s3qESSfDI1N8pdbLBgEjSs9bv+nl3rGJYxzqF9Lh2dnmp11F0M9CfmduWK9+n7CO+QL+xbY9CPrVENs+31Myc50oujVjZDy2shOn59sAf5WwHSxM/VnabOxA==; 31:EJE/0CRUq1tBjKQlxViSw/cvuFhkSJd+c8uior5OgIvpemRq/t4LY5AwX20P1AqOSASidPlWdsXLhOFqZygKKpKdNDXb3XF748pAQhWEsVkGr6NO71YFoRxayGMry2cCIVWoBPxz6vgS9QF8RFaNkNiWcoZdn3KqvL42LLBt1KYU5lL63L2GXz0HomqlBSLDYB6yc0uHMqzRj5W9xaKcgVG75BEUW0eoWS7VSPr6VPk= X-MS-TrafficTypeDiagnostic: AM2PR05MB1220: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM2PR05MB1220; 20:8eumc3HMZwG9JdFwIU2k/k+5LY7KUkHj+72xlVVUzG2I9Q/RK/qOgLBQLldsP/yrjFVknxPCHR3s8Dn4uQNEIeLByoJMj0k1/6gZJHggudXr/bOin8xKKojWnhoBbnE/kCS7UYp7FJsM++DzCNPxQtxtgAcMXqH6gA3CK1/6saY+5nEs+0fuHtePVcSdTE8sa2JHlQkWHH9suQZHvWvVJvEUlLVhanU0qR4GAGVnz28Z5jE8+8WpJ2uuBZsQagEgZ33FX7kCT3Ucd0AEd3uC69nYsCcCVumk58PU8GvIumY8urYsBjWlI66CpGV9deDMtmzM+NhA1Iztq6RHkWIPcGj26k1BrQlqMBqjyNWirgjCpRS8/oQwShhizPBNlCi6SZPW4M60VjIXlWIMiU8TIDrPeU423EzPpspYDs227CakjycqKmeMZJ/7gCFY+HHxehljGsyVp+8bs6SBw8jeQ1ua0MlvmCOwf4tS7jKBFdeS/K2x7+918q1onQzPMjHS; 4:4wzy1M69GXoIJrHDMzD+n6mjggzMg45KVaHbt/eZbviy6PfMIy68mBGqmrRpSQEEZI4fzuIa9OdoH0FzN4GXYRF+fdYnfrpS7DWmkjK0XZJaR7jDJl2NAbXfW8P2kUqMRIr5m9azKfZgj6/NnJDRtHJlZpoOCFvpnpu36ZpGtAb8pI3BX+Z9YeBLNikNaBp6+hofDuyVcUUn2/0kJjGgvitnmWqtqtCP6rNVmaes/zdz4NnIXaB+y/OOdw4FoVvM X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: <AM2PR05MB1220CD7C0D8B4728BCC31A4AC2420@AM2PR05MB1220.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM2PR05MB1220; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM2PR05MB1220; X-Forefront-PRVS: 0465429B7F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(189002)(199003)(3846002)(478600001)(81156014)(2906002)(81166006)(8676002)(8936002)(6916009)(36756003)(189998001)(16586007)(6666003)(316002)(5890100001)(25786009)(6116002)(86362001)(50226002)(68736007)(69596002)(97736004)(16526018)(48376002)(53936002)(55016002)(4326008)(21086003)(47776003)(50466002)(66066001)(50986999)(101416001)(5660300001)(5003940100001)(305945005)(7736002)(2361001)(105586002)(2351001)(33026002)(106356001)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR05MB1220; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR05MB1220; 23:h5Glb/rHRhpTOsDQ5fBblYIzn7Bd9j0AY7QA+N/Ec?= ucB4dIlq55Smdrnmc1Fn1A2KDkcZ8GX78oV6YyhpFCeKK3o6p7LqLWkiSnLvxbLZhp6sm+nj/N2qecRxjwo5c9yTMFX1yMmR2ojOOrd/W4OZQJz1n1p3kc9iP5pHgUGBzk4ZTxL+LVCzqDk067+7pBsJRtRVTVFaW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v3zR9841bxGmCk1WF5AtgBpSlsH31OyK5JssMmylNEmzaNiM5ro4u3wjW3c3AA1/6Cbbak6pSU6bx8T6WpRaeS76OJsWyHNNJbN2+FC/LriiiWlhl0W2XMc0NS80e1KCT2iXlrdXI9ui7JgppIpoVrHu+yASwY1ed6G4IsZ+t7BjSEdxz9pXK7c+QCTAPk8poSQ+zEbZ4Momnls+MVsjAGZo1DkHt2N2IunMEL3C0SH+ooNYrbv9Qmi5qkmw==; 5:XY2A+33yEsDVy+xokJQsJRVHWJ6m2PyfSnfc8LFCWC2EsIWUKQr9xr+qGrCN8h/6N6cLJG2/Y5Y7pXqiPKBEpWklomasTJRH9ananQmM0ZGUA2/3FfaW62dcRf6OESUkb8izw6DgZZl594C/Zams8Q==; 24:oCAojAKHO9/K6iN50hobXlZegJ6fqoTf6kJeynHptm14+Rq9qhaVof9HvWnClZCqJssnd7dDoz3Ec2anXBN6K9JgjJ4hmt0feg0oYRJ0Yps=; 7:gdsVQTG43Mt6pAyDRKsLRxEzQBEe2HO4ejQkfB2NFqMd/CURqET+9Ft3O06lzy7y8AjHBe/fY28dKS8dK6gKKEJh9vmPIrOP7tBe/52wbT6U+UIOgIr2m0y2jLyVpOrZ/ctcumiMuyBtMt3Hnkqb4PmgQ2mw5yj8/7MCpnTcIWWOyrLtMt6F8aGdfH8EmRGztmhIcZHteEOId1z7Vlec9ySvCFkE/4NlJfEv8QB54IU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 21:12:32.4985 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR05MB1220 Subject: [dpdk-dev] [PATCH v2] net/failsafe: fix PCI devices init X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | warning | coding style issues |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Raslan Darawsheh
Oct. 19, 2017, 9:12 p.m. UTC
When trying to attach a port as a sub-device, the ethdev port was compared with devargs. In the case of a PCI device, the name in devargs is the PCI address. And since DPDK 17.08, the devargs name of the underlying device was used to match an ethdev port: a1e7c17555e8 ("ethdev: use device name from device structure") But the recent commit 72e3efb149cc has reverted this wrong matching to use the ethdev port name as identifier of the port. It impacts functions like rte_eth_dev_allocated() used in failsafe for matching ports with given devargs. The fix is to search for matching devargs in underlying device of all ethdev ports. If many ports match the same PCI device, only the first one is matched. This limitation was already present in previous implementation of rte_eth_dev_allocated(), and must be adressed later with a better devargs syntax. Fixes: 72e3efb149cc ("ethdev: revert use port name from device structure") Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> --- drivers/net/failsafe/failsafe_eal.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c index aeb87a0..734b25c 100644 --- a/drivers/net/failsafe/failsafe_eal.c +++ b/drivers/net/failsafe/failsafe_eal.c @@ -41,6 +41,7 @@ fs_bus_init(struct rte_eth_dev *dev) struct sub_device *sdev; struct rte_devargs *da; uint8_t i; + uint16_t j; int ret; FOREACH_SUBDEV(sdev, i, dev) { @@ -57,7 +58,13 @@ fs_bus_init(struct rte_eth_dev *dev) rte_errno ? ")" : ""); continue; } - ETH(sdev) = rte_eth_dev_allocated(da->name); + RTE_ETH_FOREACH_DEV(j) { + if (!strcmp(rte_eth_devices[j].device->name, + da->name)) { + ETH(sdev) = &rte_eth_devices[j]; + break; + } + } if (ETH(sdev) == NULL) { ERROR("sub_device %d init went wrong", i); return -ENODEV;