From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 37765101B for ; Tue, 21 Nov 2017 14:31:01 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A9CB320B9E; Tue, 21 Nov 2017 08:30:59 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:30:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=+PuOzFKOcaz5jiKkL p8swoIW/q1kbn3tSj2CAyDWXn0=; b=t5/dv4GjwxOEGWmsVK94CbyaaJT1y/TUQ dZ/auNA3IjorYkHJUh3K5SHx3P/RIhjDRPC0rVf9nEzgHL/lc13H3Ko1M/QAjYk4 iohiOHHRPzZYhD/vZnQZlWVK2FWo37NSxwkdkmdvWDvfBOqkbC0v9TP9ZdPUJdTj 5Shyk56jHaEeUZsyp6bZ8blSV1veXRWiIl1hXMj2lUYQ3MGcYI/hSlhYEJ5y4MF5 LEMYMWvJts7uo5vrtSb3eiKYfa9N372m4O+x3iqFL6V6g0GqkHgV3GdMrPTGJ9x3 jDey/Lu3hANSuZc/Q+bVwJYAlAvMvgFCulPgDH6gev4NNcUeJD5qA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=+PuOzFKOcaz5jiKkLp8swoIW/q1kbn3tSj2CAyDWXn0=; b=XsNZYED4 gOPi+ZHWUqK+ify/d0H5a8xiLKAu/zB+bjAhLt0idjf1+mBQ1yiUjb1Dl4rlBTtz UBA6S+X9x5JHPgWDwQqOOm7wTkFai53oTiMjPGzzs75Z+I9gZFuYqfz4IJnycFPH pDbrxEr+FRBOEcrvNDa17LykcPJxoQt3bMF5XIQtApnsMlxkAwYQsQ/TxhLU0U4b Djjm72I+JtCqjiScCdiB1ah240x1IyQqZzpGnqhU8RwJZ+22o9l56/F1RxoRvmtq rGiKH87WB4OVvXn02r/+ARmg1YdC16oX6kKKj5p2p+B70SmUTJTt+WcLKUtEmYOb 0Q80IHIqLsj4hw== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 1A0B0248B4; Tue, 21 Nov 2017 08:30:55 -0500 (EST) From: Yuanhan Liu To: Ophir Munk Cc: Thomas Monjalon , dpdk stable Date: Tue, 21 Nov 2017 21:18:42 +0800 Message-Id: <1511270333-31002-180-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/failsafe: fix VLAN stripping configuration' has been queued to stable release 17.08.1 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: Tue, 21 Nov 2017 13:31:01 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From edb9348247221ad49dc087b83dcbf8b2e022b46b Mon Sep 17 00:00:00 2001 From: Ophir Munk Date: Thu, 2 Nov 2017 17:27:03 +0000 Subject: [PATCH] net/failsafe: fix VLAN stripping configuration [ upstream commit e28d4ee4f0d9aeb39ffc6e7b999b2dac30f4ab1a ] 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. Fixes: bbc6a53dda44 ("net/failsafe: support Rx offload capabilities") Signed-off-by: Ophir Munk Acked-by: Thomas Monjalon --- 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 ff9ad15..6c34bf0 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -79,132 +79,14 @@ static struct rte_eth_dev_info default_infos = { .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; -- 2.7.4