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 1F1DBA04DD for ; Wed, 28 Oct 2020 11:47:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0CEA04CA7; Wed, 28 Oct 2020 11:47:38 +0100 (CET) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by dpdk.org (Postfix) with ESMTP id 3CA544CA7 for ; Wed, 28 Oct 2020 11:47:36 +0100 (CET) Received: by mail-wm1-f41.google.com with SMTP id t3so1852818wmi.3 for ; Wed, 28 Oct 2020 03:47:36 -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=EHubUvGdiQBN45DN38NtJtu9dx84vqFlJcdApsVP7cU=; b=Umlan5yKEql9oWGkVvHnp4nOFsdn4Ux5ZuNUx2g5k1/juef4wAz+qzxEl8+Gqn954Q pWi61l+B3Zce5OmIibo2aJl8OIOAbWlPYzeQDHGdCLBdv0b3B6JB2K+zflI0ccqNeiha gh8U7iRbxQbxh1rjrSbkQlW+wlw//EsqrnW1lAoxGlcbGP8HRitl9Ol964nHywCqMU4c cANdrMDGc+fH/MFXr0Suofuxn6VPAzklKbfXPdI+C/8xJJhik5r0qhqdRSxI1/pMOnKY jx2ZBXHwKWPzFEm3Oi/WjIlrZRDhFhtyTsPjYDKj6ben9d5xgXd7qyOjIWDmGy1zQ67o ZHVg== 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=EHubUvGdiQBN45DN38NtJtu9dx84vqFlJcdApsVP7cU=; b=UpT2rCv95M9FpWRhPKYBk9D4P4FIigj7dPWkOf+AYqidg7eu+T4Hh1SqOLi3s+8jm7 ituyhvUVDF36UJXGILFameT1Srk3jr35SUPdkDR4pmla1RMTCbX6ZYlyrsXoRgX4ERcX 23v4X1ELoCadwPbf66yg9s9qG2+NRTBKdZTYN5YU7nZMWAmAKUY57fw0DBjZaYSySV9I n6P/f/Bfe0y8uJv7506/fMCp1JHcHz1NaTXOz8BMlb49N+SjNBZG4M+05PCQeqKIOgYU KihN+h3NZLmvWuZPlSihTNRyTOMinp/S46VhXo6VPtzL6IbHdlWrkJWJJsFPHhc7o3vp 84YQ== X-Gm-Message-State: AOAM533458vijsEtlRyJEKxmqFpYB3nnGITSHLsD9dyjyNdSjDEivwB0 W7v/5Hetzr47tKD3EWOrIe4= X-Google-Smtp-Source: ABdhPJx5jfD+J58Wigzyt8OF47FYJyBQK+LrSmVpT63RN6GkF2xNktv3rRibX/9dccpNloGMB4G8bw== X-Received: by 2002:a1c:e4c1:: with SMTP id b184mr7417610wmh.73.1603882054954; Wed, 28 Oct 2020 03:47:34 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w83sm5915737wmg.48.2020.10.28.03.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:47:33 -0700 (PDT) From: luca.boccassi@gmail.com To: Jeff Guo Cc: Hailin Xu , Qi Zhang , dpdk stable Date: Wed, 28 Oct 2020 10:43:06 +0000 Message-Id: <20201028104606.3504127-27-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/iavf: fix command after PF reset' has been queued to stable release 19.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/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 28f7721700ef3a9dad30f8888d0823865fa7b5d8 Mon Sep 17 00:00:00 2001 From: Jeff Guo Date: Fri, 11 Sep 2020 18:18:48 +0800 Subject: [PATCH] net/iavf: fix command after PF reset [ upstream commit 1eab95fe2e36e191ad85a9aacf82a44e7c8011fc ] If PF reset is finished but VF reset is pending, VF should no need to send any invalid cmd to PF. That would avoid mass unexpected behaviors affecting the robust. Fixes: 22b123a36d07 ("net/avf: initialize PMD") Fixes: 9e03acd726cf ("net/iavf: fix flow access") Signed-off-by: Jeff Guo Tested-by: Hailin Xu Acked-by: Qi Zhang --- drivers/net/iavf/iavf.h | 2 +- drivers/net/iavf/iavf_ethdev.c | 3 +++ drivers/net/iavf/iavf_vchnl.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 84f8213542..04f7764456 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -104,7 +104,7 @@ struct iavf_info { uint32_t link_speed; struct iavf_vsi vsi; - bool vf_reset; + bool vf_reset; /* true for VF reset pending, false for no VF reset */ uint64_t flags; uint8_t *rss_lut; diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index a60b04ddd5..02e7006972 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1246,6 +1246,9 @@ iavf_init_vf(struct rte_eth_dev *dev) goto err_rss; } } + + vf->vf_reset = false; + return 0; err_rss: rte_free(vf->rss_key); diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index aba177caec..3e0454593a 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -76,6 +76,9 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) if (_atomic_set_cmd(vf, args->ops)) return -1; + if (vf->vf_reset) + return -EIO; + ret = iavf_aq_send_msg_to_pf(hw, args->ops, IAVF_SUCCESS, args->in_args, args->in_args_size, NULL); if (ret) { -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:12.630749809 +0000 +++ 0027-net-iavf-fix-command-after-PF-reset.patch 2020-10-28 10:35:11.456829317 +0000 @@ -1,32 +1,32 @@ -From 1eab95fe2e36e191ad85a9aacf82a44e7c8011fc Mon Sep 17 00:00:00 2001 +From 28f7721700ef3a9dad30f8888d0823865fa7b5d8 Mon Sep 17 00:00:00 2001 From: Jeff Guo Date: Fri, 11 Sep 2020 18:18:48 +0800 Subject: [PATCH] net/iavf: fix command after PF reset +[ upstream commit 1eab95fe2e36e191ad85a9aacf82a44e7c8011fc ] + If PF reset is finished but VF reset is pending, VF should no need to send any invalid cmd to PF. That would avoid mass unexpected behaviors affecting the robust. Fixes: 22b123a36d07 ("net/avf: initialize PMD") Fixes: 9e03acd726cf ("net/iavf: fix flow access") -Cc: stable@dpdk.org Signed-off-by: Jeff Guo Tested-by: Hailin Xu Acked-by: Qi Zhang --- drivers/net/iavf/iavf.h | 2 +- - drivers/net/iavf/iavf_ethdev.c | 2 ++ - drivers/net/iavf/iavf_hash.c | 8 ++++++++ + drivers/net/iavf/iavf_ethdev.c | 3 +++ drivers/net/iavf/iavf_vchnl.c | 3 +++ - 4 files changed, 14 insertions(+), 1 deletion(-) + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h -index 9ad331ee92..3198d85b3a 100644 +index 84f8213542..04f7764456 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h -@@ -134,7 +134,7 @@ struct iavf_info { - uint16_t mc_addrs_num; /* Multicast mac addresses number */ +@@ -104,7 +104,7 @@ struct iavf_info { + uint32_t link_speed; struct iavf_vsi vsi; - bool vf_reset; @@ -35,46 +35,21 @@ uint8_t *rss_lut; diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c -index e1ff38e8be..6bb915d816 100644 +index a60b04ddd5..02e7006972 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c -@@ -1285,6 +1285,8 @@ iavf_init_vf(struct rte_eth_dev *dev) +@@ -1246,6 +1246,9 @@ iavf_init_vf(struct rte_eth_dev *dev) + goto err_rss; } } - ++ + vf->vf_reset = false; + return 0; err_rss: rte_free(vf->rss_key); -diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c -index ff77d71356..ddc6df8495 100644 ---- a/drivers/net/iavf/iavf_hash.c -+++ b/drivers/net/iavf/iavf_hash.c -@@ -457,6 +457,9 @@ iavf_hash_init(struct iavf_adapter *ad) - struct iavf_flow_parser *parser; - int ret; - -+ if (vf->vf_reset) -+ return -EIO; -+ - if (!vf->vf_res) - return -EINVAL; - -@@ -967,6 +970,11 @@ iavf_hash_destroy(__rte_unused struct iavf_adapter *ad, - static void - iavf_hash_uninit(struct iavf_adapter *ad) - { -+ struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad); -+ -+ if (vf->vf_reset) -+ return; -+ - if (iavf_hash_default_set(ad, false)) - PMD_DRV_LOG(ERR, "fail to delete default RSS"); - diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c -index 69e1dc72aa..76f8e38d1e 100644 +index aba177caec..3e0454593a 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -76,6 +76,9 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)