From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B61AA0524 for ; Fri, 5 Feb 2021 12:22:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 419594067B; Fri, 5 Feb 2021 12:22:49 +0100 (CET) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id 9DB914067B for ; Fri, 5 Feb 2021 12:22:48 +0100 (CET) Received: by mail-wr1-f54.google.com with SMTP id b3so7273807wrj.5 for ; Fri, 05 Feb 2021 03:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FcAxGB57ZpY7iaiswdhtABL2k0fozfOoFBNhAQIf1W8=; b=VSwW4t7jkZ7KgaMIFzKLME5SZqNzeeqHDB7Zfen4A59nuWdqzWJet4I3PYT9PQigUz cR2JCtDs4yXoNNVyaR3M0EwKUN615RIOULwo6aGJ24A3GeIs+dukkrQ3UnF7QhTO0RO1 IrRj55FkD4wTjH8hDdebtpYm4Md2hwhrvVS/Q9AWMrO0kIhzCUfXsKEsQclf79aedg9V zEOK6enBdRAMX5cgr+ywhjkKNhTFHMk/0QFsFAdGY+VnvX85M2s8G3AcXWFXv+7bnEbE Sb2NA/jXTOTaa4UHu5ygxCAi37UNL/7fgdbzqmLJBidHkQNrOhRqItPpPzlVJvEzysJQ sj1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FcAxGB57ZpY7iaiswdhtABL2k0fozfOoFBNhAQIf1W8=; b=T5qy9a1XDgWVxzJ34OuXaa017xjEc2XFd/RMHd6VsOjBbVu1gGELK7m5IdM3C3q8TL G+B+/sXc8PwzgLN6/i7y+Ak1aIokvvDNt4xJeUqn/CkEfi/aevrTF2AiwrTIkvvAhpgN B5kluHpimcYaSQy6twzkn9I7kgzs230TjizHkAi+vina3fSKWdRNVAOx2YXDjfTrL2W2 Bun6RGPTxrfs6eVXp3R/5Vzy/WK+HcjNnEQckRCfDNCc7qqvDY4uM3ZFTZyqj/Jqe/Wk wdK1z5iH2DCr3iXzyfxvqv3Lp8yNscQtpgwn16DbJo8XPcEjH10w3tCK2su6bURberZN hC1Q== X-Gm-Message-State: AOAM530hR8p78EQqWhAkUdgcHl7dO+hjBzNaDdiQ+nJ0zVOXqYcPwB1i VXu0kq/UAisChGWL3yWZSEA= X-Google-Smtp-Source: ABdhPJyA2LkTXnXKdCaMrqIo2OfhZWVX4ZOdvR4PfVbdZ7oVHHNBCKgHtzmFUZGUj9LD66owd0B8Iw== X-Received: by 2002:a5d:44ce:: with SMTP id z14mr4491043wrr.330.1612524168446; Fri, 05 Feb 2021 03:22:48 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t18sm11547210wrr.56.2021.02.05.03.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:22:47 -0800 (PST) From: luca.boccassi@gmail.com To: Dapeng Yu Cc: Jun W Zhou , Jeff Guo , dpdk stable Date: Fri, 5 Feb 2021 11:15:47 +0000 Message-Id: <20210205111920.1272063-61-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ixgbe: fix flex bytes flow director rule' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.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 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/85b6748f06dd7f448311e489286a62a98da8dbdb Thanks. Luca Boccassi --- >From 85b6748f06dd7f448311e489286a62a98da8dbdb Mon Sep 17 00:00:00 2001 From: Dapeng Yu Date: Tue, 15 Dec 2020 18:10:31 +0800 Subject: [PATCH] net/ixgbe: fix flex bytes flow director rule [ upstream commit 06cad275fecf4e1892b076796065942cdc1ef44e ] When a flexbytes flow director rule is created, the FDIRCTRL.FLEX_OFFSET register is set, and it keeps its affect even after the flow director flexbytes rule is destroyed, causing packets to be transferred to the wrong place. It is because setting FDIRCTRL shall only be permitted on Flow Director initialization flow or clearing the Flow Director table according to the datasheet, otherwise device may behave unexpectedly. In order to evade this limitation, simulate the Flow Director initialization flow or clearing the Flow Director table by setting FDIRCMD.CLEARHT to 0x1B and then clear it back to 0x0B. Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API") Signed-off-by: Dapeng Yu Tested-by: Jun W Zhou Acked-by: Jeff Guo --- drivers/net/ixgbe/ixgbe_fdir.c | 29 +++++++++++++++++++++++++++++ drivers/net/ixgbe/ixgbe_flow.c | 15 ++++++++------- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index a0fab5070d..11b9effeba 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -503,9 +503,30 @@ ixgbe_fdir_set_flexbytes_offset(struct rte_eth_dev *dev, uint16_t offset) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct ixgbe_hw_fdir_info *fdir_info = + IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private); uint32_t fdirctrl; int i; + if (fdir_info->flex_bytes_offset == offset) + return 0; + + /** + * 82599 adapters flow director init flow cannot be restarted, + * Workaround 82599 silicon errata by performing the following steps + * before re-writing the FDIRCTRL control register with the same value. + * - write 1 to bit 8 of FDIRCMD register & + * - write 0 to bit 8 of FDIRCMD register + */ + IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, + (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) | + IXGBE_FDIRCMD_CLEARHT)); + IXGBE_WRITE_FLUSH(hw); + IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, + (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) & + ~IXGBE_FDIRCMD_CLEARHT)); + IXGBE_WRITE_FLUSH(hw); + fdirctrl = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL); fdirctrl &= ~IXGBE_FDIRCTRL_FLEX_MASK; @@ -520,6 +541,14 @@ ixgbe_fdir_set_flexbytes_offset(struct rte_eth_dev *dev, break; msec_delay(1); } + + if (i >= IXGBE_FDIR_INIT_DONE_POLL) { + PMD_DRV_LOG(ERR, "Flow Director poll time exceeded!"); + return -ETIMEDOUT; + } + + fdir_info->flex_bytes_offset = offset; + return 0; } diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index 39f6ed73f6..9aeb2e4a49 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -3137,13 +3137,13 @@ ixgbe_flow_create(struct rte_eth_dev *dev, rte_memcpy(&fdir_info->mask, &fdir_rule.mask, sizeof(struct ixgbe_hw_fdir_mask)); - fdir_info->flex_bytes_offset = - fdir_rule.flex_bytes_offset; - if (fdir_rule.mask.flex_bytes_mask) - ixgbe_fdir_set_flexbytes_offset(dev, + if (fdir_rule.mask.flex_bytes_mask) { + ret = ixgbe_fdir_set_flexbytes_offset(dev, fdir_rule.flex_bytes_offset); - + if (ret) + goto out; + } ret = ixgbe_fdir_set_input_mask(dev); if (ret) goto out; @@ -3161,8 +3161,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev, if (ret) goto out; - if (fdir_info->flex_bytes_offset != - fdir_rule.flex_bytes_offset) + if (fdir_rule.mask.flex_bytes_mask && + fdir_info->flex_bytes_offset != + fdir_rule.flex_bytes_offset) goto out; } } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:32.019403947 +0000 +++ 0061-net-ixgbe-fix-flex-bytes-flow-director-rule.patch 2021-02-05 11:18:28.806691112 +0000 @@ -1 +1 @@ -From 06cad275fecf4e1892b076796065942cdc1ef44e Mon Sep 17 00:00:00 2001 +From 85b6748f06dd7f448311e489286a62a98da8dbdb Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 06cad275fecf4e1892b076796065942cdc1ef44e ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org