DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix broadcast promiscuous mode setting
@ 2017-03-16  3:09 Wenzhuo Lu
  2017-03-16 13:44 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Wenzhuo Lu @ 2017-03-16  3:09 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

When setting up the VSIs, MAC filter is used for
receiving MAC broadcast packets.
We should follow it to implement the broadcast
promiscuous mode setting.

Fixes: 61fff9b4c68b (net/i40e: set VF broadcast mode from PF)

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 303027b..fb1beae 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -10954,6 +10954,9 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id,
 	struct i40e_pf *pf;
 	struct i40e_vsi *vsi;
 	struct i40e_hw *hw;
+	struct i40e_mac_filter_info filter;
+	struct ether_addr broadcast = {
+		.addr_bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} };
 	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
@@ -10992,12 +10995,19 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id,
 		return -EINVAL;
 	}
 
-	hw = I40E_VSI_TO_HW(vsi);
+	if (on) {
+		(void)rte_memcpy(&filter.mac_addr, &broadcast, ETHER_ADDR_LEN);
+		filter.filter_type = RTE_MACVLAN_PERFECT_MATCH;
+		ret = i40e_vsi_add_mac(vsi, &filter);
+	} else {
+		ret = i40e_vsi_delete_mac(vsi, &broadcast);
+	}
 
-	ret = i40e_aq_set_vsi_broadcast(hw, vsi->seid, on, NULL);
-	if (ret != I40E_SUCCESS) {
+	if (ret != I40E_SUCCESS && ret != I40E_ERR_PARAM) {
 		ret = -ENOTSUP;
 		PMD_DRV_LOG(ERR, "Failed to set VSI broadcast");
+	} else {
+		ret = 0;
 	}
 
 	return ret;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix broadcast promiscuous mode setting
  2017-03-16  3:09 [dpdk-dev] [PATCH] net/i40e: fix broadcast promiscuous mode setting Wenzhuo Lu
@ 2017-03-16 13:44 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-03-16 13:44 UTC (permalink / raw)
  To: Wenzhuo Lu, dev

On 3/16/2017 3:09 AM, Wenzhuo Lu wrote:
> When setting up the VSIs, MAC filter is used for
> receiving MAC broadcast packets.
> We should follow it to implement the broadcast
> promiscuous mode setting.
> 
> Fixes: 61fff9b4c68b (net/i40e: set VF broadcast mode from PF)
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-16 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16  3:09 [dpdk-dev] [PATCH] net/i40e: fix broadcast promiscuous mode setting Wenzhuo Lu
2017-03-16 13:44 ` Ferruh Yigit

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).