From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) by dpdk.org (Postfix) with ESMTP id 86E4B2B9D for ; Wed, 9 Aug 2017 05:47:11 +0200 (CEST) Received: by mail-pg0-f51.google.com with SMTP id y129so22793719pgy.4 for ; Tue, 08 Aug 2017 20:47:11 -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=qLICIChieo2J0ctaUUJ57ypSKpLuTDMbeY96v2lZllw=; b=M2ggy6S7g0PCfYQqNMKJlqpA2HdYnzB9g+7LFy6nNe30AMFg2uyDEgDTyoCMQeCxnj vd89+biT0tAyazCnFRqhImGUcfmKTj0bcX5NaSXEPHXrSSiFYy/SwKZ57tj222izBM8I dh0rntRUGxApAy4aYH2BjEdhmVEZ13Bvv4/2g0mgTg/W5Vy00i32BP3q9PlzLRw/7Vv0 xpEluQVDYztQPORCOQQETsBD+h6Op3cdHbf2vZI3bW+Ju+kTzRwiIOlXjdpHpaz43QB0 sK5yzbiGjvlnruKBkkGroMNRhSO+1PEr7RRYDEysDZCSS9IWgUKoarfMXuIxKayF3iwy 7BLQ== 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=qLICIChieo2J0ctaUUJ57ypSKpLuTDMbeY96v2lZllw=; b=LWS8sHwZx+zEk0Bz+KRVTzRenDXkFZjBZDtx82F+oP9xDJ2oKIfaoFZgBJa4MwY7GB JRGMRxcTCOOsc4yAkyzjeB69/85YvWOkBX7zXACG/IxIqyH2Zy7R6bFOQ5vbakLk+kDE 5c8NBswUc7YxZMFGV4hzq9K5wx7T712SSRRu71Ioph5DkLHBHLxAc//yTeScNBipUxJf r3RHAeJkLYSVDVKYZVWK/6Py1mde18duBjUzG3ckV8RU6WH7IvUmyevFI2pv97pzdQjv SAzPE5alhULp5x4xms+xTkdNJGpc9WD9D3SR1I6HNRpHDuuON3fyv3xKAy+ws66J2Cvi hLsw== X-Gm-Message-State: AHYfb5jMKaibjOpFWt3MoDuTFaLX3FUkSBGjRvWy93hzfuZNkO9Ru7ia mG7Za9GQFPI2nZmq X-Received: by 10.99.126.86 with SMTP id o22mr6127673pgn.383.1502250430828; Tue, 08 Aug 2017 20:47:10 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id q3sm5093921pfl.89.2017.08.08.20.47.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Aug 2017 20:47:09 -0700 (PDT) From: Yuanhan Liu To: Xiaoyun Li Cc: Jingjing Wu , dpdk stable , Yuanhan Liu Date: Wed, 9 Aug 2017 11:43:51 +0800 Message-Id: <1502250240-6599-9-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502250240-6599-1-git-send-email-yliu@fridaylinux.org> References: <1502250240-6599-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 LTS release 16.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: , X-List-Received-Date: Wed, 09 Aug 2017 03:47:11 -0000 Hi, FYI, your patch has been queued to LTS release 16.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 08/11/17. So please shout if anyone has objections. Thanks. --yliu --- >>From a01cf403496049b6991eedc7084279b3bd43b431 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 b36d901..978b82b 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -151,22 +151,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 */ @@ -261,7 +261,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