[RESEND,v7,1/3] ring: fix unmatched type definition and usage
Checks
Commit Message
Field 'flags' of struct rte_ring is defined as int type. However,
it is used as unsigned int. To ensure consistency, change the
type of flags to unsigned int. Since these two types has the
same byte size, this change is not an ABI change.
Fixes: af75078fece3 ("first public release")
Signed-off-by: Jie Hai <haijie1@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
lib/ring/rte_ring_core.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Acked-by: Huisong Li <lihuisong@huawei.com>
在 2023/11/9 18:20, Jie Hai 写道:
> Field 'flags' of struct rte_ring is defined as int type. However,
> it is used as unsigned int. To ensure consistency, change the
> type of flags to unsigned int. Since these two types has the
> same byte size, this change is not an ABI change.
>
> Fixes: af75078fece3 ("first public release")
>
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> ---
> lib/ring/rte_ring_core.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/ring/rte_ring_core.h b/lib/ring/rte_ring_core.h
> index b7708730658a..14dac6495d83 100644
> --- a/lib/ring/rte_ring_core.h
> +++ b/lib/ring/rte_ring_core.h
> @@ -119,7 +119,7 @@ struct rte_ring_hts_headtail {
> struct rte_ring {
> char name[RTE_RING_NAMESIZE] __rte_cache_aligned;
> /**< Name of the ring. */
> - int flags; /**< Flags supplied at creation. */
> + uint32_t flags; /**< Flags supplied at creation. */
> const struct rte_memzone *memzone;
> /**< Memzone, if any, containing the rte_ring */
> uint32_t size; /**< Size of ring. */
09/11/2023 11:20, Jie Hai:
> Field 'flags' of struct rte_ring is defined as int type. However,
> it is used as unsigned int. To ensure consistency, change the
> type of flags to unsigned int. Since these two types has the
> same byte size, this change is not an ABI change.
>
> Fixes: af75078fece3 ("first public release")
>
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> ---
> lib/ring/rte_ring_core.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/ring/rte_ring_core.h b/lib/ring/rte_ring_core.h
> index b7708730658a..14dac6495d83 100644
> --- a/lib/ring/rte_ring_core.h
> +++ b/lib/ring/rte_ring_core.h
> @@ -119,7 +119,7 @@ struct rte_ring_hts_headtail {
> struct rte_ring {
> char name[RTE_RING_NAMESIZE] __rte_cache_aligned;
> /**< Name of the ring. */
> - int flags; /**< Flags supplied at creation. */
> + uint32_t flags; /**< Flags supplied at creation. */
This triggers a warning in our ABI checker:
in pointed to type 'struct rte_ring' at rte_ring_core.h:119:1:
type size hasn't changed
1 data member change:
type of 'int flags' changed:
entity changed from 'int' to compatible type 'typedef uint32_t' at stdint-uintn.h:26:1
type name changed from 'int' to 'unsigned int'
type size hasn't changed
I guess we were supposed to merge this in 23.11, sorry about this.
How can we proceed?
On 2024/2/19 2:11, Thomas Monjalon wrote:
> 09/11/2023 11:20, Jie Hai:
>> Field 'flags' of struct rte_ring is defined as int type. However,
>> it is used as unsigned int. To ensure consistency, change the
>> type of flags to unsigned int. Since these two types has the
>> same byte size, this change is not an ABI change.
>>
>> Fixes: af75078fece3 ("first public release")
>>
>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>> Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
>> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>> Acked-by: Morten Brørup <mb@smartsharesystems.com>
>> ---
>> lib/ring/rte_ring_core.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/ring/rte_ring_core.h b/lib/ring/rte_ring_core.h
>> index b7708730658a..14dac6495d83 100644
>> --- a/lib/ring/rte_ring_core.h
>> +++ b/lib/ring/rte_ring_core.h
>> @@ -119,7 +119,7 @@ struct rte_ring_hts_headtail {
>> struct rte_ring {
>> char name[RTE_RING_NAMESIZE] __rte_cache_aligned;
>> /**< Name of the ring. */
>> - int flags; /**< Flags supplied at creation. */
>> + uint32_t flags; /**< Flags supplied at creation. */
>
> This triggers a warning in our ABI checker:
>
> in pointed to type 'struct rte_ring' at rte_ring_core.h:119:1:
> type size hasn't changed
> 1 data member change:
> type of 'int flags' changed:
> entity changed from 'int' to compatible type 'typedef uint32_t' at stdint-uintn.h:26:1
> type name changed from 'int' to 'unsigned int'
> type size hasn't changed
>
> I guess we were supposed to merge this in 23.11, sorry about this.
>
> How can we proceed?
>
How about we drop this amendment (patch 1/3) for now?
>
> .
@@ -119,7 +119,7 @@ struct rte_ring_hts_headtail {
struct rte_ring {
char name[RTE_RING_NAMESIZE] __rte_cache_aligned;
/**< Name of the ring. */
- int flags; /**< Flags supplied at creation. */
+ uint32_t flags; /**< Flags supplied at creation. */
const struct rte_memzone *memzone;
/**< Memzone, if any, containing the rte_ring */
uint32_t size; /**< Size of ring. */