From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79AD2A0093 for ; Tue, 19 May 2020 15:06:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 706EA1D603; Tue, 19 May 2020 15:06:36 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 038931D644 for ; Tue, 19 May 2020 15:06:35 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id k13so13746875wrx.3 for ; Tue, 19 May 2020 06:06:35 -0700 (PDT) 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=VfD4+ig4i0WJxM16kETOZZiw9W5WeI7XRJl+VJMwD5M=; b=q8lWYL3fx7NEUkzRSfbLI33iD1IZ3156TGVCP8dsQFcBfmrjUtFtaUGoetCDzlpxed UKd8k6wQ6yKf6GwdkpCrZZ+5U7O7cBipJo9eWH5CGml6Dn4cLQ9lofDmj0QVmblb2vJC 1814+I3SD+fT/NHeYt28Zek42oAh92bK5Yys3pUJQBEhi99vqBXbnPz123b757r2TBsD nvrxB4T/4bUaIUqMBDpPNpT2MsvWkM4PMHUaAPjpTD1K0s17JWLmBQn2qizzGupMM/Ry wMJ33KcPhFVTBOOhyDWc7u8ou53zbMi0yCeadWN0Y+3KCR9OP9N69A+RA1raQBI6P6Wb PhgA== 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=VfD4+ig4i0WJxM16kETOZZiw9W5WeI7XRJl+VJMwD5M=; b=iB4yV5ClIuFoJn0+v1uj8rp64QJZxtY1ibDye292wQSkzk0E8itNXhXXzu4J+aJ1ez y6lKEMZNgdBRIlrwBwCov827ckGBVkF3y1TD1JY3zf9v9IEYGHQ0kk9qRDF4SNVWu72E bHJEACrCCeZi0NFkfOQeDJnKWe/6QmTzuBwL3LeJXhF+QXqVg8gMfMmWu8E48Gi3rpyO QiDq8OiyWzCxwKGFDyIIEokIESGQ3bhX9X26ANjlixpk+LF/w+iUASAF4a6/IlcYPPBX wh1eC40Qiiy+x8fhg0A0XeZ8Z7jvGHQoCl+GVFLMMjLMq8BtpiNqWtJgWE1Cx+72bCd2 b8Hg== X-Gm-Message-State: AOAM531glX301RG39zdDtTJmadlZ/Uq23LPWS1hgFyQpnxwyURz79az+ 9kBEvJJQsfFRGDsTBnC+46Q= X-Google-Smtp-Source: ABdhPJxUgf5zCBZITg8DMB0jOQ5SOO7R2aBu4M6KeYwS7YbGLT0s1QE8Wb6YBBvpcw15zZIW8WJrKQ== X-Received: by 2002:adf:edc1:: with SMTP id v1mr25375258wro.125.1589893594729; Tue, 19 May 2020 06:06:34 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id r2sm21207326wrg.84.2020.05.19.06.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:34 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: Wei Hu , dpdk stable Date: Tue, 19 May 2020 14:02:29 +0100 Message-Id: <20200519130549.112823-14-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix return value of setting VLAN offload' has been queued to stable release 19.11.3 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/20. 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. Thanks. Luca Boccassi --- >From 8081044a6f8bfc1dc46a2d9866b7550f446adbf5 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Thu, 26 Mar 2020 15:14:33 +0800 Subject: [PATCH] net/hns3: fix return value of setting VLAN offload [ upstream commit e7f4213c304bd8d71fc3ca7702c85c434eff0805 ] Currently, the '.vlan_offload_set' ops implementation function named hns3vf_vlan_offload_set always return 0 in hns3 VF PMD driver. This patch fixes it with the following modification in the function named hns3vf_vlan_offload_set. 1. Avoid setting hardware configuration and return -EIO during resetting. 2. Add the return value detection process for calling internal static function named hns3vf_en_hw_strip_rxvtag. Fixes: a5475d61fa34 ("net/hns3: support VF") Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_ethdev_vf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 879851630d..6f8e909f62 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -896,6 +896,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask) struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_conf *dev_conf = &dev->data->dev_conf; unsigned int tmp_mask; + int ret = 0; + + if (rte_atomic16_read(&hw->reset.resetting)) { + hns3_err(hw, "vf set vlan offload failed during resetting, " + "mask = 0x%x", mask); + return -EIO; + } tmp_mask = (unsigned int)mask; /* Vlan stripping setting */ @@ -903,13 +910,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask) rte_spinlock_lock(&hw->lock); /* Enable or disable VLAN stripping */ if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) - hns3vf_en_hw_strip_rxvtag(hw, true); + ret = hns3vf_en_hw_strip_rxvtag(hw, true); else - hns3vf_en_hw_strip_rxvtag(hw, false); + ret = hns3vf_en_hw_strip_rxvtag(hw, false); rte_spinlock_unlock(&hw->lock); } - return 0; + return ret; } static int -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:45.154745176 +0100 +++ 0014-net-hns3-fix-return-value-of-setting-VLAN-offload.patch 2020-05-19 14:04:44.080645907 +0100 @@ -1,8 +1,10 @@ -From e7f4213c304bd8d71fc3ca7702c85c434eff0805 Mon Sep 17 00:00:00 2001 +From 8081044a6f8bfc1dc46a2d9866b7550f446adbf5 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Thu, 26 Mar 2020 15:14:33 +0800 Subject: [PATCH] net/hns3: fix return value of setting VLAN offload +[ upstream commit e7f4213c304bd8d71fc3ca7702c85c434eff0805 ] + Currently, the '.vlan_offload_set' ops implementation function named hns3vf_vlan_offload_set always return 0 in hns3 VF PMD driver. @@ -13,7 +15,6 @@ function named hns3vf_en_hw_strip_rxvtag. Fixes: a5475d61fa34 ("net/hns3: support VF") -Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) @@ -22,10 +23,10 @@ 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c -index 08ae58a794..07f5ab6379 100644 +index 879851630d..6f8e909f62 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c -@@ -1150,6 +1150,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask) +@@ -896,6 +896,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask) struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_conf *dev_conf = &dev->data->dev_conf; unsigned int tmp_mask; @@ -39,7 +40,7 @@ tmp_mask = (unsigned int)mask; /* Vlan stripping setting */ -@@ -1157,13 +1164,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask) +@@ -903,13 +910,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask) rte_spinlock_lock(&hw->lock); /* Enable or disable VLAN stripping */ if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)