Skip to content

Commit

Permalink
net/enic: allow multicast in MAC address add callback
Browse files Browse the repository at this point in the history
enic_set_mac_address() (mac_addr_add callback) currently allows only
non-zero, unicast address to be added. It is overly restrictive.
rte_eth_dev_mac_addr_add() itself allows multicast addresses. And,
some applications do use rte_eth_dev_mac_addr_add() to accept
multicast addresses. So, remove the unicast check in
enic_set_mac_address().

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
  • Loading branch information
Hyong Youb Kim authored and ferruhy committed Sep 22, 2024
1 parent 417e776 commit 483f451
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@
#include "vnic_intr.h"
#include "vnic_nic.h"

static int is_zero_addr(uint8_t *addr)
{
return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
}

static int is_mcast_addr(uint8_t *addr)
{
return addr[0] & 1;
}

static int is_eth_addr_valid(uint8_t *addr)
{
return !is_mcast_addr(addr) && !is_zero_addr(addr);
}

void
enic_rxmbuf_queue_release(__rte_unused struct enic *enic, struct vnic_rq *rq)
{
Expand Down Expand Up @@ -177,11 +162,6 @@ int enic_set_mac_address(struct enic *enic, uint8_t *mac_addr)
{
int err;

if (!is_eth_addr_valid(mac_addr)) {
dev_err(enic, "invalid mac address\n");
return -EINVAL;
}

err = enic_dev_add_addr(enic, mac_addr);
if (err)
dev_err(enic, "add mac addr failed\n");
Expand Down

0 comments on commit 483f451

Please sign in to comment.