net/mlx5: check the reg available for metadata action
PATCH 1/1 net/mlx5: check the reg available for metadata action
From: Tonghao Zhang <[email protected]>
If user don't set the dv_xmeta_en to 1 or 2, in the flow_dv_convert_action_set_meta function:
* flow_dv_get_metadata_reg may return the REG_NONE, when MLX5_METADATA_FDB enabled for metadata set action.
* reg_to_field(REG_NONE) return MLX5_MODI_OUT_NONE which is invalid.
The rdma-core calltrace:dr_action_create_modify_actiondr_actions_convert_modify_headerdr_action_modify_sw_to_hwdr_action_modify_sw_to_hw_setdr_ste_get_modify_hdr_hw_field
sw_field [MLX5_MODI_OUT_NONE 4095]
should not > ste_ctx->modify_hdr_field_arr_sz [92]
As doc[1] says:
| dv_xmeta_en 0, this is default value, defines the legacy mode, | the MARK and META related actions and items operate only within | NIC Tx and NIC Rx steering domains, no MARK and META information | crosses the domain boundaries.
This patch add check for that case to warn that not supported.
[1] - http://doc.dpdk.org/guides-20.02/nics/mlx5.html
--- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/mlx5/mlx5_flow_dv.c +6 -0
@@ -1251,6 +1251,12 @@ flow_dv_convert_action_set_metaif (reg <0 )return reg; + +if (reg ==REG_NONE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ITEM , +NULL ,"unavailable " +"metadata register" );/* * In datapath code there is no endianness * coversions for perfromance reasons, all
Signature · 1 line
2.26.1
Hi, Tonghao
Thank you for the patch.
I suppose, the patch should be extended to encompass the routines:
- flow_dv_convert_action_mark
- flow_dv_convert_action_set_meta (done in the patch)
- flow_dv_validate_item_mark
- flow_dv_validate_item_mark
- flow_dv_validate_action_flag
- flow_dv_validate_action_mark
In action converting routines we should add MLX5_ASSERT() (returning REG_NONE must not happen there - the wrong conditions must be filtered out on validation stage)
One more point - it would be good to add cc:[email protected]
Would you like to extend the patch or let us do it?
With best regards,
Slava
Quoted 69 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, May 20, 2020 4:33
To: Slava Ovsiienko <[email protected]>; [email protected]
Cc: Tonghao Zhang <[email protected]>
Subject: [PATCH dpdk-dev] net/mlx5: check the reg available for metadata actionFrom: Tonghao Zhang <[email protected]>
If user don't set the
dv_xmeta_ento 1 or 2, in theflow_dv_convert_action_set_metafunction:
*flow_dv_get_metadata_regmay return theREG_NONE, whenMLX5_METADATA_FDBenabled for metadata set action.
*reg_to_field(REG_NONE)returnMLX5_MODI_OUT_NONEwhich is invalid.The rdma-core calltrace:
dr_action_create_modify_actiondr_actions_convert_modify_headerdr_action_modify_sw_to_hwdr_action_modify_sw_to_hw_setdr_ste_get_modify_hdr_hw_field
sw_field[MLX5_MODI_OUT_NONE4095]
should not >ste_ctx->modify_hdr_field_arr_sz[92]As doc[1] says:
| dv_xmeta_en 0, this is default value, defines the legacy mode, the | MARK and META related actions and items operate only within NIC Tx and | NIC Rx steering domains, no MARK and META information crosses the | domain boundaries.This patch add check for that case to warn that not supported.
[1] -
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdoc.dp
dk.org%2Fguides- 20.02%2Fnics%2Fmlx5.html&data=02%7C01%7Cviacheslavo%40mellan ox.com%7C49a86a92f7884fb4d45808d7fc5de31a%7Ca652971c7d2e4d9ba6 a4d149256f461b%7C0%7C0%7C637255352498582078&sdata=cDfb%2F oJAPNvGhMjUrjmjAE3R%2FH4wUpOI7WcZ5miTLvA%3D&reserved=0Signed-off-by Tonghao Zhang <[email protected]>--- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow_dv.cindexe4818319507c..dfcaf90eda11100644drivers/net/mlx5/mlx5_flow_dv.c +6
-1@@ -1251,6 +1251,12 @@ flow_dv_convert_action_set_metaif (reg <0 )return reg; + +if (reg ==REG_NONE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ITEM , +NULL ,"unavailable " +"metadata register" );/* * In datapath code there is no endianness * coversions for perfromance reasons, all -- 2.26.1
Quoted 12 lines · Slava Ovsiienko
Hi, Tonghao
Thank you for the patch.
I suppose, the patch should be extended to encompass the routines:
-flow_dv_convert_action_mark
-flow_dv_convert_action_set_meta(done in the patch)
-flow_dv_validate_item_mark
-flow_dv_validate_item_mark
-flow_dv_validate_action_flag
-flow_dv_validate_action_mark
Quoted 7 lines
In action converting routines we should add
MLX5_ASSERT()(returningREG_NONEmust not happen there - the wrong conditions must be filtered out on validation stage)One more point - it would be good to add cc:[email protected]
Would you like to extend the patch or let us do it?
Hi Slava, thanks for your reviews. I haven't done some research for tag/flag/mark
so you can send a patch to fix it. and I will sent v2 for metadata action. Thanks.
Quoted 59 lines
With best regards,
SlavaQuoted 56 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, May 20, 2020 4:33
To: Slava Ovsiienko <[email protected]>; [email protected]
Cc: Tonghao Zhang <[email protected]>
Subject: [PATCH dpdk-dev] net/mlx5: check the reg available for metadata actionFrom: Tonghao Zhang <[email protected]>
If user don't set the
dv_xmeta_ento 1 or 2, in theflow_dv_convert_action_set_metafunction:
*flow_dv_get_metadata_regmay return theREG_NONE, whenMLX5_METADATA_FDBenabled for metadata set action.
*reg_to_field(REG_NONE)returnMLX5_MODI_OUT_NONEwhich is invalid.The rdma-core calltrace:
dr_action_create_modify_actiondr_actions_convert_modify_headerdr_action_modify_sw_to_hwdr_action_modify_sw_to_hw_setdr_ste_get_modify_hdr_hw_field
sw_field[MLX5_MODI_OUT_NONE4095]
should not >ste_ctx->modify_hdr_field_arr_sz[92]As doc[1] says:
| dv_xmeta_en 0, this is default value, defines the legacy mode, the | MARK and META related actions and items operate only within NIC Tx and | NIC Rx steering domains, no MARK and META information crosses the | domain boundaries.This patch add check for that case to warn that not supported.
[1] -
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdoc.dp
dk.org%2Fguides- 20.02%2Fnics%2Fmlx5.html&data=02%7C01%7Cviacheslavo%40mellan ox.com%7C49a86a92f7884fb4d45808d7fc5de31a%7Ca652971c7d2e4d9ba6 a4d149256f461b%7C0%7C0%7C637255352498582078&sdata=cDfb%2F oJAPNvGhMjUrjmjAE3R%2FH4wUpOI7WcZ5miTLvA%3D&reserved=0Signed-off-by Tonghao Zhang <[email protected]>--- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow_dv.cindexe4818319507c..dfcaf90eda11100644drivers/net/mlx5/mlx5_flow_dv.c +0
-0@@ -1251,6 +1251,12 @@ flow_dv_convert_action_set_meta
Quoted 14 lines
Quoted 12 lines
drivers/net/mlx5/mlx5_flow_dv.c +6
-1if (reg <0 )return reg; + +if (reg ==REG_NONE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ITEM , +NULL ,"unavailable " +"metadata register" );/* * In datapath code there is no endianness * coversions for perfromance reasons, all -- Quoted 1 line
2.26.1
--
Best regards, Tonghao
Quoted 5 lines · Tonghao Zhang
Quoted 2 lines · Slava Ovsiienko
Hi, Tonghao
Hi maintainers,
one question, as doc said:dv_xmeta_en
2, this engages extensive metadata mode, the MARK and META related actions and items operate within all supported steering domains, including FDB, MARK and META information may cross the domain boundaries. The META item is 32 bits wide, the MARK item width depends on kernel and firmware configurations and might be 0, 16 or 24 bits. The actual supported width can be retrieved in runtime by series of rte_flow_validate() trials.
I set the metadata in fdb, and then output to vf port. In the vf port nic table, I try to match the metadata which set in fdb table, but I can't match the metadata. That is a bug ? the doc said: "META information may cross the domain boundaries."
https://doc.dpdk.org/guides/nics/mlx5.html
Quoted 97 lines
Quoted 9 lines
Thank you for the patch.
I suppose, the patch should be extended to encompass the routines:
-flow_dv_convert_action_mark
-flow_dv_convert_action_set_meta(done in the patch)
-flow_dv_validate_item_mark
-flow_dv_validate_item_mark
-flow_dv_validate_action_flag
-flow_dv_validate_action_markQuoted 7 lines
In action converting routines we should add
MLX5_ASSERT()(returningREG_NONEmust not happen there - the wrong conditions must be filtered out on validation stage)One more point - it would be good to add cc:[email protected]
Would you like to extend the patch or let us do it?
Hi Slava, thanks for your reviews. I haven't done some research for tag/flag/mark
so you can send a patch to fix it. and I will sent v2 for metadata action. Thanks.Quoted 59 lines
With best regards,
SlavaQuoted 56 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, May 20, 2020 4:33
To: Slava Ovsiienko <[email protected]>; [email protected]
Cc: Tonghao Zhang <[email protected]>
Subject: [PATCH dpdk-dev] net/mlx5: check the reg available for metadata actionFrom: Tonghao Zhang <[email protected]>
If user don't set the
dv_xmeta_ento 1 or 2, in theflow_dv_convert_action_set_metafunction:
*flow_dv_get_metadata_regmay return theREG_NONE, whenMLX5_METADATA_FDBenabled for metadata set action.
*reg_to_field(REG_NONE)returnMLX5_MODI_OUT_NONEwhich is invalid.The rdma-core calltrace:
dr_action_create_modify_actiondr_actions_convert_modify_headerdr_action_modify_sw_to_hwdr_action_modify_sw_to_hw_setdr_ste_get_modify_hdr_hw_field
sw_field[MLX5_MODI_OUT_NONE4095]
should not >ste_ctx->modify_hdr_field_arr_sz[92]As doc[1] says:
| dv_xmeta_en 0, this is default value, defines the legacy mode, the | MARK and META related actions and items operate only within NIC Tx and | NIC Rx steering domains, no MARK and META information crosses the | domain boundaries.This patch add check for that case to warn that not supported.
[1] -
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdoc.dp
dk.org%2Fguides- 20.02%2Fnics%2Fmlx5.html&data=02%7C01%7Cviacheslavo%40mellan ox.com%7C49a86a92f7884fb4d45808d7fc5de31a%7Ca652971c7d2e4d9ba6 a4d149256f461b%7C0%7C0%7C637255352498582078&sdata=cDfb%2F oJAPNvGhMjUrjmjAE3R%2FH4wUpOI7WcZ5miTLvA%3D&reserved=0Signed-off-by Tonghao Zhang <[email protected]>--- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow_dv.cindexe4818319507c..dfcaf90eda11100644drivers/net/mlx5/mlx5_flow_dv.c +0
-0@@ -1251,6 +1251,12 @@ flow_dv_convert_action_set_metaQuoted 14 lines
Quoted 12 lines
drivers/net/mlx5/mlx5_flow_dv.c +6
-1if (reg <0 )return reg; + +if (reg ==REG_NONE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ITEM , +NULL ,"unavailable " +"metadata register" );/* * In datapath code there is no endianness * coversions for perfromance reasons, all -- Quoted 1 line
2.26.1
--
Best regards, Tonghao
Signature · 1 line
Best regards, Tonghao
PATCH v2 1/1 net/mlx5: check the reg available for metadata action
In reply to [email protected]From: Tonghao Zhang <[email protected]>
If user don't set the dv_xmeta_en to 1 or 2, in the flow_dv_convert_action_set_meta function:
* flow_dv_get_metadata_reg may return the REG_NONE, when MLX5_METADATA_FDB enabled for metadata set action.
* reg_to_field(REG_NONE) return MLX5_MODI_OUT_NONE which is invalid.
The rdma-core calltrace:
dr_action_create_modify_action
dr_actions_convert_modify_header
dr_action_modify_sw_to_hw
dr_action_modify_sw_to_hw_set
dr_ste_get_modify_hdr_hw_field
sw_field [MLX5_MODI_OUT_NONE 4095]
should not > ste_ctx->modify_hdr_field_arr_sz [92]
As doc[1] says:
| dv_xmeta_en 0, this is default value, defines the legacy mode, | the MARK and META related actions and items operate only within | NIC Tx and NIC Rx steering domains, no MARK and META information | crosses the domain boundaries.
This patch add check for that case to warn that not supported.
[1] - http://doc.dpdk.org/guides-20.02/nics/mlx5.html
--- drivers/net/mlx5/mlx5_flow_dv.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
drivers/net/mlx5/mlx5_flow_dv.c +19 -12
@@ -1251,6 +1251,7 @@ flow_dv_convert_action_set_metaif (reg <0 )return reg; +MLX5_ASSERT (reg !=REG_NONE );/* * In datapath code there is no endianness * coversions for perfromance reasons, all
@@ -1449,7 +1450,6 @@ flow_dv_validate_item_meta(struct rte_eth_dev *dev __rte_unused, struct rte_flow_error *error) {struct mlx5_priv *priv = dev->data->dev_private; -struct mlx5_dev_config *config = &priv->config;const struct rte_flow_item_meta *spec = item->spec;const struct rte_flow_item_meta *mask = item->mask;struct rte_flow_item_meta nic_mask = {
@@ -1463,23 +1463,25 @@ flow_dv_validate_item_meta(struct rte_eth_dev *dev __rte_unused,RTE_FLOW_ERROR_TYPE_ITEM_SPEC , item->spec, "data cannot be empty"); -if (config->dv_xmeta_en !=MLX5_XMETA_MODE_LEGACY ) { -if (!mlx5_flow_ext_mreg_supported (dev)) -return rte_flow_error_set (error,ENOTSUP , +if (!mlx5_flow_ext_mreg_supported (dev)) +return rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_ITEM , item,"extended metadata register" " isn't supported" ); - reg =flow_dv_get_metadata_reg (dev, attr, error); -if (reg <0 ) -return reg; -if (reg ==REG_B ) -return rte_flow_error_set (error,ENOTSUP , + reg =flow_dv_get_metadata_reg (dev, attr, error); +if (reg <0 ) +return reg; +if (reg ==REG_NONE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ITEM , item, +"unavailable metadata register" ); +if (reg ==REG_B ) +return rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_ITEM , item,"match on reg_b " "isn't supported" ); -if (reg !=REG_A ) - nic_mask.data = priv->sh->dv_meta_mask; - } +if (reg !=REG_A ) + nic_mask.data = priv->sh->dv_meta_mask;if (!mask) mask = &rte_flow_item_meta_mask;if (!mask->data)
@@ -2244,6 +2246,11 @@ flow_dv_validate_action_set_meta(struct rte_eth_dev *dev, reg =flow_dv_get_metadata_reg (dev, attr, error);if (reg <0 )return reg; +if (reg ==REG_NONE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , + action,"unavailable " +"metadata register" );if (reg !=REG_A && reg !=REG_B ) {struct mlx5_priv *priv = dev->data->dev_private;
Signature · 1 line
2.26.1
Hi, Tonghao
Thank you for the patch, and a lot of my apologizes - I mixed up your patch with other fix and thought we did not need it. Now I reviwed it again - we fixed flow_dv_validate_item_meta() (in other way - with explicit register check) but flow_dv_validate_action_set_meta() still needs the fix. Would you like to rebase your patch and send v3 or prefer to let us do it?
With best regards, Slava
Quoted 129 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Sunday, May 24, 2020 14:07
To: Slava Ovsiienko <[email protected]>
Cc: [email protected]; Tonghao Zhang <[email protected]>; [email protected]
Subject: [PATCH dpdk-dev v2] net/mlx5: check the reg available for metadata actionFrom: Tonghao Zhang <[email protected]>
If user don't set the
dv_xmeta_ento 1 or 2, in theflow_dv_convert_action_set_metafunction:
*flow_dv_get_metadata_regmay return theREG_NONE, whenMLX5_METADATA_FDBenabled for metadata set action.
*reg_to_field(REG_NONE)returnMLX5_MODI_OUT_NONEwhich is invalid.The rdma-core calltrace:
dr_action_create_modify_action
dr_actions_convert_modify_header
dr_action_modify_sw_to_hw
dr_action_modify_sw_to_hw_set
dr_ste_get_modify_hdr_hw_field
sw_field[MLX5_MODI_OUT_NONE4095]
should not >ste_ctx->modify_hdr_field_arr_sz[92]As doc[1] says:
| dv_xmeta_en 0, this is default value, defines the legacy mode, the | MARK and META related actions and items operate only within NIC Tx and | NIC Rx steering domains, no MARK and META information crosses the | domain boundaries.This patch add check for that case to warn that not supported.
[1] -
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdoc.dp
dk.org%2Fguides- 20.02%2Fnics%2Fmlx5.html&data=02%7C01%7Cviacheslavo%40mellan ox.com%7Ce55c7bccccd14490af4208d7ffd29c78%7Ca652971c7d2e4d9ba6a 4d149256f461b%7C0%7C0%7C637259152350270223&sdata=PiDsa8dD 4bJrGL2FGHWUOybIAMD5pxq8p5vxmtlS9lc%3D&reserved=0Fixes fcc8d2f716fd ("net/mlx5: extend flow metadata support")Signed-off-by Tonghao Zhang <[email protected]>--- drivers/net/mlx5/mlx5_flow_dv.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow_dv.cindexe4818319507c..c77835270d60100644drivers/net/mlx5/mlx5_flow_dv.c +1
-0@@ -1251,6 +1251,7 @@ flow_dv_convert_action_set_metaif (reg <0 )return reg; +MLX5_ASSERT (reg !=REG_NONE );/* * In datapath code there is no endianness * coversions for perfromance reasons, all @@ -1449,7 +1450,6 @@ flow_dv_validate_item_meta(struct
rte_eth_dev*dev__rte_unused,drivers/net/mlx5/mlx5_flow_dv.c +0
-1struct rte_flow_error *error) {struct mlx5_priv *priv = dev->data->dev_private; -struct mlx5_dev_config *config = &priv->config;const struct rte_flow_item_meta *spec = item->spec;const struct rte_flow_item_meta *mask = item->mask; struct rte_flow_item_meta nic_mask = { @@ -1463,23 +1463,25@@ flow_dv_validate_item_meta(struct
rte_eth_dev*dev__rte_unused,
RTE_FLOW_ERROR_TYPE_ITEM_SPEC,drivers/net/mlx5/mlx5_flow_dv.c +2
-3item->spec, "data cannot be empty"); -if (config->dv_xmeta_en !=MLX5_XMETA_MODE_LEGACY ) { -if (!mlx5_flow_ext_mreg_supported (dev)) - return rte_flow_error_set(error, ENOTSUP, +if (!mlx5_flow_ext_mreg_supported (dev)) + return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM,item,
drivers/net/mlx5/mlx5_flow_dv.c +6
-5"extended metadata register" " isn't supported"); - reg =flow_dv_get_metadata_reg (dev, attr, error); -if (reg <0 ) -return reg; -if (reg ==REG_B ) - return rte_flow_error_set(error, ENOTSUP, + reg =flow_dv_get_metadata_reg (dev, attr, error); +if (reg <0 ) +return reg; +if (reg ==REG_NONE ) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM,item,
drivers/net/mlx5/mlx5_flow_dv.c +3
-0+ "unavailable metadata register"); +if (reg ==REG_B ) + return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM,item,
drivers/net/mlx5/mlx5_flow_dv.c +7
-4"match on reg_b " "isn't supported"); -if (reg !=REG_A ) - nic_mask.data = priv->sh->dv_meta_mask; - } +if (reg !=REG_A ) + nic_mask.data = priv->sh->dv_meta_mask;if (!mask) mask = &rte_flow_item_meta_mask;if (!mask->data)@@ -2244,6 +2246,11 @@ flow_dv_validate_action_set_meta(structrte_eth_dev *dev, reg =flow_dv_get_metadata_reg (dev, attr, error);if (reg <0 )return reg; +if (reg ==REG_NONE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , + action,"unavailable " +"metadata register" );if (reg !=REG_A && reg !=REG_B ) {struct mlx5_priv *priv = dev->data->dev_private; --2.26.1
PATCH v3 1/1 net/mlx5: check the reg available for metadata action
In reply to [email protected]From: Tonghao Zhang <[email protected]>
If user don't set the dv_xmeta_en to 1 or 2,
in the flow_dv_convert_action_set_meta function:
- flow_dv_get_metadata_reg may return the REG_NONE, when MLX5_METADATA_FDB enabled for metadata set action.
- reg_to_field(REG_NONE) returns MLX5_MODI_OUT_NONE, that is invalid and rdma-core fails.
The rdma-core calltrace:
dr_action_create_modify_action
dr_actions_convert_modify_header
dr_action_modify_sw_to_hw
dr_action_modify_sw_to_hw_set
dr_ste_get_modify_hdr_hw_field
--- drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/mlx5/mlx5_flow_dv.c +10 -0
@@ -1217,6 +1217,7 @@ struct field_modify_info modify_tcp[] = {if (reg <0 )return reg; +MLX5_ASSERT (reg !=REG_NON );/* * In datapath code there is no endianness * coversions for perfromance reasons, all
@@ -1438,6 +1439,10 @@ struct field_modify_info modify_tcp[] = { reg =flow_dv_get_metadata_reg (dev, attr, error);if (reg <0 )return reg; +if (reg ==REG_NON ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ITEM , item, +"unavalable extended metadata register" );if (reg ==REG_B ) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item,
@@ -2446,6 +2451,10 @@ struct field_modify_info modify_tcp[] = { reg =flow_dv_get_metadata_reg (dev, attr, error);if (reg <0 )return reg; +if (reg ==REG_NON ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , action, +"unavalable extended metadata register" );if (reg !=REG_A && reg !=REG_B ) {struct mlx5_priv *priv = dev->data->dev_private;
@@ -7471,6 +7480,7 @@ struct mlx5_hlist_entry * reg =flow_dv_get_metadata_reg (dev, attr,NULL );if (reg <0 )return ; +MLX5_ASSERT (reg !=REG_NON );/* * In datapath code there is no endianness * coversions for perfromance reasons, all
Signature · 1 line
1.8.3.1
Hi,
Quoted 28 lines
-----Original Message-----
From: Viacheslav Ovsiienko <[email protected]>
Sent: Friday, November 20, 2020 4:48 PM
To: [email protected]
Cc: Raslan Darawsheh <[email protected]>; Matan Azrad <[email protected]>; Ori Kam <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]; [email protected]
Subject: [PATCH v3] net/mlx5: check the reg available for metadata actionFrom: Tonghao Zhang <[email protected]>
If user don't set the
dv_xmeta_ento 1 or 2,
in theflow_dv_convert_action_set_metafunction:-
flow_dv_get_metadata_regmay return theREG_NONE, whenMLX5_METADATA_FDBenabled for metadata set action.-
reg_to_field(REG_NONE)returnsMLX5_MODI_OUT_NONE, that is invalid and rdma-core fails.The rdma-core calltrace:
dr_action_create_modify_action
dr_actions_convert_modify_header
dr_action_modify_sw_to_hw
dr_action_modify_sw_to_hw_set
dr_ste_get_modify_hdr_hw_field
Quoted 6 lines
Fixes fcc8d2f716fd ("net/mlx5: extend flow metadata support")Signed-off-by Tonghao Zhang <[email protected]>Signed-off-by Viacheslav Ovsiienko <[email protected]>---
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh