[dpdk-dev] [PATCH 06/22] net/hns3: add support for MAC address related operations
Ferruh Yigit
ferruh.yigit at intel.com
Fri Aug 30 17:03:22 CEST 2019
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) <xavier.huwei at huawei.com>
> Signed-off-by: Chunsong Feng <fengchunsong at huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
> Signed-off-by: Hao Chen <chenhao164 at huawei.com>
> Signed-off-by: Huisong Li <lihuisong at huawei.com>
<...>
> +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?
<...>
> @@ -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
More information about the dev
mailing list