From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05FC145767; Thu, 8 Aug 2024 08:15:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09B974279B; Thu, 8 Aug 2024 08:15:57 +0200 (CEST) Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by mails.dpdk.org (Postfix) with ESMTP id 16FAD4279B for ; Thu, 8 Aug 2024 08:15:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=1519; q=dns/txt; s=iport; t=1723097756; x=1724307356; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FCI5kBpxtnnms1VJWVzV6LMJX7TXNC9vwPIOmV9g6qs=; b=AhUu2O9HS23EGk6Al7IBYSy04nQuxYa3lhz0xicGi3XMV+/bsaGXaD+j 2OIuzQD5+aaVcTOxtLb525vN05Z/Kh47wytc/qcn9lijl1JSytpYf5weA a/DgPtPmVx/jhdHeeGyJHFDZukqxH/OKdPkbkkeq2mvvyXW/u7f1m9Or9 g=; X-CSE-ConnectionGUID: Ds3oaCkwTnGPHwF/QIT9qw== X-CSE-MsgGUID: 5DPQ5pa/RJeG/gGlHOwnug== X-IronPort-AV: E=Sophos;i="6.09,272,1716249600"; d="scan'208";a="334854786" Received: from rcdn-core-3.cisco.com ([173.37.93.154]) by alln-iport-1.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 06:15:55 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-3.cisco.com (8.15.2/8.15.2) with ESMTP id 4786Fthp024004; Thu, 8 Aug 2024 06:15:55 GMT Received: by cisco.com (Postfix, from userid 508933) id 0D6B520F2003; Wed, 7 Aug 2024 23:15:55 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Subject: [PATCH v2 3/3] net/enic: allow multicast in MAC address add callback Date: Wed, 7 Aug 2024 23:14:33 -0700 Message-Id: <20240808061433.14971-4-hyonkim@cisco.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20240808061433.14971-1-hyonkim@cisco.com> References: <20240808041838.31367-4-hyonkim@cisco.com> <20240808061433.14971-1-hyonkim@cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-3.cisco.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Reviewed-by: John Daley --- 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