DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hyong Youb Kim <hyonkim@cisco.com>
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: dev@dpdk.org, John Daley <johndale@cisco.com>,
	Hyong Youb Kim <hyonkim@cisco.com>
Subject: [PATCH v2 3/3] net/enic: allow multicast in MAC address add callback
Date: Wed,  7 Aug 2024 23:14:33 -0700	[thread overview]
Message-ID: <20240808061433.14971-4-hyonkim@cisco.com> (raw)
In-Reply-To: <20240808061433.14971-1-hyonkim@cisco.com>

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>
---
 drivers/net/enic/enic_main.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index e59b0a5077..b755b15d92 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -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)
 {
@@ -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");
-- 
2.35.2


  parent reply	other threads:[~2024-08-08  6:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08  4:18 [PATCH 0/3] net/enic: support VF and fix minor issues Hyong Youb Kim
2024-08-08  4:18 ` [PATCH 1/3] net/enic: support SR-IOV VF using admin channel Hyong Youb Kim
2024-08-08  4:18 ` [PATCH 2/3] net/enic: add speed capabilities for newer models Hyong Youb Kim
2024-08-08  4:18 ` [PATCH 3/3] net/enic: allow multicast in MAC address add callback Hyong Youb Kim
2024-08-08  6:14   ` [PATCH v2 0/3] net/enic: support VF and fix minor issues Hyong Youb Kim
2024-08-08  6:14     ` [PATCH v2 1/3] net/enic: support SR-IOV VF using admin channel Hyong Youb Kim
2024-08-08  8:50       ` Ferruh Yigit
2024-08-09  6:27         ` Hyong Youb Kim (hyonkim)
2024-08-08  6:14     ` [PATCH v2 2/3] net/enic: add speed capabilities for newer models Hyong Youb Kim
2024-08-08  8:50       ` Ferruh Yigit
2024-08-09  6:28         ` Hyong Youb Kim (hyonkim)
2024-08-08  6:14     ` Hyong Youb Kim [this message]
2024-08-08  8:50       ` [PATCH v2 3/3] net/enic: allow multicast in MAC address add callback Ferruh Yigit
2024-08-09  6:49         ` Hyong Youb Kim (hyonkim)
2024-08-09  7:07     ` [PATCH v3 0/3] net/enic: support VF and fix minor issues Hyong Youb Kim
2024-08-09  7:07       ` [PATCH v3 1/3] net/enic: support SR-IOV VF using admin channel Hyong Youb Kim
2024-08-09  7:07       ` [PATCH v3 2/3] net/enic: add speed capabilities for newer models Hyong Youb Kim
2024-08-09  7:07       ` [PATCH v3 3/3] net/enic: allow multicast in MAC address add callback Hyong Youb Kim

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=20240808061433.14971-4-hyonkim@cisco.com \
    --to=hyonkim@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=johndale@cisco.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).