From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22444A00C4; Mon, 18 Apr 2022 15:20:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1F944014F; Mon, 18 Apr 2022 15:20:17 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 6CA0740141 for ; Mon, 18 Apr 2022 15:20:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650288015; x=1681824015; h=from:to:subject:date:message-id:mime-version; bh=PypL1cA5m2mXGnRvu0bJbvOa6wUsWL5ApKsCNv5HOLU=; b=Mt7udj4Lu5EQxVZY3KoBpqM+WxEbHZ64EmNOYniF1XxB8eCtD8FrwlSh Y6IEuxsXYhCJN74WDTH8bwLm/AHVSgaUY56jQLXNoTniuOtqIYR9aQua3 LmkHPrD7N9Cc5J4Ydz3A3Opy+BG5GJmLl1CFJoHf0/nvFowxpEEs9AD4b 2EtpSEpIxwoxNddlyxPSAfJ52LfVotIVjT6vnXNonSZGSS02/z5KzuoQ9 398V7JKeAc6DTj52nbetss6fl/phAHhDDn9qGzTfZgH8hWXxCv5Wa/U3H USFjGZdZQGvBTBm/Hr1PdOcbcIe3wG0W49TT2asW29jfOV/6TbpMKtx3z w==; X-IronPort-AV: E=McAfee;i="6400,9594,10320"; a="243447485" X-IronPort-AV: E=Sophos;i="5.90,269,1643702400"; d="scan'208,217";a="243447485" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 06:20:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,269,1643702400"; d="scan'208,217";a="528861194" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 18 Apr 2022 06:20:13 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 18 Apr 2022 06:20:13 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 18 Apr 2022 06:20:13 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 18 Apr 2022 06:20:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RxWE9mN+tWr8DKrWg8mlDT+/BnRFwx5vgE0BjZpubf6+E68lfQ4Kw7QrXsTEkth9ovMRpneqdx0PIsr6iR9CRX86d6WqR3xyPnyV42/cjKCGZiEBdNhfRABQnfQ2JbNCcqHHLyq0Ai1GHVr3Urx0AEHKi4JXMl9J0rSrmPqt+1dMmgMEB25lPfg5vllq8vyKWcyJL1LwQRo+GbR4zZ54uguck/IUTjNQZwc96aT8oAEpqxxsO0QPTmWxVAUM7OlQd9cxXEjAY+biUoV2roNsoszcNGW09t0iaylTsXofU/P3Ud7/hLBF2V8rbY3aeScvgkeG8Vmz1YxkgNXX3fFq0Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HPh/+uvO2xeAMLcNZ/H5We1YZt56+fbn2D6KeNLeRhU=; b=jpZS++bbE9EgaBQk6MkcyqzDRcoMwueJ1QJpQQ+a2H5cltbcZN8UMPIgsQ02cMu462kHI8l1SZEEx7oh6qGM5pL17lYIdEsnkn0a+irTpvipEJkBHk+GE35nxxR1Q50aZzaT3kYoNpPkAQ6lqqs3Ue6h0oQHDqT/+EtdyS1zCCBFo+dpl/xjyf3w03mUbmh1uSRZvMr2gDCBcCce+LsDHqdc3cZOFPUzlFUXqYX18F01FpyxuJKpHQKZDRbdFptLcjomU1okswg3VWYI906nf1LLSD5x/pYkmFL+c2PVMP/frzTgPZmlh1Uwzj21k1uFYB7P7pzxnpin41Q01GD6tQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN6PR11MB3103.namprd11.prod.outlook.com (2603:10b6:805:d7::13) by SJ0PR11MB4957.namprd11.prod.outlook.com (2603:10b6:a03:2df::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Mon, 18 Apr 2022 13:20:10 +0000 Received: from SN6PR11MB3103.namprd11.prod.outlook.com ([fe80::2822:b6e1:853c:b356]) by SN6PR11MB3103.namprd11.prod.outlook.com ([fe80::2822:b6e1:853c:b356%5]) with mapi id 15.20.5164.025; Mon, 18 Apr 2022 13:20:10 +0000 From: "McDaniel, Timothy" To: "dev@dpdk.org" Subject: rte_bus_probe() does not exit on error Thread-Topic: rte_bus_probe() does not exit on error Thread-Index: AdhTJwaIqywThhzhQHa0BJjJxNiECA== Date: Mon, 18 Apr 2022 13:20:10 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 108bb527-255a-4134-e86e-08da213e2a38 x-ms-traffictypediagnostic: SJ0PR11MB4957:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: v3kdEieNe6cR5WLab1WcHvDgGgO29uopDOh8EGWB0cLqfMhxhF9Scg5MZUJQBmFyOtxcVpi5EbKKZ3n4AARsZGgAhvZyBkrfhAx4a2gSAyxH/O3T9HY4mEg+xd2jLLMotP2dBquPY7U3pyF4fxCLgK937+IQGk+y5D0G7cxgT6nP0aRvNmAHx37tK/8n8uryFSVfFF9AzYhN4aLczxW4vdyjitEzH9k+2fejoB/W/pCJ0Pf06n1lJ3Mxu4IWi4UCwP4c1N1TqjKXaAIvgsMKFpMXaCBGdxSHwO4DGeflws7Hb1BBax3AlSr5/hvJA4auiFlamgANmrofhpyZoVU3RY9Q4fpQlcWV8yq3oLvSgwd5Qyy0yF0xxhYD9vlSP1ccEfsrhXPOlvmY4fVTsZ79NtnQgCheGOeBixp9VXdPN/R6rRcfd07GvCz0nzYvOIsefKPJ2cNE/MKfIIF+U+ZR3nhDrxvfvmc2zXA6+uKbZ1W553RGWSlf1bWVdWZNBSV/ZKBVD3ddaFOC6EkBx0/FgjgCRbyQ/gsNY4QIjrPEjQGsdSKpjySZ26n9r54WKizAZXSoW5TqqUpNZwEf/lFIPGpL/JneGrDUxf95DrV+YzXDxYhzDccKa71UvMDh4cAqS9tZDi7i+XrIIPYHc9nafX8UodSaGsXIOWAg3X5SiNf4dsKOsi8/L2gHatrKy59rSrgLzFr3b9y+podZrv6c6w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3103.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(83380400001)(186003)(33656002)(86362001)(6916009)(316002)(38100700002)(122000001)(82960400001)(66476007)(66946007)(66556008)(64756008)(76116006)(66446008)(26005)(8676002)(2906002)(8936002)(5660300002)(52536014)(9686003)(7696005)(6506007)(55016003)(508600001)(71200400001)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+3PtiGB724UibUpv1GOQJ2lCgql/6JY/3D40/dj/nX33Pu+QLNliqz6uTGay?= =?us-ascii?Q?dPDf7KSJtGqyZR4t1qiACHib1pSJ8NflvC4eg3dX2jzYhEbLuZ65j8JWG+8M?= =?us-ascii?Q?XUzWFa2oAGUag0AZsWFEKj0bkBSZZjHEUX/Md6dGwhvUNFJlK88AyGOUSbMV?= =?us-ascii?Q?XUmFmX9vBsK81xq+z/I3STOXWEwwH/gbveXkmUx9gihIqj8L6LC0PnjNrUmt?= =?us-ascii?Q?Wfxy3OWWZ0GSSZyBuxiU+vCR4w9QRBkYHpEldzP1Bdn4lHiKhcQO7sxlpyZ/?= =?us-ascii?Q?OLTlVwSjLvgIwOAMoVLqLS3TslRf3hm0vgTeA72sq93lbx8+MqTKX+30mfN7?= =?us-ascii?Q?uq/t7H2Q2dAXWs4BoG2o1a7qIQoHLxbk7BqyFTcINekZVj+hGFuuH+dtxMIt?= =?us-ascii?Q?OhpNpP8p4Q2h/l1lMBoebdSA7zgGQcb3cWPtvY2nn5cQKXSNwylaujB5+gNE?= =?us-ascii?Q?E6im/cJfkYlE9Kt467Wsqve+3UBLs5iNpQpcr1XGnSC+EfJrMvFxkSmKCMGX?= =?us-ascii?Q?9ZrWTDDAWqIgwsUrWyN4gHZkKWZWcX24dDFwJA8N+lOYE9vhxYs3J4Pmzjay?= =?us-ascii?Q?7V1GpL27Q/QYoghgKnu8xhfLLViaynXtQPyCt9arpjTvBYgHeiHs2tcshcRW?= =?us-ascii?Q?urbyM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VzE00C+3+J/Ohs6TKdge6WAzj?= =?us-ascii?Q?H0qMtV/00gGdCzbbPfa5aBCV/TKoPX7RjLE2iOVFT/UxI3pKz1OK1vkMnGN1?= =?us-ascii?Q?ZUfxgdbm4R7ExM6k7F2VXyA1XGHQmAibKQ7laMz9b1gh3LllUgRmCPf382qg?= =?us-ascii?Q?oYau7zZG73QXN9Nh2kPxz2rlrtXH/to+Vj0iAy3XiCXNgatuglKGDEsXrlFN?= =?us-ascii?Q?oiI4zwOaJNaupfo6umtx0cdvAwQDyRo=3D?= Content-Type: multipart/alternative; boundary="_000_SN6PR11MB3103A5A4CE6D4C5846FDAB999EF39SN6PR11MB3103namp_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3103.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 108bb527-255a-4134-e86e-08da213e2a38 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2022 13:20:10.5626 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AO7uuPPMwGWZZL5vuNm/OP0YeNs2Dw2swg8T0sjogwhi+kcwLTKX9UbD0XkxZK4IHZ0a1e0pIWQyyY6XwBJu9d/wg96EULA+p2soHlipGZA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4957 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_SN6PR11MB3103A5A4CE6D4C5846FDAB999EF39SN6PR11MB3103namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello DPDK community, We are looking into an issue where we pass an invalid command line argument= to a vdev, and we print out an error message but don't exit. This is an i= ssue with all of the command line options that we handle in dlb2_parse_para= ms(). In a nutshell, it looks like when we encounter an error in parsing, = the error code is propagated to event_dlb2_vdev_probe() (event_dlb2_pci_pro= be() for PF), which is called by EAL during device probe in rte_bus_probe()= . The problem is that rte_bus_probe() calls the .probe function for each d= evice but doesn't exit on error: if (vbus) { ret =3D vbus->probe(); if (ret) RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", vbus-= >name); } return 0; We want to exit if the command line arguments can't be parsed, so we have a= couple of options: 1. In the DLB PMD, if we get an error while parsing parameters, exit rig= ht away. 2. Change the behavior of rte_bus_probe() so that it propagates the erro= r, which causes the program to exit due to EAL error. if (vbus) { ret =3D vbus->probe(); if (ret) { RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", vbus-= >name); return ret; } } return 0; Any preference, or other ideas? Option 1 is simple and contained in our co= de, but does call rte_exit() from library code. I'm not sure if that's rea= lly an issue because we do want to exit if the DLB-specific options are mal= formed. Option 2 is simple and seems like a better option, but requires ch= anges outside of DLB, so may be more difficult to upstream? (There may be = reasons why the error is ignored for some devices). Let me know what you t= hink. Thanks you for your comments, Tim McDaniel --_000_SN6PR11MB3103A5A4CE6D4C5846FDAB999EF39SN6PR11MB3103namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello DPDK community,

 

We are looking into an issue where we pass an invali= d command line argument to a vdev, and we print out an error message but do= n’t exit.  This is an issue with all of the command line options= that we handle in dlb2_parse_params().  In a nutshell, it looks like when we encounter an error in parsing, the error c= ode is propagated to event_dlb2_vdev_probe() (event_dlb2_pci_probe() for PF= ), which is called by EAL during device probe in rte_bus_probe().  The= problem is that rte_bus_probe() calls the .probe function for each device but doesn’t exit on error:<= /o:p>

 

if (vbus) {

        &nbs= p;       ret =3D vbus->probe();=

        &nbs= p;       if (ret)

        &nbs= p;            &= nbsp;  RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", vbus-&g= t;name);

}

return 0;

 

We want to exit if the command line arguments can= 217;t be parsed, so we have a couple of options:

 

  1. In the DLB PMD, if we get an error while parsing parameters, exit rig= ht away.
  2. Change the behavior of rte_bus_probe() so tha= t it propagates the error, which causes the program to exit due to EAL erro= r.

 

if (vbus) {

        &nbs= p;       ret =3D vbus->probe();=

        &nbs= p;       if (ret) {

        &nbs= p;            &= nbsp;  RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", vbus-&g= t;name);

        &nbs= p;            &= nbsp;  return ret;

        &nbs= p;       }

}

return 0;

 

Any preference, or other ideas?  Option 1 is si= mple and contained in our code, but does call rte_exit() from library code.=   I’m not sure if that’s really an issue because we do wan= t to exit if the DLB-specific options are malformed.  Option 2 is simple and seems like a better option, but requires changes outside o= f DLB, so may be more difficult to upstream?  (There may be reasons wh= y the error is ignored for some devices).  Let me know what you think.=

 

Thanks you for your comments,

Tim McDaniel

--_000_SN6PR11MB3103A5A4CE6D4C5846FDAB999EF39SN6PR11MB3103namp_--