From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50066.outbound.protection.outlook.com [40.107.5.66]) by dpdk.org (Postfix) with ESMTP id 5CD521B19C; Fri, 3 Nov 2017 10:52:31 +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=BJbM0MTGb4wMmuBiMWewkULt9AtHWV6/ISgFT4q7Xco=; b=iXiTi42HF6TlG4+xXzdM3Fiexihf/dqkfCZc7Tk5QDtiNA4VJ5jMVgw+7FduBK7tIRp483qSxhf1Vq6vR6pfx+mHZWribXATHq545Jr61utk44w3TXjIxz/M6atSW/GHrc1sbqZn4XLlFDiZxYuu/vM4eTyVRsYwh+mxpUQhXdo= Received: from DB5PR05MB1254.eurprd05.prod.outlook.com (10.162.157.140) by HE1PR0501MB2764.eurprd05.prod.outlook.com (10.172.125.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Fri, 3 Nov 2017 09:52:29 +0000 Received: from DB5PR05MB1254.eurprd05.prod.outlook.com ([fe80::69a8:7948:e0cb:c16e]) by DB5PR05MB1254.eurprd05.prod.outlook.com ([fe80::69a8:7948:e0cb:c16e%13]) with mapi id 15.20.0178.016; Fri, 3 Nov 2017 09:52:28 +0000 From: Ophir Munk To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= CC: "dev@dpdk.org" , Thomas Monjalon , "Olga Shern" , "stable@dpdk.org" Thread-Topic: [PATCH v1] net/failsafe: fix VLAN stripping configuration Thread-Index: AQHTU+HV4jkkkJGFUEObczpB3LClyKMBIo+AgAFHViA= Date: Fri, 3 Nov 2017 09:52:28 +0000 Message-ID: References: <1509567158-15670-1-git-send-email-ophirmu@mellanox.com> <20171102135216.GK10890@bidouze.vm.6wind.com> <20171102141623.GL10890@bidouze.vm.6wind.com> In-Reply-To: <20171102141623.GL10890@bidouze.vm.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; x-originating-ip: [93.173.17.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0501MB2764; 6:HUJnRzgdOPkhT0FqJRl73zkuf4xCtTsIyWahR5OxbtNhtKeIKa+41ai0Zkdx6mj6fzJJVQeCfzu1/6pnTmQvNH+25d0bNf7kpG5olo3mvverGS2Z+MVhyxTtfZEGXlAwEo+q/59t076mCF9oTsi96PKGqSSqjLiWEA/KuLzR822k8VdYf2qMwO2xbnde9JjObnYlWBi1kKLnBgRZq4Ko7Mkn7xNUxe1ZdPNmnEs0VpmxLtB1Ilf87Cb+0szoY4wHzVSv+f5QG1QHIvzU+F5xvJ4k8w/RXXC9BR1HVa4g20HNQHOMLj9EtqwPdq/D+1GDM0IQQStLqlpCDpcdb0FTnJdc9td90g+NM0vujhkh5ek=; 5:p29sk0V13YxrOrW2rEaRz2Sra2bdOdbCdyqe6nbg3pfJ3K7CR6a1LLjRYuCLloiic6BSIGGYYGWgvkT3bqk9RjrzjHlHAz2batn2VjCb1m14Sej1BNGE6Scmmp/YchsZXbR2gb+9x6A02+6EksnEh9fG6zhiO0ucP0mw9kz8n0A=; 24:fEQjxKC7fzJKam7a4jFWBxLxJmjzaao5nETzMQ5YQKL59PpTt6hoihsoMh5HXpkvpMN8nwuwtH0b4clEeTLsL1F4QmznV0QTQivMzibrDBA=; 7:G5Ks0OlO46TolHmmtt7+Y612HfM1JHQSuQt3dVP2dInwBJ14L0A3fUr8iFw5rMU7eqM1SY7157PAWVYGe2IzaZj+RImMgwWc4Mfm+L5/x8359hDQ51RLX50hmEuamXp6RyKaGlbjkjANm2FZy7ffk63YptoKxu6tWGAOISpQIgyfW0/aG9Ut4PjmJ8BTHKzsuYD5Y1OWlC3k37GRORHSmr8pEGS6DFr9zId6BuWjvFui7VsO85O7xrlQLV3RJcSX x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: b9fe55a2-8c6f-4824-220f-08d522a09851 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:HE1PR0501MB2764; x-ms-traffictypediagnostic: HE1PR0501MB2764: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231021)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0501MB2764; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0501MB2764; x-forefront-prvs: 0480A51D4A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(199003)(24454002)(189002)(13464003)(9686003)(55016002)(54906003)(478600001)(102836003)(316002)(53546010)(53936002)(6116002)(305945005)(3846002)(7736002)(76176999)(86362001)(99286004)(2900100001)(54356999)(50986999)(8936002)(97736004)(14454004)(25786009)(74316002)(33656002)(6246003)(189998001)(4326008)(101416001)(106356001)(68736007)(81156014)(3280700002)(7696004)(6506006)(5250100002)(2906002)(2950100002)(81166006)(8676002)(229853002)(6436002)(6916009)(66066001)(5660300001)(3660700001)(105586002)(168613001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2764; H:DB5PR05MB1254.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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: b9fe55a2-8c6f-4824-220f-08d522a09851 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2017 09:52:28.7108 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2764 Subject: Re: [dpdk-stable] [PATCH v1] net/failsafe: fix VLAN stripping configuration 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: Fri, 03 Nov 2017 09:52:32 -0000 Hi, Please see below > -----Original Message----- > From: Ga=EBtan Rivet [mailto:gaetan.rivet@6wind.com] > Sent: Thursday, November 02, 2017 4:16 PM > To: Ophir Munk > Cc: dev@dpdk.org; Thomas Monjalon ; Olga Shern > ; stable@dpdk.org > Subject: Re: [PATCH v1] net/failsafe: fix VLAN stripping configuration >=20 > On Thu, Nov 02, 2017 at 02:52:16PM +0100, Ga=EBtan Rivet wrote: > > On Wed, Nov 01, 2017 at 08:12:38PM +0000, Ophir Munk wrote: > > > failsafe device has vlan stripping configured at startup however > > > once a sub device is found as non-capable of vlan-stripping failsafe > > > updates it configuration and removes vlan stripping from it. > > > This update occurs only once at startup. Following a later plugin > > > attempt and in case of vlan stripping mismatch between failsafe > > > configuration and device capability - failsafe cannot recover and > > > the device remains constantly in plug out state. > > > > > > The sequence of events leading to this situation is described as > > > follows: > > > 1. Start testpmd with failsafe where mlx4 is a sub device (not > > > capable of vlan stripping). Expected printout: > > > PMD: net_failsafe: Disabling VLAN stripping offload 2. Execute: > > > testpmd> port stop all > > > testpmd> port config all max-pkt-len 2048 port start all > > > 3. Do a plug out (e.g. disable sriov) 4. Do a plug in (e.g. enable > > > sriov) 5. Expected result: failsafe successfully configures and > > > starts its sub devices Actual result: failsafe is continuously > > > failing with these messages: > > > PMD: net_failsafe: VLAN stripping offload requested but not > > > supported by sub_device 0 > > > PMD: net_failsafe: device already configured, cannot fix live > > > configuration > > > PMD: net_failsafe: Unable to synchronize sub device state > > > > > > Root cause analysis: at startup failsafe removes vlan stripping from > > > its configuration. After executing "port config all max-pkt-len 2048" > > > testpmd marks failsafe in need for configuration update. > > > After executing "port start all" testpmd overrides failsafe > > > configuration with its own configuration which includes vlan > > > stripping > > > > > > > Have you tried launching testpmd with the option > > > > "--disable-hw-vlan" > > > > as your mlx4 port does not support it? > > >=20 > On a second thought, I think there is a simple solution: >=20 > The fail-safe should stop trying to be clever with port configuration. > On rte_eth_dev_configure, simply apply the user configuration (without > trying to detect support and disabling flags on the fly). >=20 > If a PMD has an issue, it should warn the user. If it has an issue but do= es not > warn, it is a bug for this PMD. This is the case for MLX4: > either the PMD changes its behavior, or not, as long as users are fine wi= th it. >=20 > So a proper fix would be to remove the checks (fs_port_offload_validate a= nd > fs_port_disable_offload) and depend on the sub-device for proper > configuration vetting. >=20 > Thoughts? Agreed. I have sent v2 based on your suggestion.=20 >=20 > > > During the plugin attempt failsafe refuses to update its > > > configuration by removing vlan stripping since it has already > > > updated its configuration at startup. > > > > > > The fix is to remove the limitation of one time configuration at > > > startup and allow it during plugin attempts. > > > > > > Cc: stable@dpdk.org > > > Fixes: bbc6a53dda44 ("net/failsafe: support Rx offload > > > capabilities") > > > > > > Signed-off-by: Ophir Munk > > > --- > > > The commit message includes bug and fix descriptions > > > --- > > > drivers/net/failsafe/failsafe_ops.c | 10 ---------- > > > 1 file changed, 10 deletions(-) > > > > > > diff --git a/drivers/net/failsafe/failsafe_ops.c > > > b/drivers/net/failsafe/failsafe_ops.c > > > index f460551..953ee65 100644 > > > --- a/drivers/net/failsafe/failsafe_ops.c > > > +++ b/drivers/net/failsafe/failsafe_ops.c > > > @@ -187,16 +187,6 @@ > > > continue; > > > DEBUG("Checking capabilities for sub_device %d", i); > > > while ((capa_flag =3D fs_port_offload_validate(dev, sdev))) { > > > - /* > > > - * Refuse to change configuration if multiple devices > > > - * are present and we already have configured at > least > > > - * some of them. > > > - */ > > > - if (PRIV(dev)->state >=3D DEV_ACTIVE && > > > - PRIV(dev)->subs_tail > 1) { > > > - ERROR("device already configured, cannot > fix live configuration"); > > > - return -1; > > > - } > > > ret =3D fs_port_disable_offload(&dev->data- > >dev_conf, > > > capa_flag); > > > if (ret) { > > > -- > > > 1.8.3.1 > > > > > > > -- > > Ga=EBtan Rivet > > 6WIND >=20 > -- > Ga=EBtan Rivet > 6WIND