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 62C2045775; Fri, 9 Aug 2024 09:08:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD95642E66; Fri, 9 Aug 2024 09:08:20 +0200 (CEST) Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by mails.dpdk.org (Postfix) with ESMTP id 7ECE642E66 for ; Fri, 9 Aug 2024 09:08:19 +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=1723187299; x=1724396899; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FCI5kBpxtnnms1VJWVzV6LMJX7TXNC9vwPIOmV9g6qs=; b=fyfU9aQcUvZF5RrO44M67Td1PhwFApy3n8WRfnAdRExPrHW1dsKzeHVo Y+PTn9xMg5uTZuYhwNtZD2UPkZ14OZvqKFf0+guCSLXb9vwgKPYgItYte ixQROKqA3LsKRhFyIb6oL4QgGI+F0OPehAzdqpgU6SQXijUS/wxZUdGKY 8=; X-CSE-ConnectionGUID: AN+7BeGYSImOEOXp16KjuA== X-CSE-MsgGUID: qa64YNitRuOkdPq8jJqr6Q== X-IronPort-AV: E=Sophos;i="6.09,275,1716249600"; d="scan'208";a="329199425" Received: from rcdn-core-1.cisco.com ([173.37.93.152]) by alln-iport-6.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2024 07:08:18 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id 47978IM3006852; Fri, 9 Aug 2024 07:08:18 GMT Received: by cisco.com (Postfix, from userid 508933) id 236F120F2003; Fri, 9 Aug 2024 00:08:18 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Subject: [PATCH v3 3/3] net/enic: allow multicast in MAC address add callback Date: Fri, 9 Aug 2024 00:07:54 -0700 Message-Id: <20240809070754.26128-4-hyonkim@cisco.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20240809070754.26128-1-hyonkim@cisco.com> References: <20240808061433.14971-1-hyonkim@cisco.com> <20240809070754.26128-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-1.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