DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Chaoyong He <chaoyong.he@corigine.com>
Cc: dev@dpdk.org, oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>
Subject: Re: [PATCH 2/3] ethdev: retrieve VLAN filter configuration
Date: Fri, 18 Apr 2025 11:38:14 -0700	[thread overview]
Message-ID: <20250418113814.2f0a48e5@hermes.local> (raw)
In-Reply-To: <20250411081005.1133509-3-chaoyong.he@corigine.com>

On Fri, 11 Apr 2025 16:10:04 +0800
Chaoyong He <chaoyong.he@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.

  reply	other threads:[~2025-04-18 18:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11  8:10 [PATCH 0/3] enhance the vlan filter feature Chaoyong He
2025-04-11  8:10 ` [PATCH 1/3] app/testpmd: add/remove multiple VLAN filter IDs at once Chaoyong He
2025-04-11 16:27   ` Stephen Hemminger
2025-04-14  6:26     ` Chaoyong He
2025-04-11  8:10 ` [PATCH 2/3] ethdev: retrieve VLAN filter configuration Chaoyong He
2025-04-18 18:38   ` Stephen Hemminger [this message]
2025-04-11  8:10 ` [PATCH 3/3] app/testpmd: add a command to show VLAN filter IDs Chaoyong He
2025-04-18 18:42   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250418113814.2f0a48e5@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).