DPDK patches and discussions
 help / color / mirror / Atom feed
From: Guinan Sun <guinanx.sun@intel.com>
To: dev@dpdk.org
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Qiming Yang <qiming.yang@intel.com>,
	Guinan Sun <guinanx.sun@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix setting VF MAC address
Date: Wed, 11 Mar 2020 09:06:51 +0000	[thread overview]
Message-ID: <20200311090651.4328-1-guinanx.sun@intel.com> (raw)
In-Reply-To: <20200310025836.70492-1-guinanx.sun@intel.com>

The reason why PF cannot receive data normally is that
vf performed the clear_rar operation through dev close
without adding a mac address. 
This will cause the association between the index and
rx address set by VMDq to be cancelled,thus affecting
the data reception of PF.
The correction method is to add a check action, and do
not perform the set_rar operation without adding a mac
address to prevent affecting the reception of data.

Fixes: 3c4270187518 ("net/ixgbe: support VF MAC address add/remove")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
v2 changes:
* Modify commit log
---
 drivers/net/ixgbe/ixgbe_pf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index afae21f81..67b5bef44 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -783,8 +783,10 @@ ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 		hw->mac.ops.set_rar(hw, vf_info[vf].mac_count,
 				new_mac, vf, IXGBE_RAH_AV);
 	} else {
-		hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count);
-		vf_info[vf].mac_count = 0;
+		if (vf_info[vf].mac_count) {
+			hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count);
+			vf_info[vf].mac_count = 0;
+		}
 	}
 	return 0;
 }
-- 
2.17.1


  parent reply	other threads:[~2020-03-11  9:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10  2:58 [dpdk-dev] [PATCH] " Guinan Sun
2020-03-11  7:29 ` Ye Xiaolong
2020-03-11  9:06 ` Guinan Sun [this message]
2020-03-13  1:09   ` [dpdk-dev] [PATCH v2] " Ye Xiaolong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311090651.4328-1-guinanx.sun@intel.com \
    --to=guinanx.sun@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).