[dpdk-dev] Fwd: Re: [PATCH v5 2/2] ethdev: change queue release callback
Xueming(Steven) Li
xuemingl at nvidia.com
Wed Sep 29 16:04:10 CEST 2021
Cc maillist for history record.
On Thu, 2021-09-23 at 23:34 +0800, Xueming Li wrote:
Hi Min,
On Thu, 2021-09-23 at 17:15 +0800, Min Hu (Connor) wrote:
Hi, Xueming,
Not only "rte_eth_devices[(hw)->data->port_id]" exist in HNS3 PMD, but
also "rte_eth_devices[rxq->port_id]", so marco which will be
added may be:
#define HNS3_DEV(port_id) &rte_eth_devices[port_id]
call it like this:
- hns3_dev_rx_queue_release(&rte_eth_devices[hw->data->port_id], i);
+ hns3_dev_rx_queue_release(HNS3_DEV(hw->data->port_id), i);
But this seems a little wired, what do you think ?
From usage, most of them are hw, some are rxq or txq.
How about rename HNS3_DEV(hw) to HNS3_HW_DEV(hw)?
Later, if needed, add HNS3_Q_DEV(q).
在 2021/9/23 14:22, Xueming(Steven) Li 写道:
Hi HNS3 maintainers,
In my ethdev patch below that changing ethdev queue release API, some
minor changes are expected on HNS3 pmd as well.
Since &rte_eth_devices[hw->data->port_id] is used a lot, A macro is
planned to hide direct rte_eth_devices access, please confirm the
changes below:
In drivers/net/hns3/hns3_ethdev.h:
#define HNS3_DEV(hw) &rte_eth_devices[(hw)->data->port_id]
Call it like this:
- hns3_dev_rx_queue_release(&rte_eth_devices[hw->data->port_id], i);
+ hns3_dev_rx_queue_release(HNS3_DEV(hw), i);
There are more directly access to rte_eth_devices in hns3 PMD, you can
changes them later.
Please confirm or suggest if any.
Best Regards,
Xueming Li
-------- Forwarded Message --------
From: Ferruh Yigit <ferruh.yigit at intel.com<mailto:ferruh.yigit at intel.com>>
To: Xueming(Steven) Li <xuemingl at nvidia.com<mailto:xuemingl at nvidia.com>>, yisen.zhuang at huawei.com<mailto:yisen.zhuang at huawei.com>
<yisen.zhuang at huawei.com<mailto:yisen.zhuang at huawei.com>>, oulijun at huawei.com<mailto:oulijun at huawei.com> <oulijun at huawei.com<mailto:oulijun at huawei.com>>,
dev at dpdk.org<mailto:dev at dpdk.org> <dev at dpdk.org<mailto:dev at dpdk.org>>, humin29 at huawei.com<mailto:humin29 at huawei.com> <humin29 at huawei.com<mailto:humin29 at huawei.com>>,
spinler at cesnet.cz<mailto:spinler at cesnet.cz> <spinler at cesnet.cz<mailto:spinler at cesnet.cz>>
Cc: zhouguoyang at huawei.com<mailto:zhouguoyang at huawei.com> <zhouguoyang at huawei.com<mailto:zhouguoyang at huawei.com>>,
mczekaj at marvell.com<mailto:mczekaj at marvell.com> <mczekaj at marvell.com<mailto:mczekaj at marvell.com>>, radhac at marvell.com<mailto:radhac at marvell.com>
<radhac at marvell.com<mailto:radhac at marvell.com>>, sthotton at marvell.com<mailto:sthotton at marvell.com> <sthotton at marvell.com<mailto:sthotton at marvell.com>>,
Matan Azrad <matan at nvidia.com<mailto:matan at nvidia.com>>, kirankumark at marvell.com<mailto:kirankumark at marvell.com>
<kirankumark at marvell.com<mailto:kirankumark at marvell.com>>, rmody at marvell.com<mailto:rmody at marvell.com> <rmody at marvell.com<mailto:rmody at marvell.com>>,
beilei.xing at intel.com<mailto:beilei.xing at intel.com> <beilei.xing at intel.com<mailto:beilei.xing at intel.com>>, chenbo.xia at intel.com<mailto:chenbo.xia at intel.com>
<chenbo.xia at intel.com<mailto:chenbo.xia at intel.com>>, vburru at marvell.com<mailto:vburru at marvell.com> <vburru at marvell.com<mailto:vburru at marvell.com>>,
somnath.kotur at broadcom.com<mailto:somnath.kotur at broadcom.com> <somnath.kotur at broadcom.com<mailto:somnath.kotur at broadcom.com>>,
jiawenwu at trustnetic.com<mailto:jiawenwu at trustnetic.com> <jiawenwu at trustnetic.com<mailto:jiawenwu at trustnetic.com>>, skori at marvell.com<mailto:skori at marvell.com>
<skori at marvell.com<mailto:skori at marvell.com>>, hemant.agrawal at nxp.com<mailto:hemant.agrawal at nxp.com> <hemant.agrawal at nxp.com<mailto:hemant.agrawal at nxp.com>>,
maxime.coquelin at redhat.com<mailto:maxime.coquelin at redhat.com> <maxime.coquelin at redhat.com<mailto:maxime.coquelin at redhat.com>>,
heinrich.kuhn at corigine.com<mailto:heinrich.kuhn at corigine.com> <heinrich.kuhn at corigine.com<mailto:heinrich.kuhn at corigine.com>>,
asomalap at amd.com<mailto:asomalap at amd.com> <asomalap at amd.com<mailto:asomalap at amd.com>>, andrew.rybchenko at oktetlabs.ru<mailto:andrew.rybchenko at oktetlabs.ru>
<andrew.rybchenko at oktetlabs.ru<mailto:andrew.rybchenko at oktetlabs.ru>>, yongwang at vmware.com<mailto:yongwang at vmware.com>
<yongwang at vmware.com<mailto:yongwang at vmware.com>>, ajit.khaparde at broadcom.com<mailto:ajit.khaparde at broadcom.com>
<ajit.khaparde at broadcom.com<mailto:ajit.khaparde at broadcom.com>>, hkalra at marvell.com<mailto:hkalra at marvell.com> <hkalra at marvell.com<mailto:hkalra at marvell.com>>,
shaibran at amazon.com<mailto:shaibran at amazon.com> <shaibran at amazon.com<mailto:shaibran at amazon.com>>, chas3 at att.com<mailto:chas3 at att.com>
<chas3 at att.com<mailto:chas3 at att.com>>, cloud.wangxiaoyun at huawei.com<mailto:cloud.wangxiaoyun at huawei.com>
<cloud.wangxiaoyun at huawei.com<mailto:cloud.wangxiaoyun at huawei.com>>, sthemmin at microsoft.com<mailto:sthemmin at microsoft.com>
<sthemmin at microsoft.com<mailto:sthemmin at microsoft.com>>, jerinj at marvell.com<mailto:jerinj at marvell.com> <jerinj at marvell.com<mailto:jerinj at marvell.com>>,
qiming.yang at intel.com<mailto:qiming.yang at intel.com> <qiming.yang at intel.com<mailto:qiming.yang at intel.com>>, pnalla at marvell.com<mailto:pnalla at marvell.com>
<pnalla at marvell.com<mailto:pnalla at marvell.com>>, NBU-Contact-Thomas Monjalon
<thomas at monjalon.net<mailto:thomas at monjalon.net>>, mk at semihalf.com<mailto:mk at semihalf.com> <mk at semihalf.com<mailto:mk at semihalf.com>>,
srinivasan at marvell.com<mailto:srinivasan at marvell.com> <srinivasan at marvell.com<mailto:srinivasan at marvell.com>>, mw at semihalf.com<mailto:mw at semihalf.com>
<mw at semihalf.com<mailto:mw at semihalf.com>>, keith.wiles at intel.com<mailto:keith.wiles at intel.com> <keith.wiles at intel.com<mailto:keith.wiles at intel.com>>,
xiao.w.wang at intel.com<mailto:xiao.w.wang at intel.com> <xiao.w.wang at intel.com<mailto:xiao.w.wang at intel.com>>, xuanziyang2 at huawei.com<mailto:xuanziyang2 at huawei.com>
<xuanziyang2 at huawei.com<mailto:xuanziyang2 at huawei.com>>, mtetsuyah at gmail.com<mailto:mtetsuyah at gmail.com> <mtetsuyah at gmail.com<mailto:mtetsuyah at gmail.com>>,
qi.z.zhang at intel.com<mailto:qi.z.zhang at intel.com> <qi.z.zhang at intel.com<mailto:qi.z.zhang at intel.com>>, g.singh at nxp.com<mailto:g.singh at nxp.com>
<g.singh at nxp.com<mailto:g.singh at nxp.com>>, aboyer at pensando.io<mailto:aboyer at pensando.io> <aboyer at pensando.io<mailto:aboyer at pensando.io>>,
steven.webster at windriver.com<mailto:steven.webster at windriver.com> <steven.webster at windriver.com<mailto:steven.webster at windriver.com>>,
evgenys at amazon.com<mailto:evgenys at amazon.com> <evgenys at amazon.com<mailto:evgenys at amazon.com>>, johndale at cisco.com<mailto:johndale at cisco.com>
<johndale at cisco.com<mailto:johndale at cisco.com>>, irusskikh at marvell.com<mailto:irusskikh at marvell.com> <irusskikh at marvell.com<mailto:irusskikh at marvell.com>>,
dsinghrawat at marvell.com<mailto:dsinghrawat at marvell.com> <dsinghrawat at marvell.com<mailto:dsinghrawat at marvell.com>>, shshaikh at marvell.com<mailto:shshaikh at marvell.com>
<shshaikh at marvell.com<mailto:shshaikh at marvell.com>>, lironh at marvell.com<mailto:lironh at marvell.com> <lironh at marvell.com<mailto:lironh at marvell.com>>, Slava
Ovsiienko <viacheslavo at nvidia.com<mailto:viacheslavo at nvidia.com>>, aman.deep.singh at intel.com<mailto:aman.deep.singh at intel.com>
<aman.deep.singh at intel.com<mailto:aman.deep.singh at intel.com>>, sachin.saxena at oss.nxp.com<mailto:sachin.saxena at oss.nxp.com>
<sachin.saxena at oss.nxp.com<mailto:sachin.saxena at oss.nxp.com>>, rahul.lakkireddy at chelsio.com<mailto:rahul.lakkireddy at chelsio.com>
<rahul.lakkireddy at chelsio.com<mailto:rahul.lakkireddy at chelsio.com>>, matt.peters at windriver.com<mailto:matt.peters at windriver.com>
<matt.peters at windriver.com<mailto:matt.peters at windriver.com>>, jianwang at trustnetic.com<mailto:jianwang at trustnetic.com>
<jianwang at trustnetic.com<mailto:jianwang at trustnetic.com>>, skoteshwar at marvell.com<mailto:skoteshwar at marvell.com>
<skoteshwar at marvell.com<mailto:skoteshwar at marvell.com>>, zr at semihalf.com<mailto:zr at semihalf.com> <zr at semihalf.com<mailto:zr at semihalf.com>>, NBU-
Contact-longli <longli at microsoft.com<mailto:longli at microsoft.com>>, jingjing.wu at intel.com<mailto:jingjing.wu at intel.com>
<jingjing.wu at intel.com<mailto:jingjing.wu at intel.com>>, igorch at amazon.com<mailto:igorch at amazon.com> <igorch at amazon.com<mailto:igorch at amazon.com>>,
grive at u256.net<mailto:grive at u256.net> <grive at u256.net<mailto:grive at u256.net>>, haiyue.wang at intel.com<mailto:haiyue.wang at intel.com>
<haiyue.wang at intel.com<mailto:haiyue.wang at intel.com>>, jgrajcia at cisco.com<mailto:jgrajcia at cisco.com> <jgrajcia at cisco.com<mailto:jgrajcia at cisco.com>>,
hyonkim at cisco.com<mailto:hyonkim at cisco.com> <hyonkim at cisco.com<mailto:hyonkim at cisco.com>>, ndabilpuram at marvell.com<mailto:ndabilpuram at marvell.com>
<ndabilpuram at marvell.com<mailto:ndabilpuram at marvell.com>>
Subject: Re: [PATCH v5 2/2] ethdev: change queue release callback
Date: Wed, 22 Sep 2021 11:57:54 +0100
<...>
@@ -1536,7 +1536,8 @@ hns3_fake_rx_queue_config(struct hns3_hw *hw, uint16_t nb_queues)
/* re-configure */
rxq = hw->fkq_data.rx_queues;
for (i = nb_queues; i < old_nb_queues; i++)
- hns3_dev_rx_queue_release(rxq[i]);
+ hns3_dev_rx_queue_release
+ (&rte_eth_devices[hw->data->port_id], i);
I think this should be done without driver accesing the global 'rte_eth_devices'
array. This may require more help from driver maintainer, and perhaps wrapper
functions can be used for the driver for now and maintainer can update it later,
if agreed with the driver maintainer.
There are about 20 direct accessing to the global 'rte_eth_devices',
I already made similar comment to the driver previously, but lets just not add
more usage.
I'm afraid adding more patches to improve PMD drivers might make this
patcheset over complex.
Agree to not complex this patch for it.
Huawei maintainers, could you please address Ferruh's suggestion? just
a clean up whith simple macro.
@Min Hu (Connor) <humin29 at huawei.com<mailto:humin29 at huawei.com>>
@Yisen Zhuang <yisen.zhuang at huawei.com<mailto:yisen.zhuang at huawei.com>>
@Lijun Ou <oulijun at huawei.com<mailto:oulijun at huawei.com>>
More information about the dev
mailing list