<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#467886;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-DE" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I am using the async API to install flow rules to perform the QUEUE action to capture packets matching a certain pattern for processing by a DPDK application. The ConnectX-6 NIC is configured in multiport
 e-switch mode, as outlined in the documentation (<a href="https://doc.dpdk.org/guides/nics/mlx5.html#multiport-e-switch">https://doc.dpdk.org/guides/nics/mlx5.html#multiport-e-switch</a>). Currently, I am facing an issue where I cannot create the corresponding
 templates for this purpose. The command to start test-pmd and create pattern and action templates are as follows:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"><Command to start test-pmd><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.5pt">sudo ./dpdk-testpmd -a 3b:00.0,dv_flow_en=2,representor=pf0-1vf0 -- -i --rxq=1 --txq=1 --flow-isolate-all<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"></Command to start test-pmd></span></b><b><span lang="EN-US" style="font-size:10.5pt"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"><Not working test-pmd commands><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.5pt">port stop all<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow configure 0 queues_number 1 queues_size 10 counters_number 0 aging_counters_number 0 meters_number 0 flags 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow configure 1 queues_number 1 queues_size 10 counters_number 0 aging_counters_number 0 meters_number 0 flags 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow configure 2 queues_number 1 queues_size 10 counters_number 0 aging_counters_number 0 meters_number 0 flags 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow configure 3 queues_number 1 queues_size 10 counters_number 0 aging_counters_number 0 meters_number 0 flags 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">port start all<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow pattern_template 0 create transfer relaxed no pattern_template_id 10  template represented_port ethdev_port_id is 0 / eth type is 0x86dd  / end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow actions_template 0 create ingress  actions_template_id 10  template queue / end mask queue index 0xffff / end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow template_table 0 create  group 0 priority 0  transfer wire_orig table_id 5 rules_number 8 pattern_template 10 actions_template 10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow queue 0 create 0 template_table 5 pattern_template 0 actions_template 0 postpone no pattern represented_port ethdev_port_id is 0 / eth type is 0x86dd  / end actions queue index 0 / end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">flow push 0 queue 0<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"></Not working test-pmd commands><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The error encountered during the execution of the above test-pmd commands is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"><Encounted error><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.5pt">mlx5_net: [mlx5dr_action_print_combo]: Invalid action_type sequence<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">mlx5_net: [mlx5dr_action_print_combo]: TIR<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">mlx5_net: [mlx5dr_matcher_check_and_process_at]: Invalid combination in action template<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">mlx5_net: [mlx5dr_matcher_bind_at]: Invalid at 0<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"></Encounted error><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Upon closer inspection of the driver code</span><span lang="EN-US" style="font-size:11.0pt"> in DPDK 23.11 (also  the latest DPDK main branch)</span><span style="font-size:11.0pt">, it appears that the error
 is due to the fact that MLX5DR_ACTION_TYP_TIR is not listed as a valid action in the MLX5DR_TABLE_TYPE_FDB field. If the following patch is applied, the error is resolved, and the DPDK application is able to capture matching packets:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"><patch to apply><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.5pt">diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">index 862ee3e332..c444ec761e 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">--- a/drivers/net/mlx5/hws/mlx5dr_action.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">+++ b/drivers/net/mlx5/hws/mlx5dr_action.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">@@ -85,6 +85,7 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">                BIT(MLX5DR_ACTION_TYP_VPORT) |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">                BIT(MLX5DR_ACTION_TYP_DROP) |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">                BIT(MLX5DR_ACTION_TYP_DEST_ROOT) |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">+               BIT(MLX5DR_ACTION_TYP_TIR) |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">                BIT(MLX5DR_ACTION_TYP_DEST_ARRAY),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">                BIT(MLX5DR_ACTION_TYP_LAST),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt">        }, <o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt"></patch to apply><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I would greatly appreciate it if anyone could provide insight into whether this behavior is intentional or if it is a bug in the driver. Many thanks in advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Tao<o:p></o:p></span></p>
</div>
</body>
</html>