[8/8] net/iavf: support check DD bit of a RX descriptor
diff mbox series

Message ID 20200927072626.28374-9-robinx.zhang@intel.com
State Rejected
Delegated to: Qi Zhang
Headers show
Series
  • feature porting from i40evf to iavf
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Robin Zhang Sept. 27, 2020, 7:26 a.m. UTC
Add implementation of inline API rx_descriptor_done in iavf PMD.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  1 +
 drivers/net/iavf/iavf_rxtx.c   | 26 ++++++++++++++++++++++++++
 drivers/net/iavf/iavf_rxtx.h   |  1 +
 3 files changed, 28 insertions(+)

Comments

Ferruh Yigit Oct. 8, 2020, 3:05 p.m. UTC | #1
On 9/27/2020 8:26 AM, Robin Zhang wrote:
> Add implementation of inline API rx_descriptor_done in iavf PMD.
> 
> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
> ---
>   drivers/net/iavf/iavf_ethdev.c |  1 +
>   drivers/net/iavf/iavf_rxtx.c   | 26 ++++++++++++++++++++++++++
>   drivers/net/iavf/iavf_rxtx.h   |  1 +
>   3 files changed, 28 insertions(+)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 836c09f58..b7a819a0e 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -1417,6 +1417,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
>   	/* assign ops func pointer */
>   	eth_dev->dev_ops = &iavf_eth_dev_ops;
>   	eth_dev->rx_queue_count = iavf_dev_rxq_count;
> +	eth_dev->rx_descriptor_done = iavf_dev_rx_desc_done;
>   	eth_dev->rx_descriptor_status = iavf_dev_rx_desc_status;
>   	eth_dev->tx_descriptor_status = iavf_dev_tx_desc_status;

Hi Robin,

'rx_descriptor_done' dev_ops is deprecated, 'rx_descriptor_status' should 
provide same information?

Is there a specific reason/need to implement 'rx_descriptor_done'? If not I will 
drop this patch.
Ferruh Yigit Oct. 12, 2020, 8:32 a.m. UTC | #2
On 10/10/2020 2:49 AM, Zhang, RobinX wrote:
> Hi Ferruh
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> Sent: Thursday, October 8, 2020 11:06 PM
>> To: Zhang, RobinX <robinx.zhang@intel.com>; dev@dpdk.org
>> Cc: Xing, Beilei <beilei.xing@intel.com>; Wu, Jingjing
>> <jingjing.wu@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Yang,
>> SteveX <stevex.yang@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH 8/8] net/iavf: support check DD bit of a RX
>> descriptor
>>
>> On 9/27/2020 8:26 AM, Robin Zhang wrote:
>>> Add implementation of inline API rx_descriptor_done in iavf PMD.
>>>
>>> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
>>> ---
>>>    drivers/net/iavf/iavf_ethdev.c |  1 +
>>>    drivers/net/iavf/iavf_rxtx.c   | 26 ++++++++++++++++++++++++++
>>>    drivers/net/iavf/iavf_rxtx.h   |  1 +
>>>    3 files changed, 28 insertions(+)
>>>
>>> diff --git a/drivers/net/iavf/iavf_ethdev.c
>>> b/drivers/net/iavf/iavf_ethdev.c index 836c09f58..b7a819a0e 100644
>>> --- a/drivers/net/iavf/iavf_ethdev.c
>>> +++ b/drivers/net/iavf/iavf_ethdev.c
>>> @@ -1417,6 +1417,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
>>>    	/* assign ops func pointer */
>>>    	eth_dev->dev_ops = &iavf_eth_dev_ops;
>>>    	eth_dev->rx_queue_count = iavf_dev_rxq_count;
>>> +	eth_dev->rx_descriptor_done = iavf_dev_rx_desc_done;
>>>    	eth_dev->rx_descriptor_status = iavf_dev_rx_desc_status;
>>>    	eth_dev->tx_descriptor_status = iavf_dev_tx_desc_status;
>>
>> Hi Robin,
>>
>> 'rx_descriptor_done' dev_ops is deprecated, 'rx_descriptor_status' should
>> provide same information?
>>
>> Is there a specific reason/need to implement 'rx_descriptor_done'? If not I
>> will drop this patch.
> 
> The purpose of this patch is keep same behavior between i40evf and iavf.
> 
> Refer to i40evf commit cbfc6111b5 in dpdk-next-net-intel, 'rx_descriptor_done' is moved to 'struct rte_eth_dev'.
> 

I see, but for i40evf, the 'rx_descriptor_done' was already there and it will be 
removed in 21.11.

I think no need to add a deprecated feature. 'rte_eth_rx_descriptor_status' 
replaces it and it is already implemented in iavf.
Zhang, Qi Z Oct. 13, 2020, 5:58 a.m. UTC | #3
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> Sent: Monday, October 12, 2020 4:33 PM
> To: Zhang, RobinX <robinx.zhang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 8/8] net/iavf: support check DD bit of a RX
> descriptor
> 
> On 10/10/2020 2:49 AM, Zhang, RobinX wrote:
> > Hi Ferruh
> >
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> Sent: Thursday, October 8, 2020 11:06 PM
> >> To: Zhang, RobinX <robinx.zhang@intel.com>; dev@dpdk.org
> >> Cc: Xing, Beilei <beilei.xing@intel.com>; Wu, Jingjing
> >> <jingjing.wu@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Yang,
> >> SteveX <stevex.yang@intel.com>
> >> Subject: Re: [dpdk-dev] [PATCH 8/8] net/iavf: support check DD bit of
> >> a RX descriptor
> >>
> >> On 9/27/2020 8:26 AM, Robin Zhang wrote:
> >>> Add implementation of inline API rx_descriptor_done in iavf PMD.
> >>>
> >>> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
> >>> ---
> >>>    drivers/net/iavf/iavf_ethdev.c |  1 +
> >>>    drivers/net/iavf/iavf_rxtx.c   | 26 ++++++++++++++++++++++++++
> >>>    drivers/net/iavf/iavf_rxtx.h   |  1 +
> >>>    3 files changed, 28 insertions(+)
> >>>
> >>> diff --git a/drivers/net/iavf/iavf_ethdev.c
> >>> b/drivers/net/iavf/iavf_ethdev.c index 836c09f58..b7a819a0e 100644
> >>> --- a/drivers/net/iavf/iavf_ethdev.c
> >>> +++ b/drivers/net/iavf/iavf_ethdev.c
> >>> @@ -1417,6 +1417,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
> >>>    	/* assign ops func pointer */
> >>>    	eth_dev->dev_ops = &iavf_eth_dev_ops;
> >>>    	eth_dev->rx_queue_count = iavf_dev_rxq_count;
> >>> +	eth_dev->rx_descriptor_done = iavf_dev_rx_desc_done;
> >>>    	eth_dev->rx_descriptor_status = iavf_dev_rx_desc_status;
> >>>    	eth_dev->tx_descriptor_status = iavf_dev_tx_desc_status;
> >>
> >> Hi Robin,
> >>
> >> 'rx_descriptor_done' dev_ops is deprecated, 'rx_descriptor_status'
> >> should provide same information?
> >>
> >> Is there a specific reason/need to implement 'rx_descriptor_done'? If
> >> not I will drop this patch.
> >
> > The purpose of this patch is keep same behavior between i40evf and iavf.
> >
> > Refer to i40evf commit cbfc6111b5 in dpdk-next-net-intel,
> 'rx_descriptor_done' is moved to 'struct rte_eth_dev'.
> >
> 
> I see, but for i40evf, the 'rx_descriptor_done' was already there and it will be
> removed in 21.11.
> 
> I think no need to add a deprecated feature. 'rte_eth_rx_descriptor_status'
> replaces it and it is already implemented in iavf.

+1. Let's drop this patch.

Patch
diff mbox series

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 836c09f58..b7a819a0e 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1417,6 +1417,7 @@  iavf_dev_init(struct rte_eth_dev *eth_dev)
 	/* assign ops func pointer */
 	eth_dev->dev_ops = &iavf_eth_dev_ops;
 	eth_dev->rx_queue_count = iavf_dev_rxq_count;
+	eth_dev->rx_descriptor_done = iavf_dev_rx_desc_done;
 	eth_dev->rx_descriptor_status = iavf_dev_rx_desc_status;
 	eth_dev->tx_descriptor_status = iavf_dev_tx_desc_status;
 	eth_dev->rx_pkt_burst = &iavf_recv_pkts;
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 1b0efe043..d9e3aac1d 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2337,6 +2337,32 @@  iavf_dev_rxq_count(struct rte_eth_dev *dev, uint16_t queue_id)
 	return desc;
 }
 
+int
+iavf_dev_rx_desc_done(void *rx_queue, uint16_t offset)
+{
+	volatile union iavf_rx_desc *rxdp;
+	struct iavf_rx_queue *rxq = rx_queue;
+	uint16_t desc;
+	int ret;
+
+	if (unlikely(offset >= rxq->nb_rx_desc)) {
+		PMD_DRV_LOG(ERR, "Invalid RX descriptor id %u", offset);
+		return 0;
+	}
+
+	desc = rxq->rx_tail + offset;
+	if (desc >= rxq->nb_rx_desc)
+		desc -= rxq->nb_rx_desc;
+
+	rxdp = &rxq->rx_ring[desc];
+
+	ret = !!(((rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len) &
+		IAVF_RXD_QW1_STATUS_MASK) >> IAVF_RXD_QW1_STATUS_SHIFT) &
+				(1 << IAVF_RX_DESC_STATUS_DD_SHIFT));
+
+	return ret;
+}
+
 int
 iavf_dev_rx_desc_status(void *rx_queue, uint16_t offset)
 {
diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
index 3d02c6589..d5c002858 100644
--- a/drivers/net/iavf/iavf_rxtx.h
+++ b/drivers/net/iavf/iavf_rxtx.h
@@ -404,6 +404,7 @@  void iavf_dev_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 void iavf_dev_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 			  struct rte_eth_txq_info *qinfo);
 uint32_t iavf_dev_rxq_count(struct rte_eth_dev *dev, uint16_t queue_id);
+int iavf_dev_rx_desc_done(void *rx_queue, uint16_t offset);
 int iavf_dev_rx_desc_status(void *rx_queue, uint16_t offset);
 int iavf_dev_tx_desc_status(void *tx_queue, uint16_t offset);