[PATCH v3] net/mlx5: fix potential memory leak in meter

2024-10-22 Thread Shun Hao
When meter not enabled, avoid allocate memory for meter profile table, which will not be freed in close process when meter not enabled Fixes: a295c69a8b24 ("net/mlx5: optimize meter profile lookup") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Bing Zhao --- drivers/net/

[PATCH v2] net/mlx5: fix potential memory leak in meter

2024-10-14 Thread Shun Hao
When meter not enabled, avoid allocate memory for meter profile table, which will not be freed in close process when meter not enabled Fixes: a295c69a8b24 ("net/mlx5: optimize meter profile lookup") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Bing Zhao --- drivers/net/

[PATCH] net/mlx5: fix potential memory leak in meter

2024-10-12 Thread Shun Hao
When meter not enabled, avoid allocate memory for meter profile table, which will not be freed in close process when meter not enabled Fixes: a295c69a8b24 ("net/mlx5: optimize meter profile lookup") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Bing Zhao --- drivers/net/

[PATCH] net/mlx5: support jump in meter hierarchy

2024-06-03 Thread Shun Hao
Currently in meter hierarchy, only meter action is supported for green and yellow policy flow. This patch adds support of jump action for green or yellow policy flow. Fixes: 96ca87da4f46 ("net/mlx5: validate yellow meter action") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by

[PATCH] net/mlx5: support jump in meter hierarchy

2024-06-03 Thread Shun Hao
Currently in meter hierarhcy, only meter action is supported for green and yellow policy flow. This patch adds support of jump action for green or yellow policy flow. Fixes: 96ca87da4f46 ("net/mlx5: validate yellow meter action") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by

[PATCH] net/mlx5: support HW flag action

2024-05-28 Thread Shun Hao
The HW flag action is supported by adding the tag to packet, with the default tag value. Signed-off-by: Shun Hao Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_hw.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5

[PATCH] net/mlx5: support HW flag action

2024-05-28 Thread Shun Hao
The HW flag action is supported by adding the tag to packet, with the default tag value. Signed-off-by: Shun Hao Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_hw.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5

[PATCH] net/mlx5: set correct priority for meter policy

2024-03-01 Thread Shun Hao
hops. This patch fixes this by giving the same priority to flows for all colors. Fixes: 363db9b00f ("net/mlx5: handle yellow case in default meter policy") CC: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Bing Zhao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5

[PATCH v2] net/mlx5: set correct priority for meter policy

2024-02-29 Thread Shun Hao
hops. This patch fixes this by giving the same priority to flows for all colors. Fixes: 363db9b00f ("net/mlx5: handle yellow case in default meter policy") CC: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Bing Zhao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5

[PATCH v1] net/mlx5: set correct priority for meter policy

2024-02-29 Thread Shun Hao
hops. This patch fixes this by giving the the same priority to flows for all colors. Fixes: 363db9b00f ("net/mlx5: handle yellow case in default meter policy") CC: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Bing Zhao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5

[PATCH v1 3/3] net/mlx5/hws: add support for mirroring

2023-09-28 Thread Shun Hao
This patch supports mirroring by adding an dest_array action. The action accecpts a list containing multiple destination actions, and can duplicate packet and forward to each destination in the list. Signed-off-by: Shun Hao Acked-by: Alex Vesker --- drivers/common/mlx5/mlx5_prm.h | 23

[PATCH v1 2/3] net/mlx5/hws: add mlx5dr obj struct to mlx5dr action

2023-09-28 Thread Shun Hao
From: Hamdan Igbaria Add mlx5dr_devx_obj struct to mlx5dr_action, so we could hold the FT obj in dest table action. Signed-off-by: Hamdan Igbaria Acked-by: Alex Vesker --- drivers/net/mlx5/hws/mlx5dr_action.c | 2 ++ drivers/net/mlx5/hws/mlx5dr_action.h | 3 +++ drivers/net/mlx5/hws/mlx5dr_ta

[PATCH v1 1/3] net/mlx5/hws: add creation of packet reformat DevX obj

2023-09-28 Thread Shun Hao
From: Hamdan Igbaria Add support for creation of packet reformat object, via the ALLOC_PACKET_REFORMAT_CONTEXT command. Signed-off-by: Hamdan Igbaria Acked-by: Alex Vesker --- drivers/common/mlx5/mlx5_prm.h | 39 + drivers/net/mlx5/hws/mlx5dr_cmd.c | 60 ++

[PATCH v1 0/3] Add HWS mirroring support

2023-09-28 Thread Shun Hao
. Hamdan Igbaria (2): net/mlx5/hws: add creation of packet reformat DevX obj net/mlx5/hws: add mlx5dr obj struct to mlx5dr action Shun Hao (1): net/mlx5/hws: add support for mirroring drivers/common/mlx5/mlx5_prm.h | 62 +++- drivers/net/mlx5/hws/mlx5dr.h | 34

[PATCH] net/mlx5: fix drop action validation

2022-11-09 Thread Shun Hao
") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.h| 3 +++ drivers/net/mlx5/mlx5_flow_dv.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 187e9a2

[PATCH] net/mlx5: fix assert when creating meter policy

2022-11-08 Thread Shun Hao
ssert failure. This patch adds initialization of thread-local workspace when creating meter policy rules to avoid that assert. Fixes: 65c86202 ("net/mlx5: fix flow source port checking in sample flow rule") CC: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- d

[PATCH v1 2/2] net/mlx5: fix meter policy with port ID destination

2022-11-08 Thread Shun Hao
dynamically, but then the meter cannot be used by a flow that matches all the ports. Fixes: 48fbc1be ("net/mlx5: fix meter policy flow match item") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.h | 2 - drivers/net/mlx5/mlx5_flow_

[PATCH v1 1/2] net/mlx5: fix meter hierarchy with modify header

2022-11-08 Thread Shun Hao
;) Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- doc/guides/nics/mlx5.rst| 3 +++ drivers/net/mlx5/mlx5.h | 6 -- drivers/net/mlx5/mlx5_flow.c| 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 35 ++--- 4 files changed, 31 inserti

[PATCH v1 0/2] Fix src port match in meter hierarchy

2022-11-08 Thread Shun Hao
src port from user flow dynamically to match different src port, so the meter hierarchy can always be used by different src ports. Shun Hao (2): net/mlx5: fix meter hierarchy with modify header net/mlx5: fix meter policy with port ID destination doc/guides/nics/mlx5.rst| 3 + drivers

[PATCH v1] net/mlx5: fix representor item and meter

2022-11-08 Thread Shun Hao
;) Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c| 50 - drivers/net/mlx5/mlx5_flow_dv.c | 6 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/driver

[PATCH v1] net/mlx5: fix incorrect match mask for meter flow

2022-11-03 Thread Shun Hao
em matcher and value translation") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 7b904ee

[PATCH v1] net/mlx5: fix action flag data type

2022-11-01 Thread Shun Hao
f3ff ("net/mlx5: support yellow in meter policy validation") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.h | 56 ++-- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/net/mlx5

[PATCH v1] net/mlx5: fix meter profile delete fail

2022-09-17 Thread Shun Hao
meter profile update") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_meter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c index 7c0d84907a

[PATCH v1 3/3] net/mlx5: fix meter ID tag for meter hierarchy

2022-09-16 Thread Shun Hao
er doesn't have drop count, no need to add the meter id tag action. No change for non-hierarchy meter. Fixes: e8146c63 ("net/mlx5: support represented port item in flow rules") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 6 +

[PATCH v1 1/3] net/mlx5: fix meter hierarchy with represented port item

2022-09-16 Thread Shun Hao
item in flow rules") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c| 10 +++--- drivers/net/mlx5/mlx5_flow.h| 3 +++ drivers/net/mlx5/mlx5_flow_dv.c | 20 3 files changed, 26 insertions(+), 7 deletions(-)

[PATCH v1 2/3] net/mlx5: add meter flow limitation when matching all ports

2022-09-16 Thread Shun Hao
drop count. Fixes: e8146c63 ("net/mlx5: support represented port item in flow rules") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- doc/guides/nics/mlx5.rst| 1 + drivers/net/mlx5/mlx5.h | 2 ++ drivers/net/mlx5/mlx5_flow.c| 11 ++- drivers/

[PATCH v1 0/3] Fix meter hierarchy issue for represented port

2022-09-16 Thread Shun Hao
pport represented port. And there're some limitation for the support that when matching all ports, the meter hierarchy should not contain any meter having drop count. Shun Hao (3): net/mlx5: fix meter hierarchy with represented port item net/mlx5: add meter flow limitation when matching

[PATCH v1 2/2] net/mlx5: fix meter fail when used on E-Switch Manager

2022-06-18 Thread Shun Hao
When meter is used by E-Switch Manager port, there's an error that cannot get correct port ID. This patch fixes this by using specific parsing process to get port ID for E-Switch Manager. Fixes: 3c481324baf3 ("net/mlx5: fix meter flow direction check") Cc: sta...@dpdk.org Sign

[PATCH v1 1/2] net/mlx5: add limitation for E-Switch Manager match

2022-06-18 Thread Shun Hao
") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azard --- doc/guides/nics/mlx5.rst| 4 drivers/net/mlx5/mlx5_flow.h| 4 drivers/net/mlx5/mlx5_flow_dv.c | 10 -- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/

[PATCH v1 0/2] Fix meter flow fail when matching E-Switch Manager

2022-06-18 Thread Shun Hao
When using a meter in flow that matches E-Switch Manager, it will fail due to not handling E-Switch Manager match item correctly. This series fix this by using correct handling of parsing E-Switch Manager item. Shun Hao (2): net/mlx5: add limitation for E-Switch Manager match net/mlx5: fix

[PATCH v1 4/4] net/mlx5: add validation for yellow meter action

2022-05-13 Thread Shun Hao
Yellow meter action support is added in meter hierarchy validation. If one color uses meter action, the other can only use NULL action or the same meter action. And only shared meter is supported. Signed-off-by: Shun Hao Acked-by: Matan Azard --- doc/guides/nics/mlx5.rst| 6

[PATCH v1 3/4] net/mlx5: support yellow meter action for hierarchy tag rule

2022-05-13 Thread Shun Hao
olicy flows can set the correct meter ID. Signed-off-by: Shun Hao Acked-by: Matan Azard --- drivers/net/mlx5/mlx5_flow_dv.c | 270 +--- 1 file changed, 175 insertions(+), 95 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c

[PATCH v1 2/4] net/mlx5: support yellow meter action in hierarchy

2022-05-13 Thread Shun Hao
/yellow in subsequent meter. Signed-off-by: Shun Hao Acked-by: Matan Azard --- drivers/net/mlx5/mlx5.c| 8 ++- drivers/net/mlx5/mlx5.h| 8 ++- drivers/net/mlx5/mlx5_flow_dv.c| 100 ++--- drivers/net/mlx5/mlx5_flow_meter.c | 57

[PATCH v1 1/4] net/mlx5: support previous meter color aware

2022-05-13 Thread Shun Hao
This patch adds the support for previous color aware for meter. Start_color setting is set to UNDEFINED when creating meter object that is color aware. Signed-off-by: Shun Hao Acked-by: Matan Azard --- drivers/net/mlx5/mlx5.h| 2 ++ drivers/net/mlx5/mlx5_flow_aso.c | 19

[PATCH v1 0/4] Enable yellow meter hierarchy

2022-05-13 Thread Shun Hao
meter can be aware of the previous color, so can have different process strategy. Shun Hao (4): net/mlx5: support previous meter color aware net/mlx5: support yellow meter action in hierarchy net/mlx5: support yellow meter action for hierarchy tag rule net/mlx5: add validation for yellow

[PATCH v1] app/testpmd: fix metering and policing command for rfc4115

2022-05-12 Thread Shun Hao
Add CLI command support for metering and policing of trtcm_rfc4115. Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azard --- app/test-pmd/cmdline.c | 1 + 1 file changed, 1 insertion(+) di

[PATCH v1] net/mlx5: fix quit assert when no meter green action

2022-04-14 Thread Shun Hao
e released, leading assert during port close. This patch fixes this issue by checking both green and yellow queue index during getting a blank sub-policy, to avoid the incorrect resource overwrite. Fixes: b38a12272b3a ("net/mlx5: split meter color policy handling") Cc: sta...@dpdk.org Sig

[PATCH v1] net/mlx5: fix wrong counter in non-termination meter

2022-04-06 Thread Shun Hao
. 2. meter + counter, only counts packets not being dropped. Fixes: 51ec04dc7bcf ("net/mlx5: connect meter policy to created flows") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 13 +++-- 1 file changed, 11 insertions(+), 2

[PATCH v1] net/mlx5: fix meter policy creation assert

2022-03-02 Thread Shun Hao
g RTE flow, can use the flag to set the mark flag in thread workspace. Fixes: 082becbf1f35 ("net/mlx5: fix mark enabling for Rx") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.h | 2 ++ drivers/net/mlx5/mlx5_flow.c| 2 ++ d

[PATCH v1] drivers: fix incorrect E-Switch manager vport ID

2022-02-22 Thread Shun Hao
64038699f9 ("net/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_devx_cmds.c | 12 drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/m

[PATCH v2] drivers: fix incorrect E-Switch manager vport ID

2022-02-22 Thread Shun Hao
64038699f9 ("net/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_devx_cmds.c | 12 drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/m

[PATCH v1] drivers: fix incorrect E-Switch manager vport ID

2022-02-22 Thread Shun Hao
64038699f9 ("net/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_devx_cmds.c | 12 drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/m

[PATCH v2 2/2] net/mlx5: new method to get E-Switch manager vport ID

2022-02-17 Thread Shun Hao
firmware), fallback to use the PCI id approach. Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 4 1 file changed, 4 insertions(+) di

[PATCH v2 1/2] common/mlx5: query E-Switch manager vport ID

2022-02-17 Thread Shun Hao
t/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_devx_cmds.c | 12 drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/mlx5_prm.h | 12

[PATCH v2 0/2] Get E-Switch Manager vport ID

2022-02-17 Thread Shun Hao
always use the correct value. Shun Hao (2): common/mlx5: query E-Switch manager vport ID net/mlx5: new method to get E-Switch manager vport ID drivers/common/mlx5/mlx5_devx_cmds.c | 12 drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/mlx5_prm.h

[PATCH v1] net/mlx5: provide correct items to meter sub-policy

2022-02-17 Thread Shun Hao
.@dpdk.org Signed-off-by: Shun Hao Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 179cc3b303..0311f91bf2 100644 --- a/drivers/net/mlx5/mlx5_fl

[PATCH v1 2/2] net/mlx5: new method to get E-Switch manager vport ID

2022-02-17 Thread Shun Hao
firmware), fallback to use the PCI id approach. Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.org Signed-off-by: Shun Hao --- drivers/net/mlx5/mlx5_flow_dv.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/mlx5/mlx5_f

[PATCH v1 1/2] common/mlx5: query E-Switch manager vport ID

2022-02-17 Thread Shun Hao
t/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.org Signed-off-by: Shun Hao --- drivers/common/mlx5/mlx5_devx_cmds.c | 12 drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/mlx5_prm.h | 12 3 files changed, 26 inserti

[PATCH v1 0/2] Get E-Switch Manager vport ID

2022-02-17 Thread Shun Hao
always use the correct value. Shun Hao (2): common/mlx5: query E-Switch manager vport ID net/mlx5: new method to get E-Switch manager vport ID drivers/common/mlx5/mlx5_devx_cmds.c | 12 drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/mlx5_prm.h

[dpdk-dev] [PATCH v1 1/2] net/mlx5: fix meter flow counter traslation

2021-08-04 Thread Shun Hao
statistics. Add a check in the count action translation to detect the meter case and use the meter drop dedicated counter in the meter 5-tuple flow only. Fixes: f3191849f2c2 ("net/mlx5: support flow count action handle") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- d

[dpdk-dev] [PATCH v1 2/2] net/mlx5: fix domains detection in meter hierarchy

2021-08-04 Thread Shun Hao
cess. Fix is when creating meter hierarchy, try to inherit the first meter domains in the meter hierarchy. Fixes: a3b7af90baba ("net/mlx5: validate meter action in policy") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 16

[dpdk-dev] [PATCH v1 0/2] Fix Meter Hierarchy related issues

2021-08-04 Thread Shun Hao
1. fix the wrong flow statistics when flow contains both count/meter. 2. fix the wrong meter domain access when meters in hierarchy support different domains. Shun Hao (2): net/mlx5: fix meter flow counter traslation net/mlx5: fix domains detection in meter hierarchy drivers/net/mlx5

[dpdk-dev] [PATCH v1 4/4] net/mlx5: validate meter action in policy

2021-07-06 Thread Shun Hao
This adds the validation when creating a policy with meter action. Currently meter action is only allowed for green color in policy, and 8 meters are supported at maximum in one meter hierarchy. Signed-off-by: Shun Hao Acked-by: Matan Azrad --- doc/guides/nics/mlx5.rst | 15

[dpdk-dev] [PATCH v1 3/4] net/mlx5: meter hierarchy destroy and cleanup

2021-07-06 Thread Shun Hao
erence the last meter in hierarchy. Then all meters have no reference and can be destroyed. Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c| 15 +++- drivers/net/mlx5/mlx5_flow_meter.c | 132 + 2 files changed, 145 insert

[dpdk-dev] [PATCH v1 2/4] net/mlx5: support meter hierarchy drop count

2021-07-06 Thread Shun Hao
counted to the correct drop counter in drop table. Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.h | 20 +- drivers/net/mlx5/mlx5_flow.c| 52 +- drivers/net/mlx5/mlx5_flow.h| 7 + drivers/net/mlx5/mlx5_flow_dv.c | 318

[dpdk-dev] [PATCH v1 1/4] net/mlx5: support meter action in meter policy

2021-07-06 Thread Shun Hao
each meter's policy creation. 2. The last meter has RSS policy, don't create sub-policy/rules when creating meter policy. Only when a RTE flow is using the meter hierarchy, will iterate all meters of the hierarchy and create neede sub- policies and color rules for them. Signed-off-by: Shu

[dpdk-dev] [PATCH v1 0/4] Add support for meter hierarchy

2021-07-06 Thread Shun Hao
This adds support for meter hierarchy, which means multiple meters can be chained together, and using the header meter of hierarchy in a flow will apply all meters in hierarchy to that flow. Shun Hao (4): net/mlx5: support meter action in meter policy net/mlx5: support meter hierarchy drop

[dpdk-dev] [PATCH v1 4/4] net/mlx5: fix meter policy flow match item

2021-07-02 Thread Shun Hao
fb4aa4f122 ("net/mlx5: support meter policy operations") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- doc/guides/nics/mlx5.rst| 8 + drivers/net/mlx5/mlx5.h | 2 ++ drivers/net/mlx5/mlx5_flow_dv.c | 58 -

[dpdk-dev] [PATCH v1 3/4] net/mlx5: fix meter flow direction check

2021-07-02 Thread Shun Hao
, use that port_id as src port to determine flow direction. Fixes: c99b4f8bc2f1 ("net/mlx5: support ASO meter action") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 83 ++-- 1 file changed, 50 inserti

[dpdk-dev] [PATCH v1 2/4] net/mlx5: fix meter policy ID table container

2021-07-02 Thread Shun Hao
different ethdev ports. Move the policy l3 table to be per port by saving it in the port private structure. Fixes: afb4aa4f122 ("net/mlx5: support meter policy operations") Cc: sta...@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.c| 2 -

[dpdk-dev] [PATCH v1 1/4] net/mlx5: use meter profile lookup table

2021-07-02 Thread Shun Hao
Currently a list is used to save all meter profile ids, which is not efficient when looking up profile from huge mount of profiles. This changes to use a l3 table instead to save meter profile ids, so as to improve the lookup performance. Signed-off-by: Shun Hao Acked-by: Matan Azrad

[dpdk-dev] [PATCH v1 0/4] ASO meter sharing support

2021-07-02 Thread Shun Hao
This adds several fixes in ASO meter. With these fixes, meter created on one port can be shared by other ports. Shun Hao (4): net/mlx5: use meter profile lookup table net/mlx5: fix meter policy ID table container net/mlx5: fix meter flow direction check net/mlx5: fix meter policy flow

[dpdk-dev] [RFC] net/mlx5: add meter hierarchy support

2021-05-31 Thread Shun Hao
r number in one hierarchy is 8. 2. Currently only meters with termination policy are allowed in meter hierarchy. Signed-off-by: Shun Hao --- doc/guides/nics/mlx5.rst| 18 + drivers/net/mlx5/mlx5.h | 5 + drivers/net/mlx5/mlx5_flow.h| 1 + drivers/net/mlx5

[dpdk-dev] [PATCH v1] net/mlx5: fix meter flow id

2021-05-12 Thread Shun Hao
When getting meter flow_id bits, there's an issue that not handling correctly if flow_id is 0. This fix this issue that when flow_id is 0, treat it as 1 bit. Fixes: 83306d6c46 ("net/mlx5: fix meter statistics") Cc: sta...@dpdk.org Signed-off-by: Shun Hao --- drivers/net/mlx5/