[PATCH v4 09/15] net/xsc: add ethdev start

WanRenyong wanry at yunsilicon.com
Mon Jan 6 04:01:48 CET 2025


On 2025/1/4 3:17, Stephen Hemminger wrote:
> On Fri, 03 Jan 2025 23:04:23 +0800
> "WanRenyong" <wanry at yunsilicon.com> wrote:
>
>> +static int
>> +xsc_ethdev_start(struct rte_eth_dev *dev)
>> +{
>> +	int ret;
>> +	struct xsc_ethdev_priv *priv = TO_XSC_ETHDEV_PRIV(dev);
>> +
>> +	ret = xsc_txq_start(priv);
>> +	if (ret) {
>> +		PMD_DRV_LOG(ERR, "Port %u txq start failed: %s",
>> +			    dev->data->port_id, strerror(rte_errno));
>> +		goto error;
>> +	}
>> +
>> +	ret = xsc_rxq_start(priv);
>> +	if (ret) {
>> +		PMD_DRV_LOG(ERR, "Port %u Rx queue start failed: %s",
>> +			    dev->data->port_id, strerror(rte_errno));
>> +		goto error;
>> +	}
>> +
>> +	dev->data->dev_started = 1;
>> +
>> +	rte_wmb();
> In general, it is preferred that DPDK drivers use rte_atomic to get
> finer grain control over shared variables. Rather than using volatile
> and barriers.  This is not an absolute requirement, but something
> that is preferred and improves performance on weakly ordered platforms.
Understood, maybe rte_wmb is not neccessary here, will remove it in the 
next version.

-- 
Thanks,
WanRenyong


More information about the dev mailing list