From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1B7743DE7 for ; Wed, 3 Apr 2024 12:06:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37381402CE; Wed, 3 Apr 2024 12:06:12 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2073.outbound.protection.outlook.com [40.92.91.73]) by mails.dpdk.org (Postfix) with ESMTP id 68DE94025C for ; Wed, 3 Apr 2024 12:06:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IMM+mKv34x8WTht74MZDPT0TtEGeHTigCUw+vRtY3NiLh6D3I06Yyv0NrDQwbwEqAsg11WfO7hqIeSgMeJ1Jv1D0uh76ACu5U0jXowdYDFHIHcQv53cZ6Wd+NnOllixYg1wON9OgPONXIOsjAow0GB9yL1ehk2U3mIk5xbIOPtR28lRPXLeLZQktJqBzY26HCYdPrXWwyhHN5WLKGwCPI65s2hkBlOKAvIxKodUgFU6Ky1csgiprxLjI7qWgARaLsupgE8Cn4NBWogBfXtdfC9vXAPkVEQ0I6Ci1AN2Z0/fzo3B/Psn1Byxmf+Q6e6b4DrCQQt6r6yT8UYX2R5ZKMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aLUY7kZ2VRMojt2jMCoUNSlk1qIGlVUALrtkicECol0=; b=fAQFZqICE5C4uCfBAnJXApKjQO2qyZz4R+4YR54YWmoCcsDhDVKYWylbgRXI+WgGcadofgnkJEelwoJKjpgFwRMIaLCC137c+FpsvKYuismYXELcGVEiZu8ixo0NbIbwrJ+K5EvbgDHpUFl+mOZdVKkMYgCZKrlggZ6n1aeJHsDE8PwhvZrWo8X0HWpqFJAQ2/4TkvdohUUBUH2hS77x2wXkYNWcEz+ibq9Jjuw13L1OC8pD5qktxTWDCXDTw2dSSWDyi5hEHMF94HjaFrc0p5CrVXaTyCJOOx9SzqNXi2IrVaKV7OTXeRBDY/s3t5pF14SKxfnuGjad5Um2SgDhOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aLUY7kZ2VRMojt2jMCoUNSlk1qIGlVUALrtkicECol0=; b=FEGDZokHZU0wwXfaIZh1bSgptNTGFd4tFdZBATGk8HeOirN/eXKXuJ2H7NJmUfOiwEudy5zJopEeGXcgaGT5I4QJ6K4B+D488fjCPVJ5pNednDNKvSShq0u0YZTi9NDyWsBoqw8sL8PV4prCXQwkRRI+lV89PYDWDGFcJux1DpWtDfowZgYWerWR+JLp/ICNU4EOZoYGO/EHL4rjs3GBSbHOf5E84EjZghBy2Y/sHoFrk5Gz/TXy5u0oXNZF7OvRz3QBNOGUW91rRfZuZBipV7mJaqv1t4IixeTeJYvrWyn0Lm8ZaNaYFGYeK0L9ZZIC4eIm1GTDlhqA8j8zIEtkew== Received: from DB9PR09MB4906.eurprd09.prod.outlook.com (2603:10a6:10:26e::13) by PAVPR09MB6620.eurprd09.prod.outlook.com (2603:10a6:102:2f7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 3 Apr 2024 10:06:08 +0000 Received: from DB9PR09MB4906.eurprd09.prod.outlook.com ([fe80::fb2e:e9f8:c453:c301]) by DB9PR09MB4906.eurprd09.prod.outlook.com ([fe80::fb2e:e9f8:c453:c301%6]) with mapi id 15.20.7409.042; Wed, 3 Apr 2024 10:06:08 +0000 From: Tao Li To: Asaf Penso , "users@dpdk.org" Subject: Re: Finer matching granularity with async template API Thread-Topic: Finer matching granularity with async template API Thread-Index: AQHae6BPNEwcGktAFESopA2jvtTxHrFCkUNugAAAdQaAAQY17oAARUEjgAaWqAyAC9Z2NQ== Date: Wed, 3 Apr 2024 10:06:08 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [pI8YwiryhUnVY4ZJ+AbCrgcRF620ZOPe] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB9PR09MB4906:EE_|PAVPR09MB6620:EE_ x-ms-office365-filtering-correlation-id: ef90e26f-e3bd-4f0d-0662-08dc53c5aec8 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bcsGmaKGh7Kx1hVTwh1EzAjc8A7FG83Dn6QvSD/ZgEnwzWo7lR0Si9wRuRgrTpJ1HhU9WDHJzLSMaTaY7aLjKL61G5lBxJm8fAV9MS64oCGZ6to9NFRWTZy/Y5UXHWBqr6IaJiwkNAyE63Z7dqzRP3zTXlBICCaSKE1CyokYc7oWl7bZY6MyENQflDHX7LBjr76rmvXqlgNVQrWZzBcQrgcfVyIuvvfq79Ty7wTML5L93xAEDXPHN6eiXwkReEN7wG36nxn2A80tVfGYNHZp+4/nTpgkn6BBwP6U6zN7vrFmPYhHQEUC5SUe2P+EN2OeXWtwpWNcNzGdyreFTrfHHkQajDJ5TtVtv3VCk0V6bkldtN2oc5SPeOm76Hkj6W0xw18CDb+hhbanaQnI/a28xSXX7hTv1pLHTdxC5z2zllLAB2rGJhCT9SWCWYy7/qnz7kk3mcOZJNOEQqE/KX4+/ubtm8w5J0AmO1DZP/8+MbAvTJt8ranYYfDS3qlBB6yQPHeqOzkS5WQrJms7z69PrGWo0Gw+M+l8XYa3TK/JPnQPEN7rndLbJkSBa+b3bFDSqBx7C+bCCQaRNqVQrbaFy9fDAoyUW5s/PGgSsJN59R+Oapp9b7JrH+Zelb2f3Umre2P9fgF/fA2bGKVZdaOaxBaWNQNlPP7MjwEdrF/dtEAR6G0w7x9gppDRhLmlRJhL x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?LL7yF2Er8pun1jyquIyOvIzqagGJlFwk9CyqybuRTcdPhLl1uJIlpv8i?= =?Windows-1252?Q?eTGxa9Yc57H5d1cgF3Ekqt5b2K+d1k3haNkHcYldqPE5ZLj36Ii6Ke29?= =?Windows-1252?Q?uJHvGYQ69jd2vu8xxYJsBLPMeAxtIwjVFkF49jgEmZ77OF0WbEqR5WU3?= =?Windows-1252?Q?jTTzsRXh1v1txPsHADeYw7Oxr9QLDl1DQ4mKF8pU0Ly/LVOYuYKRamYN?= =?Windows-1252?Q?pcpB99Z8jh8rcdgOY04MOTwM7jS5sNSNq1w72zPteqLZOZUUexZnZ1In?= =?Windows-1252?Q?CPJC9f3Qyt/obitkT6O3uESWOxVHZcHYPsy7us1lx83qE3arsxrihbOE?= =?Windows-1252?Q?Ry2DHT1rvQ9IAth0c63QuKNU3/5T6+PIDttTFbNzpnPx5sqgkF07Z9fv?= =?Windows-1252?Q?UAjzzX2XmKMTnCClrdpPdxRiMw6lt3IhvxgZeke8JCGIUgRcmtcq84jc?= =?Windows-1252?Q?ukBjskzBujpbOh9AFbSJWMHU9r3eHUtNXknep5k/BfBgVk1pLUupxJDB?= =?Windows-1252?Q?5bv366VDgNYy9XWWBgCJ/TUfc+03WDeF7tOd7GNLsGUlRNIopQwVv5sX?= =?Windows-1252?Q?3L7GxOMvooLofkgtqwM1cjZ0KC5OhfV/wozutkzxsTTASs+HipF8ybng?= =?Windows-1252?Q?4CVMNMfD0tTLJRfLbzMBuLeLeR5jrthF6VVPDD0JJtPZ53Y/TpV9YFdk?= =?Windows-1252?Q?vSnSedaGhscppHUz2+fh5BvkF9B7HrZjI9qGaYVmsgoEZUBl/HFzOywG?= =?Windows-1252?Q?8959KrrEXADU2Tltxz3P+xNbivZ9Fkqnk1sJ0LWTuakXXddac6yJ1512?= =?Windows-1252?Q?R5AKd40AGLFc2JrvUk4MomKpB0mqAFoQvOtKWFREPwoxxLA3SIv31qAD?= =?Windows-1252?Q?vgodGx5x2c5unNTpPEfC3GdAB6eWWSLH8XhPQmFvGKmUhzVMNMF9lSna?= =?Windows-1252?Q?2bDIIav9YCncuivQViiyeYbS9UkIzSSpkJKbiNM2odxltgh6ZrljSFzL?= =?Windows-1252?Q?vxehL6ZDF/fXsatRBZI2LEOi6kqYotVpGlAwdIA1Ivqdu1BiFQj7naE4?= =?Windows-1252?Q?bbFfPybphcdSw37SRpkVaqO7d0NU9trOj8bjQfpXtYFXY+LU/CO76B0J?= =?Windows-1252?Q?JY5k/gDM1i0pV1FGpoOxdLTp+BJsFzeIZsxMA+beQrwQcJOKPvfmkFss?= =?Windows-1252?Q?zsOT7M3DWIOqkUtSZ2IlpT7dFHFPvtANSJIgobcZySh5hCHMXMHXJ9Al?= =?Windows-1252?Q?3kruT/j01gy3p8hLQtaxIBFOxmnGWU+zDVwpA6nkreDhalSBBY9MfmKk?= =?Windows-1252?Q?s/1GZUaYFrzbY1qlUPM3T4KSyQjPb50g6Pgc2JysHJCBiyz1?= Content-Type: multipart/alternative; boundary="_000_DB9PR09MB49061AC52B71F4F739E092DEA33D2DB9PR09MB4906eurp_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB9PR09MB4906.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: ef90e26f-e3bd-4f0d-0662-08dc53c5aec8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2024 10:06:08.5407 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR09MB6620 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --_000_DB9PR09MB49061AC52B71F4F739E092DEA33D2DB9PR09MB4906eurp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hello Asaf, Thanks for sharing this info, and looking forward to support this feature. Best regards, Tao From: Asaf Penso Date: Tuesday, 26. March 2024 at 20:43 To: Tao Li , users@dpdk.org Subject: Re: Finer matching granularity with async template API Hello Tao, Currently, we don't support IPinIP with template API. We have it in our roadmap, but still no concrete release date for it. Regards, Asaf Penso ________________________________ From: Tao Li Sent: Friday, March 22, 2024 5:08:46 pm To: Asaf Penso ; users@dpdk.org Subject: Re: Finer matching granularity with async template API Hello Asaf, We generate incoming IPinIP packets by using our complex solution, but belo= w you can find a Python script to generate such packets to serve this purpo= se. I hope it is helpful to reproduce this issue. Thanks again. #!/usr/bin/python3 from scapy.all import * from scapy.layers.inet import Ether, UDP, ICMP from scapy.layers.inet6 import * ether =3D Ether() ether.src =3D "src mac" ether.dst =3D "dst mac" ether.type =3D 0x86DD ipv6 =3D IPv6() ipv6.src =3D "src ipv6 addr" ipv6.dst =3D "dst ipv6 addr" ipv6.nh =3D 4 pkt =3D ether / ipv6 / IP(src=3D"192.168.129.5",dst=3D"172.32.4.9") / ICMP(= type=3D8) print(pkt.show()) sendp(pkt, iface =3D"ens1f0np0") < /Code snippet to generate IPinIP packets > Cheers, Tao From: Tao Li Date: Friday, 22. March 2024 at 14:19 To: Asaf Penso , users@dpdk.org Subject: Re: Finer matching granularity with async template API Hellp Asaf, Thanks for your speedy reply. Please find additional information based on y= our questions, and I hope they would help to understand our purpose and iss= ue. 1. Why ipv6/ipv4/icmp? We are performing IPinIP tunnelling for traffic, and in this provided test-= pmd example we encapsulate IPv4 packets from VMs into IPv6 underlay packets= . The refence RFCs for this approach are RFC 1853 and RFC 2473. This articl= e also provides goo= d visualization on packet structures for this IPinIP tunnelling approach. 1. What output /error message? No crashing error message or similar happens, thus it is difficult for us t= o debug what is exactly going on. What is observed is that incoming packets= cannot be captured and processed by this flow rule, compared with using t= he flow rule only performs eth/ipv6 matching. After removing relevant comma= nds or code that perform inner header matching for IPv4 and ICMP, packets c= an be successfully processed. The code snippets to programmably achieve the= above described IPinIP tunnelling approach are as following: static const struct rte_flow_item_eth flow_item_eth_mask =3D { .hdr.ether_type =3D 0xffff, }; static const struct rte_flow_item_ipv6 flow_item_ipv6_dst_mask =3D { .hdr.proto =3D 0xff, }; static const struct rte_flow_item_ipv4 flow_item_ipv4_proto_mask =3D { .hdr.next_proto_id =3D 0xff, }; static const struct rte_flow_item_icmp flow_item_icmp_mask =3D { .hdr.icmp_type =3D 0xff, }; // pattern template struct rte_flow_item pattern[] =3D { [0] =3D {.type =3D RTE_FLOW_ITEM_TYPE_REPRE= SENTED_PORT, .mask =3D &represented_port_mask}, [1] =3D {.type =3D RTE_FLOW_ITEM_TYPE_ETH, = .mask =3D &flow_item_eth_mask}, [2] =3D {.type =3D RTE_FLOW_ITEM_TYPE_IPV6,= .mask =3D &flow_item_ipv6_dst_mask}, [3] =3D {.type =3D RTE_FLOW_ITEM_TYPE_IPV4,= .mask =3D &flow_item_ipv4_proto_mask}, [4] =3D {.type =3D RTE_FLOW_ITEM_TYPE_ICMP,= .mask =3D &flow_item_icmp_mask}, [5] =3D {.type =3D RTE_FLOW_ITEM_TYPE_END,}= , }; port_template_info_pf.pattern_templates[0] =3D create_patte= rn_template(main_eswitch_port, pattern); struct rte_flow_item_eth eth_pattern =3D {.type =3D htons(0= x86DD)}; struct rte_flow_item_ipv6 ipv6_hdr =3D {0}; ipv6_hdr.hdr.proto =3D IPPROTO_IPIP; struct rte_flow_item_ipv4 ipv4_hdr =3D {0}; ipv4_hdr.hdr.next_proto_id =3D IPPROTO_ICMP; struct rte_flow_item_icmp icmp_hdr =3D {0}; icmp_hdr.hdr.icmp_type =3D RTE_IP_ICMP_ECHO_REQUEST; struct rte_flow_item_ethdev represented_port =3D {.port_id = =3D pf_port_id}; struct rte_flow_item concrete_patterns[6]; concrete_patterns[0].type =3D RTE_FLOW_ITEM_TYPE_REPRESENTE= D_PORT; concrete_patterns[0].spec =3D &represented_port; concrete_patterns[0].mask =3D NULL; concrete_patterns[0].last =3D NULL; concrete_patterns[1].type =3D RTE_FLOW_ITEM_TYPE_ETH; concrete_patterns[1].spec =3D ð_pattern; concrete_patterns[1].mask =3D NULL; concrete_patterns[1].last =3D NULL; concrete_patterns[2].type =3D RTE_FLOW_ITEM_TYPE_IPV6; concrete_patterns[2].spec =3D &ipv6_hdr; concrete_patterns[2].mask =3D NULL; concrete_patterns[2].last =3D NULL; concrete_patterns[3].type =3D RTE_FLOW_ITEM_TYPE_IPV4; concrete_patterns[3].spec =3D &ipv4_hdr; concrete_patterns[3].mask =3D NULL; concrete_patterns[3].last =3D NULL; concrete_patterns[4].type =3D RTE_FLOW_ITEM_TYPE_ICMP; concrete_patterns[4].spec =3D &icmp_hdr; concrete_patterns[4].mask =3D NULL; concrete_patterns[4].last =3D NULL; concrete_patterns[5].type =3D RTE_FLOW_ITEM_TYPE_END; concrete_patterns[5].spec =3D NULL; concrete_patterns[5].mask =3D NULL; concrete_patterns[5].last =3D NULL; Looking forward to your further support, and many thanks in advance. Best regards, Tao From: Asaf Penso Date: Thursday, 21. March 2024 at 20:18 To: Tao Li , users@dpdk.org Subject: Re: Finer matching granularity with async template API BTW, In the non working example I see ipv6 / ipv4 / ICMP. Was this your intentio= n or did you mean ipv6 / ICMP? Regards, Asaf Penso ________________________________ From: Asaf Penso Sent: Thursday, March 21, 2024 9:17:04 PM To: Tao Li ; users@dpdk.org Subject: Re: Finer matching granularity with async template API Hello Tao, What is the output / error message you get? Regards, Asaf Penso ________________________________ From: Tao Li Sent: Thursday, March 21, 2024 5:44:00 PM To: users@dpdk.org Subject: Finer matching granularity with async template API Hi all, I am using async template API to install flow rules to perform actions on p= ackets to achieve IP(v4)inIP(v6) tunnelling. Currently I am facing an issue= where I cannot perform incoming traffic matching with finer granularity. T= he test-pmd commands in use are as following: port stop all flow configure 0 queues_number 4 queues_size 64 counters_number 0 aging_cou= nters_number 0 meters_number 0 flags 0 # PF0 flow configure 1 queues_number 4 queues_size 64 counters_number 0 aging_cou= nters_number 0 meters_number 0 flags 0 flow configure 2 queues_number 4 queues_size 64 counters_number 0 aging_cou= nters_number 0 meters_number 0 flags 0 flow configure 3 queues_number 4 queues_size 64 counters_number 0 aging_cou= nters_number 0 meters_number 0 flags 0 # PF1V0 port start all set verbose 1 flow pattern_template 0 create transfer relaxed no pattern_template_id 10 = template represented_port ethdev_port_id is 0 / eth / ipv6 / ipv4 / icmp = / end set raw_decap 0 eth / ipv6 / end_set set raw_encap 0 eth src is 11:22:33:44:55:66 dst is 66:9d:a7:fd:fb:43 type = is 0x0800 / end_set flow actions_template 0 create transfer actions_template_id 10 template r= aw_decap index 0 / raw_encap index 0 / represented_port / end mask raw_deca= p index 0 / raw_encap index 0 / represented_port / end flow template_table 0 create group 0 priority 0 transfer wire_orig table_= id 5 rules_number 8 pattern_template 10 actions_template 10 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 / ipv6 /= ipv4 / icmp / end actions raw_decap index 0 / raw_encap index 0 / repres= ented_port ethdev_port_id 3 / end flow push 0 queue 0 Once I remove matching patterns for the inner packet headers( ipv4 / icmp) = as following, I can see the processed packets inside VMs using tcpdump. =85 flow pattern_template 0 create transfer relaxed no pattern_template_id 10 = template represented_port ethdev_port_id is 0 / eth / ipv6 / end =85 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 / ipv6 = / end actions raw_decap index 0 / raw_encap index 0 / represented_port eth= dev_port_id 3 / end =85 Similar combination works when using the synchronous rte_flow API. Any comm= ent or suggestion on this issue is much appreciated. Many thanks in advance= . Best regards, Tao --_000_DB9PR09MB49061AC52B71F4F739E092DEA33D2DB9PR09MB4906eurp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Hello Asaf,

 

Thanks for sharing = this info, and looking forward to support this feature.

 

Best regards,<= /o:p>

Tao

 

From: Asaf Penso <asaf= p@nvidia.com>
Date: Tuesday, 26. March 2024 at 20:43
To: Tao Li <byteocean@hotmail.com>, users@dpdk.org <users@d= pdk.org>
Subject: Re: Finer matching granularity with async template API=

Hello Tao,

 

Currently, we don't= support IPinIP with template API.

We have it in our r= oadmap, but still no concrete release date for it.

 

Regards,=

Asaf Penso

 


From: Tao Li <byteocean@hotmail.com>
Sent: Friday, March 22, 2024 5:08:46 pm
To:= Asaf Penso <asafp@nvidia.com>; users@dpdk.org <users@dpd= k.org>
Subject: Re: Finer matching granularity with async template API<= /o:p>

 

Hello Asaf,<= o:p>

 <= /o:p>

We generate incomin= g IPinIP packets by using our complex solution, but below you can find a Py= thon script to generate such packets to serve this purpose. I hope it is he= lpful to reproduce this issue. Thanks again.

 <= /o:p>

<Code snippet= to generate IPinIP packets>

#!/usr/bin/python3<= /span>

from scapy.all impo= rt *

from scapy.layers.i= net import Ether, UDP, ICMP

from scapy.layers.i= net6 import *

 <= /o:p>

ether =3D Ether()

ether.src =3D "= ;src mac"

ether.dst =3D "= ;dst mac"

ether.type =3D 0x86= DD

 <= /o:p>

ipv6 =3D IPv6()

ipv6.src =3D "= src ipv6 addr"

ipv6.dst =3D "= dst ipv6 addr"

ipv6.nh =3D 4

 <= /o:p>

pkt =3D ether / ipv= 6 / IP(src=3D"192.168.129.5",dst=3D"172.32.4.9") / ICMP= (type=3D8)

 <= /o:p>

print(pkt.show())

sendp(pkt, iface = =3D"ens1f0np0")

< /Code snipp= et to generate IPinIP packets >

 

Cheers,=

Tao

 <= /o:p>

From: Tao Li <byteocea= n@hotmail.com>
Date: Friday, 22. March 2024 at 14:19
To: Asaf Penso <asafp@nvidia.com>, users@dpdk.org <users@dp= dk.org>
Subject: Re: Finer matching granularity with async template API

Hellp Asaf,<= o:p>

 <= /o:p>

Thanks for your spe= edy reply. Please find additional information based on your questions, and = I hope they would help to understand our purpose and issue.

 <= /o:p>

  1. Why ipv6/ipv4/icmp?

We are performing IPinIP tunnelling for tr= affic, and in this provided test-pmd example we encapsulate IPv4 packets fr= om VMs into IPv6 underlay packets. The refence RFCs for this approach are R= FC 1853 and RFC 2473. This <= span style=3D"font-size:11.0pt">article also provides good visualization on packet structures for this IPinIP tunn= elling approach.

 

  1. What output /error message?

No crashing error message or similar happe= ns, thus it is difficult for us to debug what is exactly going on. What is = observed is that incoming packets cannot be captured and processed by this flow rule,  compared w= ith using the flow rule only performs eth/ipv6 matching. After removing rel= evant commands or code that perform inner header matching for IPv4 and ICMP, packet= s can be successfully processed. The code snippets to programmably achieve = the above described IPinIP tunnelling approach are as following:

 

<Code snippet to initialise pattern = masks>

static const struct rte_flow_item_eth flow_item_eth_mask =3D {

           = ;     .hdr.ether_type =3D 0xffff,

};

 

static const struct rte_flow_item_ipv6 flow_item_ipv6_dst_mask = =3D {

           = ;     .hdr.proto =3D 0xff,

};

 

static const struct rte_flow_item_ipv4 flow_item_ipv4_proto_mask = =3D {

           = ;     .hdr.next_proto_id =3D 0xff,

};

 

static const struct rte_flow_item_icmp flow_item_icmp_mask =3D {<= /span>

           = ;     .hdr.icmp_type =3D 0xff,

};

</Code snippet to initialise pattern= masks>

 

<Code snippet to create pattern temp= late>

       =          // pattern template=

       =          struct rte_flow_item patte= rn[] =3D {

       =             &nb= sp;            [0] = =3D {.type =3D RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT, .mask =3D &represen= ted_port_mask},

       =             &nb= sp;            [1] = =3D {.type =3D RTE_FLOW_ITEM_TYPE_ETH, .mask =3D &flow_item_eth_mask},<= /span>

       =             &nb= sp;            [2] = =3D {.type =3D RTE_FLOW_ITEM_TYPE_IPV6, .mask =3D &flow_item_ipv6_dst_m= ask},

       =             &nb= sp;            [3] = =3D {.type =3D RTE_FLOW_ITEM_TYPE_IPV4, .mask =3D &flow_item_ipv4_proto= _mask},

       =             &nb= sp;            [4] = =3D {.type =3D RTE_FLOW_ITEM_TYPE_ICMP, .mask =3D &flow_item_icmp_mask}= ,

       =             &nb= sp;            [5] = =3D {.type =3D RTE_FLOW_ITEM_TYPE_END,},

       =          };

       =          port_template_info_pf.patt= ern_templates[0] =3D create_pattern_template(main_eswitch_port, pattern);

</Code snippet to create pattern tem= plate>

 

<Code snippet to create patterns>=

       =          struct rte_flow_item_eth e= th_pattern =3D {.type =3D htons(0x86DD)};

 <= /o:p>

       =          struct rte_flow_item_ipv6 = ipv6_hdr =3D {0};=

       =          ipv6_hdr.hdr.proto =3D IPP= ROTO_IPIP;

 

       =          struct rte_flow_item_ipv4 = ipv4_hdr =3D {0};=

       =          ipv4_hdr.hdr.next_proto_id= =3D IPPROTO_ICMP;

 

       =          struct rte_flow_item_icmp = icmp_hdr =3D {0};=

       =          icmp_hdr.hdr.icmp_type =3D= RTE_IP_ICMP_ECHO_REQUEST;

 

       =          struct rte_flow_item_ethde= v represented_port =3D {.port_id =3D pf_port_id};

 

       =          struct rte_flow_item concr= ete_patterns[6];<= /p>

 

       =          concrete_patterns[0].type = =3D RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT;

       =          concrete_patterns[0].spec = =3D &represented_port;

       =          concrete_patterns[0].mask = =3D NULL;

       =          concrete_patterns[0].last = =3D NULL;

 

 

       =          concrete_patterns[1].type = =3D RTE_FLOW_ITEM_TYPE_ETH;

       =          concrete_patterns[1].spec = =3D &eth_pattern;

       =          concrete_patterns[1].mask = =3D NULL;

       =          concrete_patterns[1].last = =3D NULL;

 

       =          concrete_patterns[2].type = =3D RTE_FLOW_ITEM_TYPE_IPV6;

       =          concrete_patterns[2].spec = =3D &ipv6_hdr;

       =          concrete_patterns[2].mask = =3D NULL;

       =          concrete_patterns[2].last = =3D NULL;

 

       =          concrete_patterns[3].type = =3D RTE_FLOW_ITEM_TYPE_IPV4;

       =          concrete_patterns[3].spec = =3D &ipv4_hdr;

       =          concrete_patterns[3].mask = =3D NULL;

       =          concrete_patterns[3].last = =3D NULL;

 

       =          concrete_patterns[4].type = =3D RTE_FLOW_ITEM_TYPE_ICMP;

       =          concrete_patterns[4].spec = =3D &icmp_hdr;

       =          concrete_patterns[4].mask = =3D NULL;

       =          concrete_patterns[4].last = =3D NULL;

 

       =          concrete_patterns[5].type = =3D RTE_FLOW_ITEM_TYPE_END;

       =          concrete_patterns[5].spec = =3D NULL;

       =          concrete_patterns[5].mask = =3D NULL;

       =          concrete_patterns[5].last = =3D NULL;

</Code snippet to create patterns>= ;

 

 

Looking forward to = your further support, and many thanks in advance.

 <= /o:p>

Best regards,

Tao

 

 <= /o:p>

From: Asaf Penso <asaf= p@nvidia.com>
Date: Thursday, 21. March 2024 at 20:18
To: Tao Li <byteocean@hotmail.com>, users@dpdk.org <users@d= pdk.org>
Subject: Re: Finer matching granularity with async template API

BTW,

In the non working = example I see ipv6 / ipv4 / ICMP. Was this your intention or did you mean i= pv6 / ICMP?

 <= /o:p>

Regards,

Asaf Penso


From: Asaf P= enso <asafp@nvidia.com>
Sent: Thursday, March 21, 2024 9:17:04 PM
To: Tao Li <byteocean@hotmail.com>; users@dpdk.org <users@d= pdk.org>
Subject: Re: Finer matching granularity with async template API

 <= /o:p>

Hello Tao,

 <= /o:p>

What is the output = / error message you get?

 <= /o:p>

 <= /o:p>

Regards,

Asaf Penso


From: Tao Li= <byteocean@hotmail.com>
Sent: Thursday, March 21, 2024 5:44:00 PM
To: users@dpdk.org <users@dpdk.org>
Subject: Finer matching granularity with async template API

 <= /o:p>

Hi all,

 

I am using async template API to install flow rules to p= erform actions on packets to achieve IP(v4)inIP(v6) tunnelling. Currently I= am facing an issue where I cannot perform incoming traffic matching with finer granularity. The test-pmd commands in= use are as following:

 

<Not working test-pmd commands>

port stop all

 

flow configure 0 queues_number 4 queues_size 64 counters_number 0 aging= _counters_number 0 meters_number 0 flags 0   # PF0

 

flow configure 1 queues_number 4 queues_size 64 counters_number 0 aging= _counters_number 0 meters_number 0 flags 0

 

flow configure 2 queues_number 4 queues_size 64 counters_number 0 aging= _counters_number 0 meters_number 0 flags 0

 

flow configure 3 queues_number 4 queues_size 64 counters_number 0 aging= _counters_number 0 meters_number 0 flags 0  # PF1V0<= /p>

 

port start all

set verbose 1

 

flow pattern_template 0 create transfer relaxed no pattern_template_id = 10  template represented_port ethdev_port_id is 0 / eth  / ipv6 / ipv4 / icmp  / end

 

set raw_decap 0 eth  / ipv6 / end_set

set raw_encap 0 eth src is 11:22:33:44:55:66 dst is 66:9d:a7:fd:fb:43 t= ype is 0x0800 / end_set

 

flow actions_template 0 create transfer  actions_template_id 10&nb= sp; template raw_decap index 0 / raw_encap index 0 / represented_port / end= mask raw_decap index 0 / raw_encap index 0 /  represented_port  / end

 

flow template_table 0 create  group 0 priority 0  transfer wi= re_orig table_id 5 rules_number 8 pattern_template 10 actions_template 10

 

flow queue 0 create 0 template_table 5 pattern_template 0 actions_templ= ate 0 postpone no pattern represented_port ethdev_port_id is 0 / eth  = / ipv6  / ipv4 / icmp  / end actions raw_decap index 0 / raw_encap inde= x 0 /  represented_port ethdev_port_id 3 / end

 

flow push 0 queue 0

</Not working test-pmd commands>

 

Once I remove matching patterns for the inner packet hea= ders( ipv4 / icmp) as following, I can see the processed packets inside VMs= using tcpdump.

 

<Working test-pmd commands>

=85

flow pattern_template 0 create transfer relaxed no pattern_template_id = 10  template represented_port ethdev_port_id is 0 / eth  / ipv6 /= end

=85

flow queue 0 create 0 template_table 5 pattern_template 0 actions_templ= ate 0 postpone no pattern represented_port ethdev_port_id is 0 / eth  = / ipv6   / end actions raw_decap index 0 / raw_encap index 0 /  represented_port ethdev_port_id 3 / end

=85

</Working test-pmd commands>

 

Similar combination works when using the synchronous rte= _flow API. Any comment or suggestion on this issue is much appreciated. Man= y thanks in advance.

 

Best regards,

Tao

 

 

 

--_000_DB9PR09MB49061AC52B71F4F739E092DEA33D2DB9PR09MB4906eurp_--