From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f54.google.com (mail-pg0-f54.google.com [74.125.83.54]) by dpdk.org (Postfix) with ESMTP id A406F9957 for ; Mon, 21 Aug 2017 11:37:19 +0200 (CEST) Received: by mail-pg0-f54.google.com with SMTP id m133so14744618pga.5 for ; Mon, 21 Aug 2017 02:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KLRkdXy69Ayv7J8ywObKm8pQFsNBo/WUyLbFt87lLbM=; b=GCHXZebaEha6DFVMIXIFUlROR4RYwwh+Cv+8Xq47ACfQeVuIz0r6/x9ypGH50a88X1 N2mEdO9GPlimxe/4dHDEgXs/NcKZ7KUwOqJDU1ElG2DNReNFTldHhDY82h+ZMDP3dkQ1 4/JEjpEMA3dnmsr2zbWe4qrrhwtYfxtEueIK10flul96nl/oz5vUhV5V0f+4mQl1QR2V gxx/uIzaAEn/TvB4QkYv0GPKwFTQe3wYICqYJYHYhd2L8rKg5kfVxPnpbF6amLKM9VpN YSZLJEhqn/LPMuYfMiI8V1AVqvyvErncE2XIEQlMnQ563MMEY9UQKP+qex3hPm+CPh/3 1k7w== 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; bh=KLRkdXy69Ayv7J8ywObKm8pQFsNBo/WUyLbFt87lLbM=; b=OL8JeS9sj7nveyWF2X72hT0fMJ3+dOp5ZjzjrLvvz30n1XQ8T/fS3+BjTNhm2OqBIu mN55E6ujxQf28Xmyxf8AinsarhmYvnDsFnVzP2d26tv1Xxr5KrDXa5MyYlvyLprYRxvo rg9o+96S58tO5QYyDaViJQo7Md7g+2HByxvLbgK9XZxDrJMt784KlaUnpkX9M0Qi3iMY WaCcmRG8R7ADt+GVJxKHHrZ/QsMyCzB168+yMqT0Xzdm9FAMBy61XG3BkO+LAUG8HnJP 7bMdKTdzPlDlUBefMVr/nRx6RZzONNUps7MgTocmLDhNaSSQt8tQkQFMG7oq1WrXIpxB Qhsg== X-Gm-Message-State: AHYfb5imTG/gN6qlgqSLPoOWttkiscQHNnKeQTqDy/ct49fu1TtzQRqK tSBcUxA6BT6VJ4JoFMfXfQ== X-Received: by 10.98.133.134 with SMTP id m6mr16285519pfk.97.1503308238988; Mon, 21 Aug 2017 02:37:18 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 69sm23355087pfh.186.2017.08.21.02.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 02:37:17 -0700 (PDT) From: Yuanhan Liu To: Xiaoyun Li Cc: Jingjing Wu , dpdk stable , Yuanhan Liu Date: Mon, 21 Aug 2017 17:31:03 +0800 Message-Id: <1503307878-16728-49-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> References: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/i40e: fix PF notify when VF is not up' has been queued to stable release 17.05.2 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: Mon, 21 Aug 2017 09:37:19 -0000 Hi, FYI, your patch has been queued to stable release 17.05.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 2fb170db88f88bf8e010272c48b0f8935c5ac020 Mon Sep 17 00:00:00 2001 From: Xiaoyun Li Date: Fri, 28 Jul 2017 23:48:11 +0800 Subject: [PATCH] net/i40e: fix PF notify when VF is not up [ upstream commit 035a8cf88f010c82de3040c895c801ce0849b065 ] This patch stops PF from sending messages to inactive VF and modifies VF state to active when VF reset is completed. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Xiaoyun Li Acked-by: Jingjing Wu --- drivers/net/i40e/i40e_pf.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 0758503..65d93a8 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -152,22 +152,22 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset) val |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val); I40E_WRITE_FLUSH(hw); - } #define VFRESET_MAX_WAIT_CNT 100 - /* Wait until VF reset is done */ - for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { - rte_delay_us(10); - val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); - if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) - break; - } + /* Wait until VF reset is done */ + for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { + rte_delay_us(10); + val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); + if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) + break; + } - if (i >= VFRESET_MAX_WAIT_CNT) { - PMD_DRV_LOG(ERR, "VF reset timeout"); - return -ETIMEDOUT; + if (i >= VFRESET_MAX_WAIT_CNT) { + PMD_DRV_LOG(ERR, "VF reset timeout"); + return -ETIMEDOUT; + } + vf->state = I40E_VF_ACTIVE; } - /* This is not first time to do reset, do cleanup job first */ if (vf->vsi) { /* Disable queues */ @@ -262,7 +262,10 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, { struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf); uint16_t abs_vf_id = hw->func_caps.vf_base_id + vf->vf_idx; - int ret; + int ret = I40E_ERR_ADMIN_QUEUE_ERROR; + + if (vf->state == I40E_VF_INACTIVE) + return ret; ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, msg, msglen, NULL); -- 2.7.4