[PATCH v7 2/2] drivers/net: return number of types in get supported types
    Ferruh Yigit 
    ferruh.yigit at amd.com
       
    Fri Feb  2 00:02:18 CET 2024
    
    
  
On 2/1/2024 3:50 PM, Sivaramakrishnan Venkat wrote:
> Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow.
> Enhance code such that the dev_supported_ptypes_get()
> function pointer now returns  the number of elements to
> eliminate the need for "RTE_PTYPE_UNKNOWN" as the last item.
> 
This patch also updates 'buffer_split_supported_hdr_ptypes_get()'
dev_ops, for 'rte_eth_buffer_split_get_supported_hdr_ptypes()' etdev API.
This wasn't initially intendent but since API behaviour is not impacted,
I think there is no problem on extending this improvement to this
dev_ops too.
Only better to mention from it in the commit log, I will update it while
merging.
> Signed-off-by: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan at intel.com>
> 
Reviewed-by: Ferruh Yigit <ferruh.yigit at amd.com>
<...>
> @@ -411,9 +408,9 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev)
>  		copied += sizeof(ptypes_tunnel);
>  	}
>  
> -	memcpy((char *)ptypes + copied, &ptypes_end, sizeof(ptypes_end));
>  
>  	/* All Ptypes are supported in all Rx functions. */
> +	*no_of_elements = copied / sizeof(uint32_t);
>
updating as 'sizeof(ptypes[0])' while merging.
    
    
More information about the dev
mailing list