From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0045.outbound.protection.outlook.com [104.47.1.45]) by dpdk.org (Postfix) with ESMTP id 5C8D11B607; Thu, 2 Nov 2017 18:27:45 +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=GavIEi2VAPhLHukH1gBxheJYScqEaqTlXtDUKgSBLpM=; b=BHdp+d2HZfCJbyLhXD8R5UQu7z5JpwwFu3k1DHswTvpRUtsW9HuVJOa/isoj3UqPh25wRNhC+10/5dn8QCuBjUx9e278tIYC2ktHX1ZAkw0p2KUdSTqfhrDz9Wrgfy4QFYduQ9SfqSymi1swa604dy54+kLDUKd6AUU7n0Pf4T8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM3PR05MB1249.eurprd05.prod.outlook.com (2a01:111:e400:586e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Thu, 2 Nov 2017 17:27:37 +0000 From: Ophir Munk To: , Gaetan Rivet Cc: dev@dpdk.org, Thomas Monjalon , Olga Shern , stable@dpdk.org Date: Thu, 2 Nov 2017 17:27:03 +0000 Message-Id: <1509643623-10488-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1509567158-15670-1-git-send-email-ophirmu@mellanox.com> References: <1509567158-15670-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0801CA0089.eurprd08.prod.outlook.com (2603:10a6:800:7d::33) To AM3PR05MB1249.eurprd05.prod.outlook.com (2a01:111:e400:586e::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1cb7862-cacd-4544-c336-08d522170541 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:AM3PR05MB1249; X-Microsoft-Exchange-Diagnostics: 1; AM3PR05MB1249; 3:MSUlBRYaHQHsHiy4pYAmjcX6/sHqebn39ktl/MWO6DzAoovkpu9dGgJVNI8avb8Isu6xPuV+sEOU1NlGIQYc5VxSfSl4mw3i8SsyDsPpLtMtGhp8PLkIv61D49Uu9RIv0TZTTTNtN66MQgzDh24ukDi413ez2HjaCijVqFkgCwfxrhC4KPHqT+rmEwj/D4FYG/ztxRqEcCXcNyetPl9SPeHaJMs69G2sScI7VbPaFfTfy6Ts4asEv4yqO/Q3zSv4; 25:jLF6ln8FKgN6W9ReCyOIu6Lv8nkim4I3Sh1Y4sZfgBa8XyKMsZroc6q5nl2zwMusoW/Xx+nWborClppdsMvcuO8lYARbiNfL1q5UGH2ojznQ2UCFtWDnuzrrkaJ6Q/d/Uz4R4LrsobMWMDyR6Q6ryiIVQ9CqIKs9at64+1rsuuHbMQoeJg6u5wZRaOpDh7Qx/WYlh5IgNtY9bRfrNeuGHyeqTh4UCFeEgy+FlzB3n3maQoxkKQZLEswPxg1vpLYHTqsRHCr+z6Xk8ot0VFugoytWQWt4p9jbhNEIII4KS1FFoFsR6f0DDA47EfgXLboEWGGkULM3T7DtjGzX50PiTw==; 31:X0fEreu/KUf5ci6IIzPbiEZdniJ+dhnzlpet4Onv5KLJ6NWtP24ql7aFhpZeowxAkBnX2CGQeG80VDehcj4lVdTdGRgxxxiOjhauV+JvB5sf2gnc8ZhmxaiCMxUL/tXsxr/OrWW6fAcT9h6UYuV3jQEhl3LS0RpSSFmbqVnR42K3+8JJa7bHVQG8yZAfG8v7VM0RhhbXbgN45X947s9xJHHCb4vd7aUKakVO/ZTP2NQ= X-MS-TrafficTypeDiagnostic: AM3PR05MB1249: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM3PR05MB1249; 20:lMYEsmjdrFwEBpkduHoDrx0RRAs6AvDXtdhVIvhauiSea9kqs4N9Use6PDg/ZRFVPk2MHG4HdbZ1RHYxrNVexuzp0CnDlXKusgTu529yY2/o7x3akqtrJT64RB3tQzykNi/Sx7M7dng2/vbEhgMu+tQI6YZ93RBLAsoCT6YjbcjQOW1OyVvcrrSpEFwrTOLn/AQnSP1p5yxIfvaWkIAX4n/PPBaICTXUwt10uQlBrSaN9b28UAIb3Ikxj6m4z2hsvVPaCga9KlyCNIFtengvDySxQI8vJTUz1QoTT+BGIAZ28XxeuBgWxw2w6EuVTbwIFmp6h4khP0sS6oiRJDXZHxOHV+cxIFQTaAx6CLasuTCQGYQO/80tXSVERO/rouzkjEHJsg7mssqhg8j8gsB3CI4uecotJq1QrMRt3RBeXSUXIJrBzU7DmJI4qrXPDIE20VW+BnfOsD6MIgdOx4XM0WwQ3f5FTIdwFdYnEQl4UV9G95vO/Htzd2emjJLrLoBG; 4:IMPMtPZUASVqUExB5w4X93K7Ht7De/VfXW3i8INaXpmA5aK1uSFgtvEMzPTb/cd8l3bBqJaTswXUfz4zQ4CfcdERPr8Pqh2CQ2Pk+jrRVx/gOdl/h2DmJdYhvXit8IbriTq+aHA1NtYL5DMBGMiEkkn/CP7jgXfGE0ceOirdH/2Y8Z/YBGeXxUylfsjunId5qDXEpR7Wo9eVTsDj9W6yZfcCaR93O9EHFC/XyjU0BgjufLRjW++QmSo9op86CH4AesMW/6eb9oTLUzNS7a2yqQ== 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)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(3231020)(6055026)(6041248)(20161123555025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM3PR05MB1249; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM3PR05MB1249; X-Forefront-PRVS: 047999FF16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(189002)(199003)(50226002)(25786009)(2906002)(47776003)(16526018)(2950100002)(16586007)(97736004)(4720700003)(6666003)(8676002)(316002)(33646002)(189998001)(36756003)(54906003)(86362001)(110136005)(66066001)(305945005)(7736002)(101416001)(5660300001)(76176999)(50986999)(8936002)(81156014)(81166006)(55016002)(5003940100001)(105586002)(69596002)(50466002)(68736007)(48376002)(478600001)(4326008)(21086003)(106356001)(3846002)(6116002)(53936002)(33026002)(168613001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR05MB1249; 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; AM3PR05MB1249; 23:G++M0wAgQcacx5fF3qEcKZsVSt5uBfd/apQqQ24ly?= =?us-ascii?Q?2oK55Et9HDEqmH1406gBthqqIdq7l1DtFTSVCU7kYMUb+q348MFAhJNU7Flb?= =?us-ascii?Q?WoxjkrrfHIOGzj9vTWYbXcWJXR4ixepXFzgDRLNR0i5FvYj71cIMT2Vdf9hK?= =?us-ascii?Q?baL7NhAiWcx876N6GDvGMmgVSBGBKSEw9tzc/IXVDMj1tudrR7rwBNv98ufy?= =?us-ascii?Q?nL10KKNGrmhuM0d5U5xsU/IePOk2NVHNqmv067tmP4IXsa5EVneOiUCWaB2x?= =?us-ascii?Q?x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jA4ca5FFx8+rGM18C+?= =?us-ascii?Q?Z+xlCKIngCaqbk=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM3PR05MB1249; 6:d7+Ei2IC/0qQJdSCuCBhVp4FV1/3Hjy5GdS0M5ZWRVNjRpRqcbIelQm67vMU61td0+dap6/HaAJTm08NVGGQ2oUXiXSPa7tsBrhp1Phzkkp4LYlGPanrm1EtoyTdpiUJiyH6/Jq4zHxFC/vlVBo1QnEPVMBK4tX4boMgMN/ArHjbq84ZPXF9ZJ2o4CP3hnRIlUINZa3c/p8bjsylApCJqttR6+oAWOz0Eet5n+FNoP0BtJ/INhSEdr5+NcV414WdX3fheSbq+K27TXspuNo4HulXOZKumAZw4PdowiKzhxQCAJomOIHwNKfoc4NWfEEiW4SJBHZ2GhQ75k5aT6KK2v+nnNjqLa9xKeMJuluomNM=; 5:I1JODgfKfkJ+SAOH4ZM6wOVxyEm+yY5iYEZdU+AfFLkELJCI3CWTRlPIEfsxk9QsM4J+13Byu8bEUGibimISNQKdbA09l24SOhBSl37vL7eOGA3XdVBOhBjRRIQHJ+9yPpGfW30DmlvkDGzmqIVyJiC4JdWKHr3oM7m6dD+gI7k=; 24:RpDNEITaAjALJSiQ4tAU5YiMilji617sEweKJekR6CmOs2PMb7owyWjGmZPO6sxHgIkCJlsrwTFPOSw2jEXC+nvqPsYuNfYmjWKY5KZcdN8=; 7:qlRUGqdJXPVWIWzF18QF/uWJK8ZX0lueJEuc1GtcDJv/20AjmpDikCRW5vs3sJQhCxolYb962360W3QaPFJlk5iPWLbHpgElXhFf5mPbMj4IugK4Le+6AFntSYavYIhd/761ew3mUkEXTnpy5Laip7oXpvxltz6At0sE/UMAf0xmu3wGTs1QRgiqHPgZ22hZvk/hxyA0j2vr+rJoz7Td78D1qsEHzoj3bjZ+RqTY8gL4d050JQSsuE1EufcedENY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2017 17:27:37.4173 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1cb7862-cacd-4544-c336-08d522170541 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR05MB1249 Subject: [dpdk-stable] [PATCH v2] 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: Thu, 02 Nov 2017 17:27:45 -0000 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 testpmd> 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 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 for failsafe to stop validation and disabling non-supported offloads in its sub-devices. Cc: stable@dpdk.org Fixes: bbc6a53dda44 ("net/failsafe: support Rx offload capabilities") Signed-off-by: Ophir Munk --- drivers/net/failsafe/failsafe_ops.c | 118 ------------------------------------ 1 file changed, 118 deletions(-) diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index f460551..e16a590 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -80,132 +80,14 @@ .flow_type_rss_offloads = 0x0, }; -/** - * Check whether a specific offloading capability - * is supported by a sub_device. - * - * @return - * 0: all requested capabilities are supported by the sub_device - * positive value: This flag at least is not supported by the sub_device - */ -static int -fs_port_offload_validate(struct rte_eth_dev *dev, - struct sub_device *sdev) -{ - struct rte_eth_dev_info infos = {0}; - struct rte_eth_conf *cf; - uint32_t cap; - - cf = &dev->data->dev_conf; - SUBOPS(sdev, dev_infos_get)(ETH(sdev), &infos); - /* RX capabilities */ - cap = infos.rx_offload_capa; - if (cf->rxmode.hw_vlan_strip && - ((cap & DEV_RX_OFFLOAD_VLAN_STRIP) == 0)) { - WARN("VLAN stripping offload requested but not supported by sub_device %d", - SUB_ID(sdev)); - return DEV_RX_OFFLOAD_VLAN_STRIP; - } - if (cf->rxmode.hw_ip_checksum && - ((cap & (DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM)) != - (DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM))) { - WARN("IP checksum offload requested but not supported by sub_device %d", - SUB_ID(sdev)); - return DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM; - } - if (cf->rxmode.enable_lro && - ((cap & DEV_RX_OFFLOAD_TCP_LRO) == 0)) { - WARN("TCP LRO offload requested but not supported by sub_device %d", - SUB_ID(sdev)); - return DEV_RX_OFFLOAD_TCP_LRO; - } - if (cf->rxmode.hw_vlan_extend && - ((cap & DEV_RX_OFFLOAD_QINQ_STRIP) == 0)) { - WARN("Stacked VLAN stripping offload requested but not supported by sub_device %d", - SUB_ID(sdev)); - return DEV_RX_OFFLOAD_QINQ_STRIP; - } - /* TX capabilities */ - /* Nothing to do, no tx capa supported */ - return 0; -} - -/* - * Disable the dev_conf flag related to an offload capability flag - * within an ethdev configuration. - */ -static int -fs_port_disable_offload(struct rte_eth_conf *cf, - uint32_t ol_cap) -{ - switch (ol_cap) { - case DEV_RX_OFFLOAD_VLAN_STRIP: - INFO("Disabling VLAN stripping offload"); - cf->rxmode.hw_vlan_strip = 0; - break; - case DEV_RX_OFFLOAD_IPV4_CKSUM: - case DEV_RX_OFFLOAD_UDP_CKSUM: - case DEV_RX_OFFLOAD_TCP_CKSUM: - case (DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM): - INFO("Disabling IP checksum offload"); - cf->rxmode.hw_ip_checksum = 0; - break; - case DEV_RX_OFFLOAD_TCP_LRO: - INFO("Disabling TCP LRO offload"); - cf->rxmode.enable_lro = 0; - break; - case DEV_RX_OFFLOAD_QINQ_STRIP: - INFO("Disabling stacked VLAN stripping offload"); - cf->rxmode.hw_vlan_extend = 0; - break; - default: - DEBUG("Unable to disable offload capability: %" PRIx32, - ol_cap); - return -1; - } - return 0; -} - static int fs_dev_configure(struct rte_eth_dev *dev) { struct sub_device *sdev; uint8_t i; - int capa_flag; int ret; FOREACH_SUBDEV(sdev, i, dev) { - if (sdev->state != DEV_PROBED) - continue; - DEBUG("Checking capabilities for sub_device %d", i); - while ((capa_flag = 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 >= DEV_ACTIVE && - PRIV(dev)->subs_tail > 1) { - ERROR("device already configured, cannot fix live configuration"); - return -1; - } - ret = fs_port_disable_offload(&dev->data->dev_conf, - capa_flag); - if (ret) { - ERROR("Unable to disable offload capability"); - return ret; - } - } - } - FOREACH_SUBDEV(sdev, i, dev) { int rmv_interrupt = 0; int lsc_interrupt = 0; int lsc_enabled; -- 1.8.3.1