From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8AD9A2E1B for ; Thu, 5 Sep 2019 07:41:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A599E1EBED; Thu, 5 Sep 2019 07:41:08 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id C6B3F1EB4B for ; Thu, 5 Sep 2019 07:41:06 +0200 (CEST) Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 51A9BBE27A02A85D89C6; Thu, 5 Sep 2019 13:41:05 +0800 (CST) Received: from [127.0.0.1] (10.57.115.182) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Sep 2019 13:40:57 +0800 To: Ferruh Yigit , References: <1566568031-45991-1-git-send-email-xavier.huwei@huawei.com> <1566568031-45991-7-git-send-email-xavier.huwei@huawei.com> <31c27b10-613f-6a3d-8725-be9fb42cfd15@intel.com> CC: , , , From: "Wei Hu (Xavier)" Message-ID: <1878b516-fe80-0c05-f623-1d3dd3695b30@huawei.com> Date: Thu, 5 Sep 2019 13:40:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <31c27b10-613f-6a3d-8725-be9fb42cfd15@intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.57.115.182] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 06/22] net/hns3: add support for MAC address related operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Ferruh Yigit On 2019/8/30 23:03, Ferruh Yigit wrote: > On 8/23/2019 2:46 PM, Wei Hu (Xavier) wrote: >> This patch adds the following mac address related operations defined in >> struct eth_dev_ops: mac_addr_add, mac_addr_remove, mac_addr_set >> and set_mc_addr_list. >> >> Signed-off-by: Wei Hu (Xavier) >> Signed-off-by: Chunsong Feng >> Signed-off-by: Min Hu (Connor) >> Signed-off-by: Hao Chen >> Signed-off-by: Huisong Li > <...> > >> +static int >> +hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev, >> + struct rte_ether_addr *mc_addr_set, >> + uint32_t nb_mc_addr) >> +{ >> + struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); >> + struct rte_ether_addr reserved_addr_list[HNS3_MC_MACADDR_NUM]; >> + struct rte_ether_addr add_addr_list[HNS3_MC_MACADDR_NUM]; >> + struct rte_ether_addr rm_addr_list[HNS3_MC_MACADDR_NUM]; >> + struct rte_ether_addr *addr; >> + int reserved_addr_num; >> + int add_addr_num; >> + int rm_addr_num; >> + int mc_addr_num; >> + int num; >> + int ret; >> + int i; >> + >> + /* Check if input parameters are valid */ >> + ret = hns3_set_mc_addr_chk_param(hw, mc_addr_set, nb_mc_addr); >> + if (ret) >> + return ret; >> + >> + rte_spinlock_lock(&hw->lock); > Is locking required here? We support reset after exception, and restore the settings to the pre-reset by the alarm in the interrupt thread. There are two threads setting mc_mac, so we need to lock. > > <...> > >> @@ -1582,6 +2394,10 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) >> >> static const struct eth_dev_ops hns3_eth_dev_ops = { >> .dev_close = hns3_dev_close, >> + .mac_addr_add = hns3_add_mac_addr, >> + .mac_addr_remove = hns3_remove_mac_addr, >> + .mac_addr_set = hns3_set_default_mac_addr, >> + .set_mc_addr_list = hns3_set_mc_mac_addr_list, >> }; > Can you please update .ini file in this patch and mark following features as > supported: > Unicast MAC filter > Multicast MAC filter OK, we will fix it in v2. Best Regards Xavier >