[dpdk-dev,v3] i40e: fix i40evf_add_mac_addr to permit multicast addresses

Message ID 20170913032110.39994-1-dharton@cpp-rtpbld-31.cpprtplab
State Accepted
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
checkpatch success coding style OK
Intel-compilation success Compilation OK

Commit Message

David Harton Sept. 13, 2017, 3:21 a.m.
From: David Harton <dharton@cisco.com>

The i40e maintains a single MAC filter table for both
unicast and multicast addresses.  The i40e_validate_mac_addr
function was preventing multicast addresses from being added
to the table via i40evf_add_mac_addr.  Fixed the issue by
adjusting the check in i40evf_add_mac_addr.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address")

Signed-off-by: David Harton <dharton@cisco.com>
---

v3
* Modified diff to use more conventional logic.

v2
* Removed multicast check in i40evf_add_mac_addr.

v1
* Removed multicast check in i40e_validate_mac_addr.

 drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Beilei Xing Sept. 13, 2017, 3:42 a.m.
> -----Original Message-----
> From: David Harton [mailto:dharton@cpp-rtpbld-31.cpprtplab]
> Sent: Wednesday, September 13, 2017 11:21 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; David Harton <dharton@cisco.com>
> Subject: [PATCH v3] i40e: fix i40evf_add_mac_addr to permit multicast
> addresses
> 
> From: David Harton <dharton@cisco.com>
> 
> The i40e maintains a single MAC filter table for both unicast and multicast
> addresses.  The i40e_validate_mac_addr function was preventing multicast
> addresses from being added to the table via i40evf_add_mac_addr.  Fixed
> the issue by adjusting the check in i40evf_add_mac_addr.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address")
> 
> Signed-off-by: David Harton <dharton@cisco.com>

Acked-by: Beilei Xing <beilei.xing@intel.com>
Ferruh Yigit Sept. 14, 2017, 6:55 p.m.
On 9/13/2017 4:42 AM, Xing, Beilei wrote:
> 
> 
>> -----Original Message-----
>> From: David Harton [mailto:dharton@cpp-rtpbld-31.cpprtplab]
>> Sent: Wednesday, September 13, 2017 11:21 AM
>> To: Xing, Beilei <beilei.xing@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org; David Harton <dharton@cisco.com>
>> Subject: [PATCH v3] i40e: fix i40evf_add_mac_addr to permit multicast
>> addresses
>>
>> From: David Harton <dharton@cisco.com>
>>
>> The i40e maintains a single MAC filter table for both unicast and multicast
>> addresses.  The i40e_validate_mac_addr function was preventing multicast
>> addresses from being added to the table via i40evf_add_mac_addr.  Fixed
>> the issue by adjusting the check in i40evf_add_mac_addr.
>>
>> Fixes: 4861cde46116 ("i40e: new poll mode driver")
>> Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address")
>>
>> Signed-off-by: David Harton <dharton@cisco.com>
> 
> Acked-by: Beilei Xing <beilei.xing@intel.com>

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

Patch hide | download patch | download mbox

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index f6d8293..08afd9e 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -888,7 +888,7 @@  i40evf_add_mac_addr(struct rte_eth_dev *dev,
 	int err;
 	struct vf_cmd_info args;
 
-	if (i40e_validate_mac_addr(addr->addr_bytes) != I40E_SUCCESS) {
+	if (is_zero_ether_addr(addr)) {
 		PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x",
 			    addr->addr_bytes[0], addr->addr_bytes[1],
 			    addr->addr_bytes[2], addr->addr_bytes[3],