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 1A136A053A; Thu, 23 Jan 2020 18:02:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C6382956; Thu, 23 Jan 2020 18:02:09 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B31E73B5; Thu, 23 Jan 2020 18:02:07 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2020 09:02:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,354,1574150400"; d="scan'208";a="220725323" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 23 Jan 2020 09:02:05 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jan 2020 09:02:04 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 23 Jan 2020 09:02:04 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 23 Jan 2020 09:02:04 -0800 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.51) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jan 2020 09:01:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5eq2PqbzOAdrFZmKpT7qEbUQqKgaylYn6MG/Bl2kU2m6ka0qxj+WFqairMpkk66Axsa6ILHL8cD6p1MJeXL0BGJUNwQFwU5eoVZbikqfP1jYBNgiA2LrkGh61ZNRD3gEVDSaKNT7kwh84ymB2Gqh83glWtEFVs6LPvsN5W7LIOM8tGlhhW2/ch4DY16vh2hZqVGcgZ0Vgkj86ZKhtbxF6914mJhd4jaLv58wSBbhIkMIKjGuKBSGkV95l0ZLgV875YKLrJX2bI4uF9gP4ApbyHfhq9vOm7jXnSZeCGEmOumgZszRrC8gcNa320gmNBm/xEW8I4mjskcUABDo2hFtg== 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=E9waI8L3e4tueEPDKMdY2uQ7k9UWE0OXZYss227e86c=; b=EIIpKWyQnouPm8Tz1V+FbzjxXBI4Inz6dSv87mDEwHZsM+rQ+R2qzNsbu0wNhRPmDRLkfVyjCGqISCCRVzKlwCzoRPvPlEoFEv5uTvOCh/GcfoMH482iZVCtqLp2tYGsKh1A5lyyQCDfnadWYVVoC05YqQeTQOKF2d5BemyqbD7zC4X1dLfsZipLgn1hxfmq3wTvoyAQtyuKd1KEIImoZuKX3NaqqA45ySWgtB9NjE06iggn+NLZ8zRdacUkW/G74ZdnPLLfgk5pOfacb/LZyJkiGwtb6WrAH6zB5XBQcxKnIx9OqzTsxDgg7yiuG2aOK7y/s9+RJJ9NsWHii+CSqA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E9waI8L3e4tueEPDKMdY2uQ7k9UWE0OXZYss227e86c=; b=pnPtOYum4HceL0F69YXLsuOjq8r06AI/Q27yiKKIO4M5VxYXrEJPMQzPhsG+Vk8rcv9QeJJUvAflgjcTY1kWoXNjnA+GP+lgFvgn2/lvMurHuAtaSGOuUSxTbrZDoQXKbJ7ZBmM1EJjumehJOc79+mqHDt5OiVg/ajQ9wUsBIn4= Received: from MN2PR11MB3918.namprd11.prod.outlook.com (10.255.180.141) by MN2PR11MB4013.namprd11.prod.outlook.com (20.179.151.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Thu, 23 Jan 2020 17:01:46 +0000 Received: from MN2PR11MB3918.namprd11.prod.outlook.com ([fe80::d91a:c81a:62cd:870b]) by MN2PR11MB3918.namprd11.prod.outlook.com ([fe80::d91a:c81a:62cd:870b%3]) with mapi id 15.20.2644.027; Thu, 23 Jan 2020 17:01:46 +0000 From: "Iremonger, Bernard" To: "Yigit, Ferruh" , "Lu, Wenzhuo" , "Wu, Jingjing" , Matan Azrad CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] app/testpmd: fix hotplug Thread-Index: AQHV0gA1L6BoNlhp6kmQxojul8vTW6f4d7gA Date: Thu, 23 Jan 2020 17:01:46 +0000 Message-ID: References: <20200123151509.3207419-1-ferruh.yigit@intel.com> In-Reply-To: <20200123151509.3207419-1-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDEyMzRhMDEtY2Y2Ny00NTE3LWE1MzItYjNlMjc4NjIxZDkxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieEh4NytsQTg3MDdMVUhDRnJFVURob3U1T0FDbVI0UDFRQWFRdTJYXC9JbTI5bnJ4eDNsd0hmRGRYRG9tTzhXUnkifQ== dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=bernard.iremonger@intel.com; x-originating-ip: [192.198.151.163] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 36e7615e-2d4b-44d5-e3f6-08d7a025ee29 x-ms-traffictypediagnostic: MN2PR11MB4013: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3044; x-forefront-prvs: 029174C036 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(376002)(136003)(39860400002)(396003)(346002)(189003)(199004)(66946007)(64756008)(86362001)(26005)(66556008)(66476007)(8936002)(7696005)(66446008)(6506007)(53546011)(33656002)(52536014)(9686003)(76116006)(55016002)(478600001)(2906002)(5660300002)(186003)(71200400001)(54906003)(110136005)(316002)(4326008)(81166006)(81156014)(8676002); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR11MB4013; H:MN2PR11MB3918.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HkZJFRjH04TbAD3oBaPB92Vez/YsIULVz43aU4xDcX4E+x6DXwLxzSw6jn8pySH6u6f5qpY41yaLA0P4R+EALOjJhcMKC2mgeMm6cUjqGIpUh1NUZ80uEfghgO2uhshOjgeDhwb5O8XwEDFbNR3+3nkdQCcIQpImCs/XUT9qwVj69H9Jocae+qv2xEth1iYXGyhNf4/SK07CDEdxG9deJH4y6LnIzRMOa9UqjBNnuUpDkuvDphGCrhBjEHsnjAwzOF05h6PjR357UwcNqlvXntrJ5KQ/8K4kL+AGpKjjqC7nbbNxBDEuc67UYwBAf62WJdas2Tfw/zD1sSFLD7/f1sMtBUik1aHYMtHgW76W0mBFb4X8qwUZqB3tXnb0AEWZei8LlNRPCHFenohtsaUc9m+TPfHM3PdxBt8PHtxgxXdVKC/s20c1syemo9C+rpdW Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 36e7615e-2d4b-44d5-e3f6-08d7a025ee29 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jan 2020 17:01:46.4372 (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: jd4E70Za+QquHo/DaRHfUDk+EGJP83oXy2Azv/PTANg3Kz0ZMqYpbs31n6BIK6+qax4r/TkrUP6y+z25M6QXdSUp//qJT73Q1EClaZKeyF8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4013 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix hotplug 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 Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Thursday, January 23, 2020 3:15 PM > To: Lu, Wenzhuo ; Wu, Jingjing > ; Iremonger, Bernard > ; Matan Azrad > Cc: dev@dpdk.org; stable@dpdk.org > Subject: [PATCH] app/testpmd: fix hotplug >=20 This is reverting the original patch, which breaks hotplug. I think the commit message should make this clear. This patch is not fixing hotplug, the original patch seems to have revealed= a problem with hotplug. Reverting this patch will not fix the underlying hotplug issue.=20 > The 'port_id_is_invalid()' check in the 'detach_port_device()' is breakin= g the > hotplug support, since at that stage port will be closed and validity che= ck > always fail [1] and removing the device is not really completed. >=20 > But this cause the vfio request interrupt keep triggered continuously and > makes the application unusable, since port is closed but device is not > removed, the remove path keep generating error log: >=20 > EAL: can not get port by device 0000:00:05.0! > EAL: can not get port by device 0000:00:05.0! > EAL: can not get port by device 0000:00:05.0! > EAL: can not get port by device 0000:00:05.0! > EAL: can not get port by device 0000:00:05.0! > EAL: can not get port by device 0000:00:05.0! >=20 > Fixed by removing 'port_id_is_invalid()' check from 'detach_port_device()= ', > anyway it shouldn't be required. Without this check device remove works a= s > expected. >=20 > Only "Invalid port_id=3D0" logs seen a few times, which is because the ac= tual > removal not done synchronously but an alarm set for it, until the alarm f= ired > application may receive many interrupts, expect the first ones cause the > error. > So this patch also removes the logging from checking the invalid port in > 'rmv_port_callback()' to reduce the noise. >=20 > [1] > rmv_port_callback() > stop_port(port_id); > close_port(port_id); > detach_port_device(port_id); >=20 > Fixes: 43d0e304980a ("app/testpmd: fix invalid port detaching") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ferruh Yigit > --- > app/test-pmd/testpmd.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > f9f4cd1d3..3323013bb 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2641,9 +2641,6 @@ detach_port_device(portid_t port_id) >=20 > printf("Removing a device...\n"); >=20 > - if (port_id_is_invalid(port_id, ENABLED_WARN)) > - return; > - > dev =3D rte_eth_devices[port_id].device; > if (dev =3D=3D NULL) { > printf("Device already removed\n"); > @@ -2875,7 +2872,8 @@ rmv_port_callback(void *arg) > int org_no_link_check =3D no_link_check; > portid_t port_id =3D (intptr_t)arg; >=20 > - RTE_ETH_VALID_PORTID_OR_RET(port_id); > + if (!rte_eth_dev_is_valid_port(port_id)) > + return; >=20 > if (!test_done && port_is_forwarding(port_id)) { > need_to_start =3D 1; > -- > 2.24.1 Otherwise=20 Acked-by: Bernard Iremonger