[V3] ethdev: add queue state when retrieve queue information
Checks
Commit Message
Currently, upper-layer application could get queue state only
through pointers such as dev->data->tx_queue_state[queue_id],
this is not the recommended way to access it. So this patch
add get queue state when call rte_eth_rx_queue_info_get and
rte_eth_tx_queue_info_get API.
Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
it could be ABI compatible.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
V2->V3:
- rewrite the commit log and delete the part Note
- rewrite tht comments for queue state
- move the queue_state definition locations
V1->V2:
- move queue state defines to public file
---
doc/guides/rel_notes/release_21_05.rst | 6 ++++++
lib/librte_ethdev/ethdev_driver.h | 7 -------
lib/librte_ethdev/rte_ethdev.c | 3 +++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
4 files changed, 18 insertions(+), 7 deletions(-)
Comments
On 4/15/2021 3:40 AM, Lijun Ou wrote:
> Currently, upper-layer application could get queue state only
> through pointers such as dev->data->tx_queue_state[queue_id],
> this is not the recommended way to access it. So this patch
> add get queue state when call rte_eth_rx_queue_info_get and
> rte_eth_tx_queue_info_get API.
>
> Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
> remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
> it could be ABI compatible.
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
Looks good to me, but it is causing an ABI error as we already discussed before
as that is false positive.
Ray, David,
Should we add any exception to libabigail.abignore for this?
15/04/2021 14:33, Ferruh Yigit:
> On 4/15/2021 3:40 AM, Lijun Ou wrote:
> > Currently, upper-layer application could get queue state only
> > through pointers such as dev->data->tx_queue_state[queue_id],
> > this is not the recommended way to access it. So this patch
> > add get queue state when call rte_eth_rx_queue_info_get and
> > rte_eth_tx_queue_info_get API.
> >
> > Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
> > remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
> > it could be ABI compatible.
> >
> > Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> > Signed-off-by: Lijun Ou <oulijun@huawei.com>
>
> Looks good to me, but it is causing an ABI error as we already discussed before
> as that is false positive.
>
>
> Ray, David,
>
> Should we add any exception to libabigail.abignore for this?
We do not tolerate any ABI warning.
If we are sure the ABI change is false positive,
it must be suppressed in libabigail.abignore in the same patch.
On 4/15/2021 1:36 PM, Thomas Monjalon wrote:
> 15/04/2021 14:33, Ferruh Yigit:
>> On 4/15/2021 3:40 AM, Lijun Ou wrote:
>>> Currently, upper-layer application could get queue state only
>>> through pointers such as dev->data->tx_queue_state[queue_id],
>>> this is not the recommended way to access it. So this patch
>>> add get queue state when call rte_eth_rx_queue_info_get and
>>> rte_eth_tx_queue_info_get API.
>>>
>>> Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
>>> remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
>>> it could be ABI compatible.
>>>
>>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>>> Signed-off-by: Lijun Ou <oulijun@huawei.com>
>>
>> Looks good to me, but it is causing an ABI error as we already discussed before
>> as that is false positive.
>>
>>
>> Ray, David,
>>
>> Should we add any exception to libabigail.abignore for this?
>
> We do not tolerate any ABI warning.
> If we are sure the ABI change is false positive,
> it must be suppressed in libabigail.abignore in the same patch.
>
A new field is added to public structs, but struct size or the location of the
existing fields are not changing (struct is cache aligned).
Can you please support how this can be added to 'libabigail.abignore'?
Lijun can you please send a new version with 'libabigail.abignore' update?
Thanks,
ferruh
15/04/2021 14:45, Ferruh Yigit:
> On 4/15/2021 1:36 PM, Thomas Monjalon wrote:
> > 15/04/2021 14:33, Ferruh Yigit:
> >> On 4/15/2021 3:40 AM, Lijun Ou wrote:
> >>> Currently, upper-layer application could get queue state only
> >>> through pointers such as dev->data->tx_queue_state[queue_id],
> >>> this is not the recommended way to access it. So this patch
> >>> add get queue state when call rte_eth_rx_queue_info_get and
> >>> rte_eth_tx_queue_info_get API.
> >>>
> >>> Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
> >>> remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
> >>> it could be ABI compatible.
> >>>
> >>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> >>> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> >>
> >> Looks good to me, but it is causing an ABI error as we already discussed before
> >> as that is false positive.
> >>
> >> Ray, David,
> >>
> >> Should we add any exception to libabigail.abignore for this?
> >
> > We do not tolerate any ABI warning.
> > If we are sure the ABI change is false positive,
> > it must be suppressed in libabigail.abignore in the same patch.
>
> A new field is added to public structs, but struct size or the location of the
> existing fields are not changing (struct is cache aligned).
>
> Can you please support how this can be added to 'libabigail.abignore'?
This is how you can check the struct sizes (in 32 and 64-bit builds):
for lib in ethdev ; do for struct in rte_eth_{r,t}xq_info ; do for build in dpdk-build/build-{32b,x86-generic} ; do basename $build ; pahole -sC $struct $build/lib/librte_$lib.a ; done ; done ; done
I confirm the additions are not changing the ABI.
And because they are provided as output infos,
there is no issue like using potentially unitialized holes.
It must be explicited in libabigail with this syntax:
https://sourceware.org/libabigail/manual/libabigail-concepts.html#suppress-type
; Ignore fields inserted in alignment hole of rte_eth_rxq_info
[suppress_type]
name = rte_eth_rxq_info
has_data_member_inserted_at = offset_after(scattered_rx)
; Ignore fields inserted in cacheline boundary of rte_eth_txq_info
[suppress_type]
name = rte_eth_txq_info
has_data_member_inserted_between = {offset_after(nb_desc), end}
在 2021/4/15 20:45, Ferruh Yigit 写道:
> On 4/15/2021 1:36 PM, Thomas Monjalon wrote:
>> 15/04/2021 14:33, Ferruh Yigit:
>>> On 4/15/2021 3:40 AM, Lijun Ou wrote:
>>>> Currently, upper-layer application could get queue state only
>>>> through pointers such as dev->data->tx_queue_state[queue_id],
>>>> this is not the recommended way to access it. So this patch
>>>> add get queue state when call rte_eth_rx_queue_info_get and
>>>> rte_eth_tx_queue_info_get API.
>>>>
>>>> Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
>>>> remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
>>>> it could be ABI compatible.
>>>>
>>>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>>>> Signed-off-by: Lijun Ou <oulijun@huawei.com>
>>>
>>> Looks good to me, but it is causing an ABI error as we already
>>> discussed before
>>> as that is false positive.
>>>
>>>
>>> Ray, David,
>>>
>>> Should we add any exception to libabigail.abignore for this?
>>
>> We do not tolerate any ABI warning.
>> If we are sure the ABI change is false positive,
>> it must be suppressed in libabigail.abignore in the same patch.
>>
>
> A new field is added to public structs, but struct size or the location
> of the existing fields are not changing (struct is cache aligned).
>
> Can you please support how this can be added to 'libabigail.abignore'?
>
> Lijun can you please send a new version with 'libabigail.abignore' update?
>
Yes, I can do that. But at the moment I don't know how to update
libabigil.abinore. I don't know where to modify
Is there any relevant documentation?
> Thanks,
> ferruh
> _______________________________________________
> Linuxarm mailing list -- linuxarm@openeuler.org
> To unsubscribe send an email to linuxarm-leave@openeuler.org
On 4/16/2021 1:58 AM, oulijun wrote:
>
>
> 在 2021/4/15 20:45, Ferruh Yigit 写道:
>> On 4/15/2021 1:36 PM, Thomas Monjalon wrote:
>>> 15/04/2021 14:33, Ferruh Yigit:
>>>> On 4/15/2021 3:40 AM, Lijun Ou wrote:
>>>>> Currently, upper-layer application could get queue state only
>>>>> through pointers such as dev->data->tx_queue_state[queue_id],
>>>>> this is not the recommended way to access it. So this patch
>>>>> add get queue state when call rte_eth_rx_queue_info_get and
>>>>> rte_eth_tx_queue_info_get API.
>>>>>
>>>>> Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
>>>>> remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
>>>>> it could be ABI compatible.
>>>>>
>>>>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>>>>> Signed-off-by: Lijun Ou <oulijun@huawei.com>
>>>>
>>>> Looks good to me, but it is causing an ABI error as we already discussed before
>>>> as that is false positive.
>>>>
>>>>
>>>> Ray, David,
>>>>
>>>> Should we add any exception to libabigail.abignore for this?
>>>
>>> We do not tolerate any ABI warning.
>>> If we are sure the ABI change is false positive,
>>> it must be suppressed in libabigail.abignore in the same patch.
>>>
>>
>> A new field is added to public structs, but struct size or the location of the
>> existing fields are not changing (struct is cache aligned).
>>
>> Can you please support how this can be added to 'libabigail.abignore'?
>>
>> Lijun can you please send a new version with 'libabigail.abignore' update?
>>
> Yes, I can do that. But at the moment I don't know how to update
> libabigil.abinore. I don't know where to modify
> Is there any relevant documentation?
Please check Thomas' response, he already described what needs to be changed.
And for documentation David & Ray may know better.
@@ -251,6 +251,12 @@ ABI Changes
function was already marked as internal in the API documentation for it,
and was not for use by external applications.
+* Added new field ``queue_state`` to ``rte_eth_rxq_info`` structure
+ to provide indicated rxq queue state.
+
+* Added new field ``queue_state`` to ``rte_eth_txq_info`` structure
+ to provide indicated txq queue state.
+
Known Issues
------------
@@ -952,13 +952,6 @@ struct eth_dev_ops {
};
/**
- * RX/TX queue states
- */
-#define RTE_ETH_QUEUE_STATE_STOPPED 0
-#define RTE_ETH_QUEUE_STATE_STARTED 1
-#define RTE_ETH_QUEUE_STATE_HAIRPIN 2
-
-/**
* @internal
* Check if the selected Rx queue is hairpin queue.
*
@@ -5042,6 +5042,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
memset(qinfo, 0, sizeof(*qinfo));
dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
+ qinfo->queue_state = dev->data->rx_queue_state[queue_id];
+
return 0;
}
@@ -5082,6 +5084,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
memset(qinfo, 0, sizeof(*qinfo));
dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
+ qinfo->queue_state = dev->data->tx_queue_state[queue_id];
return 0;
}
@@ -1588,6 +1588,13 @@ struct rte_eth_dev_info {
};
/**
+ * RX/TX queue states
+ */
+#define RTE_ETH_QUEUE_STATE_STOPPED 0
+#define RTE_ETH_QUEUE_STATE_STARTED 1
+#define RTE_ETH_QUEUE_STATE_HAIRPIN 2
+
+/**
* Ethernet device RX queue information structure.
* Used to retrieve information about configured queue.
*/
@@ -1595,6 +1602,7 @@ struct rte_eth_rxq_info {
struct rte_mempool *mp; /**< mempool used by that queue. */
struct rte_eth_rxconf conf; /**< queue config parameters. */
uint8_t scattered_rx; /**< scattered packets RX supported. */
+ uint8_t queue_state; /**< one of RTE_ETH_QUEUE_STATE_*. */
uint16_t nb_desc; /**< configured number of RXDs. */
uint16_t rx_buf_size; /**< hardware receive buffer size. */
} __rte_cache_min_aligned;
@@ -1606,6 +1614,7 @@ struct rte_eth_rxq_info {
struct rte_eth_txq_info {
struct rte_eth_txconf conf; /**< queue config parameters. */
uint16_t nb_desc; /**< configured number of TXDs. */
+ uint8_t queue_state; /**< one of RTE_ETH_QUEUE_STATE_*. */
} __rte_cache_min_aligned;
/* Generic Burst mode flag definition, values can be ORed. */