From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50058.outbound.protection.outlook.com [40.107.5.58]) by dpdk.org (Postfix) with ESMTP id 0AB51548B; Sun, 11 Nov 2018 16:31:40 +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=/7zlysFOt1eH26U2XBPH7hk1ckXd4HqEIA0cm2VN8Fo=; b=fkAGs9OraOgaKzRHhyewkhrkrB5ml1GoZE92hT6xS21B+CA9s7rw6VYqHrp82ELK6BN+oZHvp0ZE6bB8+j6t4A61mEzXc6YqgDM9rVZ0dKbjm+R4+QmM/JrR3kQD7ITbsFbMwgvWiZmVldhVY3SCXrPlB240FP/BdDHV1JWOLAk= Received: from VI1PR05MB5935.eurprd05.prod.outlook.com (20.178.126.88) by VI1PR05MB1693.eurprd05.prod.outlook.com (10.165.235.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Sun, 11 Nov 2018 15:31:37 +0000 Received: from VI1PR05MB5935.eurprd05.prod.outlook.com ([fe80::281d:aa3:71fd:f79d]) by VI1PR05MB5935.eurprd05.prod.outlook.com ([fe80::281d:aa3:71fd:f79d%3]) with mapi id 15.20.1294.039; Sun, 11 Nov 2018 15:31:37 +0000 From: Raslan Darawsheh To: "jingjing.wu@intel.com" CC: Shahaf Shuler , "dev@dpdk.org" , Thomas Monjalon , Raslan Darawsheh , Ophir Munk , "stable@dpdk.org" Thread-Topic: [PATCH] app/testpmd: fix set L4 len for UDP packets Thread-Index: AQHUedOiyyfow9TFi0SM5fIiIL7WkA== Date: Sun, 11 Nov 2018 15:31:37 +0000 Message-ID: <1541950288-10800-1-git-send-email-rasland@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: LO2P265CA0220.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::16) To VI1PR05MB5935.eurprd05.prod.outlook.com (2603:10a6:803:e1::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB1693; 6:ZeoAV9gnTspMOfCDSdeeNMa6cotg2AshgenJWYH8Jt08lOnCXKtn/cW8D5wMROevdguYQMgeznQUn3AlG4IvnnBXRA1PjYjyDVDI/tjExgtEgRH95rkjMS1vFXFiX9ERnr9209m25wOtrv2SsA4kcv9HHXYczZYMIswQFJwywo166ZE4D+dv7fClvhD08ThmZvh77EWLxbDDZRPl+cuINSXSxuuj4/eweNdQAEXRJtZw6DCb1JAXZi/rzhujGTnuBVP3PHL+zhX7Wr+f/p/+qAbIoGFKzU2R5gwvjUJwYuX60ejNI6gVmOarTyMz/4qt3KbqcQQG6n7n/JpbixhulDvF8thQgQADvWQJOJD9XOtuGKdGOoYoQUk87JnTvJa5X7AdzVks5wx1CDCSwPm4gxyqtsYkVcTviDHcYXPvHJ34uIm8dSp3JSvu+QNrnOezb8Ir1+KPB7SM7+XPJDDrOQ==; 5:5VhYRpjbp777hNtVVb/b5TbgVzmsgE89gzIMMFDF0dtOUcLQsrP7cykse/k88AUo8s0sw3tvtiCJPY/VA/R3BHvYpMzzHhYs8qnkoG6JuggIc/4Fm7jnUGPJGnnXPk+z47UAum57q/bEGJTkg/VeVJHAaNhmbdyJYNlp09dvZ+0=; 7:hfGerb4v1JoKooxkUBjgsd2McLval6KTXMoHjmXbI62npJCIgHMR8Xbsgw5Tp0XIsS8Eq8izUz0IXurn0Al2oKUjCR5NtgsDZMLADOywkYlPbRG1COy3sdTfKTDNWwdbcIULiOGV3J2UchCPIEf6bQ== x-ms-office365-filtering-correlation-id: 53847f39-e223-4a6b-48cc-08d647eac4f1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB1693; x-ms-traffictypediagnostic: VI1PR05MB1693: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB1693; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1693; x-forefront-prvs: 08534B37A7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(396003)(346002)(376002)(366004)(199004)(189003)(105586002)(7736002)(2900100001)(305945005)(386003)(4326008)(6506007)(486006)(68736007)(36756003)(256004)(6916009)(66066001)(25786009)(106356001)(26005)(14454004)(71190400001)(71200400001)(102836004)(8676002)(52116002)(478600001)(99286004)(2351001)(6116002)(8936002)(81166006)(81156014)(2501003)(97736004)(3846002)(54906003)(86362001)(316002)(186003)(5660300001)(476003)(6486002)(6436002)(2906002)(1857600001)(5640700003)(2616005)(50226002)(53936002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1693; H:VI1PR05MB5935.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) x-microsoft-antispam-message-info: Deb5+lyGQoXVKAvGl+W3B2o/mC4rAM8NPul3RiIxSRK7ok6TP/3XHq6iDvEeL1F8/J5QqPL9WKPMKtLpViivQq61zLhI0KZQ0N4DUJAyF7wsRPAsBqKxQnukQHz94TQ+1iA2dfx3N0kpg3+xxIVV2/v8Cyo/BLh3zx++inttng7TxWRm2WLsA7ufZmjg8TexUoGIZ1msJn9j8C7KH5mMDKuUeKYFtMyblKVN6/M/9O6GwwvPKBkh9SjOJvmD5X8nWamVysAe9P/4iSCGfZ8nUscOQsxvdDk2YSzoB6UpdYpq4JXsZcKj+FZMsVpehagMxY9HIXRBNrv4cKKrnD0Rqct/Qc8w3i+ZeJh2Nc81Qns= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53847f39-e223-4a6b-48cc-08d647eac4f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2018 15:31:37.5062 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1693 Subject: [dpdk-dev] [PATCH] app/testpmd: fix set L4 len for UDP packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 15:31:40 -0000 testpmd only sets the L4 len in case of TCP packets. some PMD's like tap rely on mbuf meta data to calculate csum this will set the L4 len for UDP packets same as TCP Fixes: 160c3dc9 ("app/testpmd: introduce IP parsing functions in csum fwd e= ngine") Signed-off-by: Raslan Darawsheh Signed-off-by: Ophir Munk CC: stable@dpdk.org --- app/test-pmd/csumonly.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index dce4b9b..ffeee20 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -111,7 +111,9 @@ parse_ipv4(struct ipv4_hdr *ipv4_hdr, struct testpmd_of= fload_info *info) if (info->l4_proto =3D=3D IPPROTO_TCP) { tcp_hdr =3D (struct tcp_hdr *)((char *)ipv4_hdr + info->l3_len); info->l4_len =3D (tcp_hdr->data_off & 0xf0) >> 2; - } else + } else if (info->l4_proto =3D=3D IPPROTO_UDP) + info->l4_len =3D sizeof(struct udp_hdr); + else info->l4_len =3D 0; } =20 @@ -128,7 +130,9 @@ parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_of= fload_info *info) if (info->l4_proto =3D=3D IPPROTO_TCP) { tcp_hdr =3D (struct tcp_hdr *)((char *)ipv6_hdr + info->l3_len); info->l4_len =3D (tcp_hdr->data_off & 0xf0) >> 2; - } else + } else if (info->l4_proto =3D=3D IPPROTO_UDP) + info->l4_len =3D sizeof(struct udp_hdr); + else info->l4_len =3D 0; } =20 --=20 2.7.4