[PATCH 2/3] ethdev: retrieve VLAN filter configuration
Stephen Hemminger
stephen at networkplumber.org
Fri Apr 18 20:38:14 CEST 2025
On Fri, 11 Apr 2025 16:10:04 +0800
Chaoyong He <chaoyong.he at corigine.com> wrote:
>
> +RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_eth_dev_get_vlan_filter_conf, 25.07)
> +int
> +rte_eth_dev_get_vlan_filter_conf(uint16_t port_id,
> + struct rte_vlan_filter_conf *vf_conf)
> +{
> + struct rte_eth_dev *dev;
> +
> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> + dev = &rte_eth_devices[port_id];
> +
> + if (vf_conf == NULL) {
> + RTE_ETHDEV_LOG_LINE(ERR,
> + "Cannot get ethdev port %u vlan filter configuration to NULL",
> + port_id);
> + return -EINVAL;
> + }
> +
> + memcpy(vf_conf, &dev->data->vlan_filter_conf, sizeof(struct rte_vlan_filter_conf));
Could just be a structure assignment which would preserve type safety.
> +
> + rte_ethdev_trace_vlan_filter_conf_get(port_id, vf_conf);
> +
> + return 0;
> +}
> +
Not sure if adding new accessor function is really needed.
Unfortunately, all of dev->data is exposed in DPDK API already.
More information about the dev
mailing list