devtools/cocci: update cocci for ethdev namespace

Message ID 20211208114518.3892599-1-aman.deep.singh@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series devtools/cocci: update cocci for ethdev namespace |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Singh, Aman Deep Dec. 8, 2021, 11:45 a.m. UTC
  Added two specific execptions for ETH_SPEED_10G
and ETH_SPEED_25G to avoid there name change.

Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
---
 devtools/cocci/namespace_ethdev.cocci | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit Dec. 10, 2021, 1:18 p.m. UTC | #1
On 12/8/2021 11:45 AM, Aman Singh wrote:
> Added two specific execptions for ETH_SPEED_10G
> and ETH_SPEED_25G to avoid there name change.
> 
> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> ---
>   devtools/cocci/namespace_ethdev.cocci | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/cocci/namespace_ethdev.cocci b/devtools/cocci/namespace_ethdev.cocci
> index d5de41e117..3afa1fb386 100644
> --- a/devtools/cocci/namespace_ethdev.cocci
> +++ b/devtools/cocci/namespace_ethdev.cocci
> @@ -16,7 +16,8 @@ exception_matches = ["ETH_VLAN_FILTER_CLASSIFY","ETH_VLAN_FILTER_ANY",
>   "RTE_FDIR_NO","RTE_FDIR_REPORT","ETH_MAX_RX_CLIENTS_E1H",
>   "ETH_MAX_AGGREGATION_QUEUES_E1","ETH_RSS_ENGINE_NUM","ETH_NUM_MAC_FILTERS",
>   "ETH_MAX_NUM_RX_QUEUES_PER_VF_QUAD","ETH_RSS_IND_TABLE_ENTRIES_NUM",
> -"ETH_RSS_KEY_SIZE_REGS","ETH_NUM_STATISTIC_COUNTERS","ETH_SPEED_"]
> +"ETH_RSS_KEY_SIZE_REGS","ETH_NUM_STATISTIC_COUNTERS","ETH_SPEED_10G",
> +"ETH_SPEED_25G"]
>   
>   if any(x in I for x in exception_matches):
>           coccinelle .J= I;
> 

Thanks Aman,

I confirm 'ETH_SPEED_NUM_*' issue is resolved.


There are a few more quirks, can you please check if they are fixable,
if so they can be in v2 of this patch:

1) 'ETH_TUNNEL_FILTER_' ones seems not updated, like:
ETH_TUNNEL_FILTER_OMAC -> RTE_ETH_TUNNEL_FILTER_OMAC
ETH_TUNNEL_FILTER_OIP  -> RTE_ETH_TUNNEL_FILTER_OIP

But need to be careful some of the already has RTE_ prefix, like:
RTE_TUNNEL_FILTER_IMAC_IVLAN
RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID
...


2) Script seems not updating the ones with macro defines with line
continuation, there are a few different instance of them, if it is
easy we can update script, else they can be ignored. Samples:

drivers/net/ice/ice_ethdev.c:
        #define ICE_RSS_HF_ALL ( \
                ETH_RSS_IPV4 | \
                ETH_RSS_IPV6 | \
                ETH_RSS_NONFRAG_IPV4_UDP | \
                ETH_RSS_NONFRAG_IPV6_UDP | \
                ETH_RSS_NONFRAG_IPV4_TCP | \
                ETH_RSS_NONFRAG_IPV6_TCP | \
                ETH_RSS_NONFRAG_IPV4_SCTP | \
                ETH_RSS_NONFRAG_IPV6_SCTP | \
                ETH_RSS_FRAG_IPV4 | \
                ETH_RSS_FRAG_IPV6)

drivers/net/hns3/hns3_rxtx.c:
        #define HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK (\
                        DEV_TX_OFFLOAD_IPV4_CKSUM | \
                        DEV_TX_OFFLOAD_TCP_CKSUM | \
                        DEV_TX_OFFLOAD_UDP_CKSUM | \
                        DEV_TX_OFFLOAD_SCTP_CKSUM | \
                        DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \
                        DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \
                        DEV_TX_OFFLOAD_TCP_TSO | \
                        DEV_TX_OFFLOAD_VXLAN_TNL_TSO | \
                        DEV_TX_OFFLOAD_GRE_TNL_TSO | \
                        DEV_TX_OFFLOAD_GENEVE_TNL_TSO)


3) in bonding (eth_bond_private.h),
RTE_RETA_GROUP_SIZE & ETH_RSS_RETA_SIZE_512 seems not updated,
bonding on its own doesn't matter much, but may be good to investigate
why it is not updated, what is missed.


4) Similarly, in 'mlx5/mlx5_rxq.c', ETH_MQ_RX_RSS seems not updated,
not much matter on its own, but may be good to investigate


5) This is optional but script updates old 'ETH_MIRROR_*' too, but
those macros are removed from latest upstream, so may be excluded.
  
Singh, Aman Deep Jan. 23, 2022, 5:28 p.m. UTC | #2
On 12/10/2021 6:48 PM, Ferruh Yigit wrote:
> On 12/8/2021 11:45 AM, Aman Singh wrote:
>> Added two specific execptions for ETH_SPEED_10G
>> and ETH_SPEED_25G to avoid there name change.
>>
>> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
>> ---
>>   devtools/cocci/namespace_ethdev.cocci | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/devtools/cocci/namespace_ethdev.cocci 
>> b/devtools/cocci/namespace_ethdev.cocci
>> index d5de41e117..3afa1fb386 100644
>> --- a/devtools/cocci/namespace_ethdev.cocci
>> +++ b/devtools/cocci/namespace_ethdev.cocci
>> @@ -16,7 +16,8 @@ exception_matches = 
>> ["ETH_VLAN_FILTER_CLASSIFY","ETH_VLAN_FILTER_ANY",
>>   "RTE_FDIR_NO","RTE_FDIR_REPORT","ETH_MAX_RX_CLIENTS_E1H",
>> "ETH_MAX_AGGREGATION_QUEUES_E1","ETH_RSS_ENGINE_NUM","ETH_NUM_MAC_FILTERS",
>> "ETH_MAX_NUM_RX_QUEUES_PER_VF_QUAD","ETH_RSS_IND_TABLE_ENTRIES_NUM",
>> -"ETH_RSS_KEY_SIZE_REGS","ETH_NUM_STATISTIC_COUNTERS","ETH_SPEED_"]
>> +"ETH_RSS_KEY_SIZE_REGS","ETH_NUM_STATISTIC_COUNTERS","ETH_SPEED_10G",
>> +"ETH_SPEED_25G"]
>>     if any(x in I for x in exception_matches):
>>           coccinelle .J= I;
>>
>
> Thanks Aman,
>
> I confirm 'ETH_SPEED_NUM_*' issue is resolved.
>
>
> There are a few more quirks, can you please check if they are fixable,
> if so they can be in v2 of this patch:
>
> 1) 'ETH_TUNNEL_FILTER_' ones seems not updated, like:
> ETH_TUNNEL_FILTER_OMAC -> RTE_ETH_TUNNEL_FILTER_OMAC
> ETH_TUNNEL_FILTER_OIP  -> RTE_ETH_TUNNEL_FILTER_OIP
>
> But need to be careful some of the already has RTE_ prefix, like:
> RTE_TUNNEL_FILTER_IMAC_IVLAN
> RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID
> ...
>
Will add 'ETH_TUNNEL_FILTER_' in V2
>
> 2) Script seems not updating the ones with macro defines with line
> continuation, there are a few different instance of them, if it is
> easy we can update script, else they can be ignored. Samples:
>
> drivers/net/ice/ice_ethdev.c:
>        #define ICE_RSS_HF_ALL ( \
>                ETH_RSS_IPV4 | \
>                ETH_RSS_IPV6 | \
>                ETH_RSS_NONFRAG_IPV4_UDP | \
>                ETH_RSS_NONFRAG_IPV6_UDP | \
>                ETH_RSS_NONFRAG_IPV4_TCP | \
>                ETH_RSS_NONFRAG_IPV6_TCP | \
>                ETH_RSS_NONFRAG_IPV4_SCTP | \
>                ETH_RSS_NONFRAG_IPV6_SCTP | \
>                ETH_RSS_FRAG_IPV4 | \
>                ETH_RSS_FRAG_IPV6)
>
> drivers/net/hns3/hns3_rxtx.c:
>        #define HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK (\
>                        DEV_TX_OFFLOAD_IPV4_CKSUM | \
>                        DEV_TX_OFFLOAD_TCP_CKSUM | \
>                        DEV_TX_OFFLOAD_UDP_CKSUM | \
>                        DEV_TX_OFFLOAD_SCTP_CKSUM | \
>                        DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \
>                        DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \
>                        DEV_TX_OFFLOAD_TCP_TSO | \
>                        DEV_TX_OFFLOAD_VXLAN_TNL_TSO | \
>                        DEV_TX_OFFLOAD_GRE_TNL_TSO | \
>                        DEV_TX_OFFLOAD_GENEVE_TNL_TSO)
>
These are '# defines' so script will not modify these.
As no rule present for these.
>
> 3) in bonding (eth_bond_private.h),
> RTE_RETA_GROUP_SIZE & ETH_RSS_RETA_SIZE_512 seems not updated,
> bonding on its own doesn't matter much, but may be good to investigate
> why it is not updated, what is missed.
>
Will add 'ETH_RSS_RETA_SIZE' in v2. For RTE_RETA_GROUP_SIZEI saw only
one #define instance.
>
> 4) Similarly, in 'mlx5/mlx5_rxq.c', ETH_MQ_RX_RSS seems not updated,
> not much matter on its own, but may be good to investigate
ETH_MQ_ is there in search pattern. Will check.
>
>
> 5) This is optional but script updates old 'ETH_MIRROR_*' too, but
> those macros are removed from latest upstream, so may be excluded.
Removed 'ETH_MIRROR_' in v2
  

Patch

diff --git a/devtools/cocci/namespace_ethdev.cocci b/devtools/cocci/namespace_ethdev.cocci
index d5de41e117..3afa1fb386 100644
--- a/devtools/cocci/namespace_ethdev.cocci
+++ b/devtools/cocci/namespace_ethdev.cocci
@@ -16,7 +16,8 @@  exception_matches = ["ETH_VLAN_FILTER_CLASSIFY","ETH_VLAN_FILTER_ANY",
 "RTE_FDIR_NO","RTE_FDIR_REPORT","ETH_MAX_RX_CLIENTS_E1H",
 "ETH_MAX_AGGREGATION_QUEUES_E1","ETH_RSS_ENGINE_NUM","ETH_NUM_MAC_FILTERS",
 "ETH_MAX_NUM_RX_QUEUES_PER_VF_QUAD","ETH_RSS_IND_TABLE_ENTRIES_NUM",
-"ETH_RSS_KEY_SIZE_REGS","ETH_NUM_STATISTIC_COUNTERS","ETH_SPEED_"]
+"ETH_RSS_KEY_SIZE_REGS","ETH_NUM_STATISTIC_COUNTERS","ETH_SPEED_10G",
+"ETH_SPEED_25G"]
 
 if any(x in I for x in exception_matches):
         coccinelle .J= I;