From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150050.outbound.protection.outlook.com [40.107.15.50]) by dpdk.org (Postfix) with ESMTP id 3FBD91B4CE for ; Wed, 19 Dec 2018 10:01:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BzJAwmKGt0MM4LG3G6rR1LvjwRxaHUcesGaR3KNXfpE=; b=CiSemzyQFYSADMdzKKTRBwcRJ0pq7Cpo+KFqzyZxFN5aWO6efNgLCucK8M7urEXo5zW5yS1/vK8ucc2IApAlW5FzL4KnxOnyUKS4pv0pYcRIVps10l4U1z1BO/wB1IbSbqWfIdsA+pj0sbXzprO253dNb4dbQaSy92K4uKpJiqU= Received: from AM5PR0501MB2369.eurprd05.prod.outlook.com (10.169.149.20) by AM5PR0501MB2385.eurprd05.prod.outlook.com (10.169.149.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.19; Wed, 19 Dec 2018 09:01:01 +0000 Received: from AM5PR0501MB2369.eurprd05.prod.outlook.com ([fe80::11c9:75f5:9beb:9b65]) by AM5PR0501MB2369.eurprd05.prod.outlook.com ([fe80::11c9:75f5:9beb:9b65%5]) with mapi id 15.20.1425.024; Wed, 19 Dec 2018 09:01:01 +0000 From: Saleh Alsouqi CC: "stable@dpdk.org" Thread-Topic: [PATCH] app/testpmd: fix mpls encap ipv4 version and ihl Thread-Index: AQHUl3abpODrirADjUmyv5REzVDJl6WFw5N4 Date: Wed, 19 Dec 2018 09:01:01 +0000 Message-ID: References: <1545208867-20410-1-git-send-email-salehals@mellanox.com> In-Reply-To: <1545208867-20410-1-git-send-email-salehals@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [212.29.221.74] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5PR0501MB2385; 6:QO/nLp7rNajTbQypeyudqp9YSkK1wwETlKcM114B49VYfD8ezExVIixaMSBSwHcEGXS0Z8TdPp5XbM7XJCs2xT4cNXJnRnSmUP8DuvBd8W1TiMYCmNk+igPwJyF4tzPaMEhIk+60d0YxUEhVe+qfM9Y+ws9D8xE4rzN7g9Q7DdEGX9AW+RWc+jcTI5IDdLypYXNppgG3qUC5sgXA1hdHwaQ8H5fMGlNdpD4eA3p/3kmZFKWRwFcVTud46bmLTiSKym1mplNsYyXTUNw4XtpDI4NGj7248V+tCn2lT7Wljrid+i5sSRIDR/AyTBFD0Urqf/nrWxZW/4QW7n6z/P+1r/nur1a7jzWCfJ7+mKeBI85BvHeKt4kDhpuLnyl1GJU0CMjENWpmkjrebX6ldwBaWp2dO7HYc4iFO1Cxmzf9EqUa2Zq0Rtg4VLdnmBd/mg62nLMjjA61WjqHcOfnyXrvFw==; 5:zEilQ7r/gu+V1WFE+1MVfSfLlfE/SaKkn6dYW7iczRJy9Zp4orYS+I11pdytGHgVf1xo76wXOTM/Twc+Hqy4K5Sj7JX8H1bCrdpB5oJY/wZUY7rXGLMfyGgjOJLJQZ8r4Bitwye/iacpj0Z6lbJJcOOSfTUE8RqsqtpAQwbO9bY=; 7:G7BLpffgfOYDQFLTgAcp+QNc3AFCQaRZHFQwHMKg6VaxoTzv0y0EKyo4sxd4K+5XG9klUmBJF+fVNP7WU1JjYxcLIQGEFLYTwEVqq0Kd6vyX5vp1GU/5RMNTvmPfDmhldT0u8fIM4SGfemwvz0pIXg== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: ea163ac0-bb06-4654-30e7-08d665907fbf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2385; x-ms-traffictypediagnostic: AM5PR0501MB2385: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(5005020)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:AM5PR0501MB2385; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2385; x-forefront-prvs: 0891BC3F3D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(39860400002)(136003)(366004)(346002)(376002)(396003)(199004)(189003)(446003)(476003)(486006)(102836004)(81166006)(11346002)(81156014)(53546011)(606006)(7736002)(6506007)(66066001)(7696005)(66574012)(74316002)(8676002)(99286004)(5660300001)(8936002)(6436002)(86362001)(76176011)(316002)(229853002)(109986005)(6246003)(4326008)(53936002)(55016002)(97736004)(2906002)(256004)(6306002)(54896002)(9686003)(71200400001)(19627235002)(236005)(71190400001)(26005)(33656002)(966005)(106356001)(1671002)(186003)(3846002)(6116002)(59246006)(25786009)(14454004)(478600001)(68736007)(6346003)(105586002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2385; H:AM5PR0501MB2369.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=salehals@mellanox.com; x-microsoft-antispam-message-info: NifAuH7a/v6XcmYh0r8OYlooEIQYz2DOGAndTDsGZg6FJduMx7D/Dilr+BeaP6kZw+IRlUNW8vZHJsiPdYyjbYDHjAAdVeaBSQ0e3Hs1VjhHO82k65LIDOtnOjjznPMAFUR9OdGTrfupHnU9WHKixlyb2twSBQQY8I5AVxs4mjFg7RX4FUP7A6nVILBB+N6g26gRoVOm2p3ojfeboBuc/vXQNd0lG0SbVlEbqnTBOYFYu3+QvpT7Jnf1i3WndvcYxpnx4KNxNjqR7cP+CJtpL83KqIWqcCdFON+uhocPQ3eE/jq3/5tGhxRBflPxTUXz spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea163ac0-bb06-4654-30e7-08d665907fbf X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2018 09:01:01.1029 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2385 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH] app/testpmd: fix mpls encap ipv4 version and ihl X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 09:01:02 -0000 Please ignore this email, it was cc=92d by mistake. Regards, Saleh ________________________________ From: Saleh Alsouqi Sent: Wednesday, December 19, 2018 10:41:17 AM To: Ali Alnubani; Saleh Alsouqi Cc: stable@dpdk.org Subject: [PATCH] app/testpmd: fix mpls encap ipv4 version and ihl According to ietf rfc791 (see [1]) "The Version field indicates the format of the internet header." "Internet Header Length (ihl) is the length of the internet header in 32 bit words, and thus points to the beginning of the data. Note that the minimum value for a correct header is 5." Having version and ihl set to 0 would result in a corrupted/incorrect encapsulating packet for MPLS, this commit sets these fields to 4 and 5 respectively as the default value. [1] https://tools.ietf.org/html/rfc791 Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation") Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") Cc: stable@dpdk.org Signed-off-by: Saleh Alsouqi --- app/test-pmd/cmdline_flow.c | 2 ++ app/test-pmd/testpmd.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 5c0108f..c1c5fe3 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -3735,6 +3735,7 @@ static int comp_vc_action_rss_queue(struct context *,= const struct token *, .src_addr =3D mplsogre_encap_conf.ipv4_src, .dst_addr =3D mplsogre_encap_conf.ipv4_dst, .next_proto_id =3D IPPROTO_GRE, + .version_ihl =3D IPV4_VHL_DEF, }, }; struct rte_flow_item_ipv6 ipv6 =3D { @@ -3923,6 +3924,7 @@ static int comp_vc_action_rss_queue(struct context *,= const struct token *, .src_addr =3D mplsoudp_encap_conf.ipv4_src, .dst_addr =3D mplsoudp_encap_conf.ipv4_dst, .next_proto_id =3D IPPROTO_UDP, + .version_ihl =3D IPV4_VHL_DEF, }, }; struct rte_flow_item_ipv6 ipv6 =3D { diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 3ff11e6..8b0654f 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -22,6 +22,8 @@ #define RTE_PORT_CLOSED (uint16_t)2 #define RTE_PORT_HANDLING (uint16_t)3 +#define IPV4_VHL_DEF (0x40 | 0x5) + /* * It is used to allocate the memory for hash key. * The hash key size is NIC dependent. -- 1.8.3.1