On 10/22/2024 1:06 PM, Dariusz Sosnowski wrote:
> This patch adds the following internal functions for creation of
> unicast DMAC flow rules:
> 
> - mlx5_legacy_dmac_flow_create() - simple wrapper over
>   mlx5_ctrl_flow().
> - mlx5_legacy_dmac_vlan_flow_create() - simple wrapper over
>   mlx5_ctrl_flow_vlan().
> 
> These will be used as a basis for implementing dynamic
> additions of unicast DMAC or unicast DMAC with VLAN
> control flow rules when new addresses/VLANs are added.
> 
> Also, this path adds the following internal functions
> for destructions of unicast DMAC flow rules:
> 
> - mlx5_legacy_ctrl_flow_destroy() - assuming a flow rule is on the
>   control flow rule list, destroy it.
> - mlx5_legacy_dmac_flow_destroy() - find and destroy a flow rule
>   with given unicast DMAC.
> - mlx5_legacy_dmac_flow_destroy() - find and destroy a flow rule
>   with given unicast DMAC and VLAN ID.
> 
> These will be used as a basis for implementing dynamic
> removals of unicast DMAC or unicast DMAC with VLAN
> control flow rules when addresses/VLANs are removed.
> 
> At the moment, no relevant flow rules are registered on the list
> when working with Verbs or DV flow engine.
> This will be added in the follow up commit.
> 
> Signed-off-by: Dariusz Sosnowski <dsosnow...@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viachesl...@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow.c | 80 ++++++++++++++++++++++++++++++++++++
>  drivers/net/mlx5/mlx5_flow.h | 19 +++++++++
>  2 files changed, 99 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 62e3bca2f0..0d83357eb0 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -8532,6 +8532,86 @@ mlx5_ctrl_flow(struct rte_eth_dev *dev,
>       return mlx5_ctrl_flow_vlan(dev, eth_spec, eth_mask, NULL, NULL);
>  }
>  
> +int
> +mlx5_legacy_dmac_flow_create(struct rte_eth_dev *dev, const struct 
> rte_ether_addr *addr)
> +{
> +     struct rte_flow_item_eth unicast = {
> +             .hdr.dst_addr = *addr,
> +     };
> +     struct rte_flow_item_eth unicast_mask = {
> +             .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
> +     };
>

Initialization as string breaks build [3] with experimental gcc-15 [1],
please see [2].


[1]
gcc 15.0.0 "gcc (GCC) 15.0.0 20241107 (experimental)"

[2]
https://git.dpdk.org/dpdk/commit/?id=e0d947a1e6c2

[3]
../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_legacy_dmac_flow_create’:
../drivers/net/mlx5/mlx5_flow.c:8568:44: error: initializer-string for
array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
 8568 |                 .hdr.dst_addr.addr_bytes =
"\xff\xff\xff\xff\xff\xff",
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/mlx5/mlx5_flow.c: In function
‘mlx5_legacy_dmac_vlan_flow_create’:
../drivers/net/mlx5/mlx5_flow.c:8583:44: error: initializer-string for
array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
 8583 |                 .hdr.dst_addr.addr_bytes =
"\xff\xff\xff\xff\xff\xff",
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to