[PATCH v9 06/14] net/sxe: add filter function

Stephen Hemminger stephen at networkplumber.org
Thu Jul 17 18:52:49 CEST 2025


On Wed, 16 Jul 2025 04:29:22 -0400
Jie Liu <liujie5 at linkdatatechnology.com> wrote:

>  
> +static u8 sxe_sw_uc_entry_add(struct rte_eth_dev *eth_dev, u8 index,
> +	u8 *mac_addr)
> +{
> +	u8 i, pool;
> +	struct sxe_adapter *adapter = eth_dev->data->dev_private;
> +	struct sxe_uc_addr_table *uc_table = adapter->mac_filter_ctxt.uc_addr_table;
> +
> +	pool = sxe_vf_num_get(eth_dev);
> +	for (i = 0; i < SXE_UC_ENTRY_NUM_MAX; i++) {
> +		if (!uc_table[i].used) {
> +			uc_table[i].pool_idx = pool;
> +			uc_table[i].used = true;
> +			uc_table[i].rar_idx = i;
> +			uc_table[i].original_index = index;
> +			uc_table[i].type = SXE_PF;
> +			rte_memcpy(uc_table[i].addr, mac_addr, SXE_MAC_ADDR_LEN);
> +			break;
> +		}
> +	}
> +

Please do not use rte_memcpy here, instead use memcpy which has compiler
can check better.

Same in pf logic.


More information about the dev mailing list