From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0059.outbound.protection.outlook.com [104.47.1.59]) by dpdk.org (Postfix) with ESMTP id 6F7E414E8; Wed, 13 Dec 2017 16:48:48 +0100 (CET) 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=mH/hSO2c61G6DZsmrki/BeGtuCpHZni3OotkHFRvCsI=; b=kPioWQk0uRlZHGQwBHt1qsOHkiP0OZ1eHOCezu3psWqPkfSxSCI0DxSe1G0DboTOC2dR1QWXqZ41OFloN+26Q3ZfBMSpYfka8SW40rw9Gau/xGq+wEcG4U0/FIJbNWB7XigVZiwBCd1yw3K+rTab17h9KrCYqKc2gBY1wszxuzU= Received: from HE1PR0502MB3659.eurprd05.prod.outlook.com (10.167.127.17) by HE1PR0502MB3659.eurprd05.prod.outlook.com (10.167.127.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Wed, 13 Dec 2017 15:48:46 +0000 Received: from HE1PR0502MB3659.eurprd05.prod.outlook.com ([fe80::982e:2dce:9449:6891]) by HE1PR0502MB3659.eurprd05.prod.outlook.com ([fe80::982e:2dce:9449:6891%13]) with mapi id 15.20.0282.012; Wed, 13 Dec 2017 15:48:46 +0000 From: Matan Azrad To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= CC: Adrien Mazarguil , Thomas Monjalon , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2 4/4] net/failsafe: fix removed device handling Thread-Index: AQHTdCVqeFZYAzJ0Kk2VOrfpqCAdSKNBZw+w Date: Wed, 13 Dec 2017 15:48:46 +0000 Message-ID: References: <1509637324-13525-1-git-send-email-matan@mellanox.com> <1513175370-16583-1-git-send-email-matan@mellanox.com> <1513175370-16583-5-git-send-email-matan@mellanox.com> <20171213151641.g42zr7zupbsdgxsv@bidouze.vm.6wind.com> In-Reply-To: <20171213151641.g42zr7zupbsdgxsv@bidouze.vm.6wind.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0502MB3659; 6:WxWR3+DofNsTTqy/aIXm2aFB+Klh9JZc5bTqrJiEKXVLyjIn8JIKYmHejI0aQsut1x+MbaXKbYCCg6UEdpQW3c1mAslV85fJL/DGJv5g67fofTEh/gP3mvLIXPYjdm4qPCDAKGefxf+XO4es37ksMph7djZLHkPGKLEOb91SqLILmn2VFQ27SeUQb7F1mPxamTGYeXpyraUKBZcqRpSDZyu51hks3G5IQArDd7Aynl3eAQKeQgxwU+rNhzBKtJA+gJ28rP20ZVKFeQFemgdioiRRlSanE+iRssRpOXQsxzILcaeBGM4rQuDGrEIOIijdKN/Gz4gm8brgt8XA+Ql1Zlfzrgrfv85UIeZrICNaNxU=; 5:bH98G16hJTWybmERatA9kKJe9ErU0kNVD6u8580pJ9VAgmFuoor5aEban2N5F2S4SD/O5+0WMH+TCJPgO8TCQlbhuOeA5FEWeGLwlLzTnjABKLcl6SvE8IIL45IOv1wrn/0hc8DpwavyfmI3AOuU5Tp++ndC3oS5fNGADtDEEOk=; 24:EmQc3bGMc2ZddgZmWTCb2GEPvrpPsg8Wrr0WvQmoQZDJmyI/OIpz7oZxXJhis4o5Qx1VlIkFMCnydBpzRnR4JdhABjsJQ0ERffx2RF2rG5o=; 7:nf4Xy7Mli8RfV8Wnmyje4i7ly317Q6odllA5iPW1RHIqSWf1enalS+2sOJHAIhLOt/OjtIepc9O50PgCDlwzAajVFEpdiv6Tlaj8qgB6aFp8nHQDFMs/M2+zS2s8pTMvzxyvfm4J4A/8O2jYgwvmHgRsu3xVHG3rRrOoKSnPKPQBs8k1ThtLD41AbB4zLsoylCviSxpj4rMGQqhlPeTEJlrMtjukeK73x4XjakcbytrdUtnLjnuIWzEnmv/Lvhe7 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9cac99b3-e4d4-415a-deea-08d54240ff2a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:HE1PR0502MB3659; x-ms-traffictypediagnostic: HE1PR0502MB3659: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231023)(10201501046)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123558100)(20161123560025)(6072148)(201708071742011); SRVR:HE1PR0502MB3659; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0502MB3659; x-forefront-prvs: 052017CAF1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(346002)(376002)(13464003)(76104003)(24454002)(51914003)(189003)(199004)(2906002)(66066001)(478600001)(6916009)(55016002)(8676002)(76176011)(54906003)(2950100002)(6116002)(4326008)(3846002)(6246003)(229853002)(81166006)(5250100002)(53546011)(97736004)(14454004)(33656002)(81156014)(86362001)(6436002)(102836003)(9686003)(2900100001)(99286004)(7736002)(8936002)(3280700002)(106356001)(105586002)(3660700001)(93886005)(74316002)(7696005)(68736007)(5660300001)(25786009)(53936002)(316002)(305945005)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3659; H:HE1PR0502MB3659.eurprd05.prod.outlook.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) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cac99b3-e4d4-415a-deea-08d54240ff2a X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2017 15:48:46.6164 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3659 Subject: Re: [dpdk-stable] [PATCH v2 4/4] net/failsafe: fix removed device handling X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 15:48:48 -0000 Hi Gaetan Thanks for the review. Some comments.. > -----Original Message----- > From: Ga=EBtan Rivet [mailto:gaetan.rivet@6wind.com] > Sent: Wednesday, December 13, 2017 5:17 PM > To: Matan Azrad > Cc: Adrien Mazarguil ; Thomas Monjalon > ; dev@dpdk.org; stable@dpdk.org > Subject: Re: [PATCH v2 4/4] net/failsafe: fix removed device handling >=20 > Hi Matan, >=20 > On Wed, Dec 13, 2017 at 02:29:30PM +0000, Matan Azrad wrote: > > There is time between the physical removal of the device until > > sub-device PMDs get a RMV interrupt. At this time DPDK PMDs and > > applications still don't know about the removal and may call > > sub-device control operation which should return an error. > > > > In previous code this error is reported to the application contrary to > > fail-safe principle that the app should not be aware of device removal. > > > > Add an removal check in each relevant control command error flow and > > prevent an error report to application when the sub-device is removed. > > > > Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD") > > Fixes: b737a1e ("net/failsafe: support flow API") > > Cc: stable@dpdk.org > > >=20 > This patch is not a fix. > It relies on an eth_dev API evolution. Without this evolution, this patch= is > meaningless and would break compilation if backported in stable branch. >=20 It is a fix because the bug is finally solved by this patch. I agree that it cannot be backported itself, but maybe all the series shoul= d be backported. Other idea: Add new patch which documents the bug and backport it. Remove it in this patch and remove cc stable from it. What do you think? > Please remove those tags. >=20 > > Signed-off-by: Matan Azrad > > --- > > drivers/net/failsafe/failsafe_flow.c | 18 ++++++++++------- > > drivers/net/failsafe/failsafe_ops.c | 34 ++++++++++++++++++++++---= -- > ------ > > drivers/net/failsafe/failsafe_private.h | 10 ++++++++++ > > 3 files changed, 44 insertions(+), 18 deletions(-) >=20 > < ... > >=20 > > +/* > > + * Check if sub device was removed. > > + */ > > +static inline int > > +fs_is_removed(struct sub_device *sdev) { > > + if (sdev->remove =3D=3D 1 || rte_eth_dev_is_removed(PORT_ID(sdev)) > !=3D 0) > > + return 1; > > + return 0; > > +} >=20 > Have you considered adding this check within the subdev iterator itself? > I think it would prevent you from having to add it to each return value > checks. >=20 > It is still MT-unsafe anyway. > This fix doesn't come to solve the MT issue, It comes to solve the error re= port to application because of removal. Adding the check in subdev iterator doesn't make sense for this issue. Matan.=20 > -- > Ga=EBtan Rivet > 6WIND