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 A91DAA034F; Wed, 10 Nov 2021 14:59:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68C434068B; Wed, 10 Nov 2021 14:59:56 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 922B440142 for ; Wed, 10 Nov 2021 09:18:14 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10163"; a="230089324" X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208,217";a="230089324" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2021 00:18:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208,217";a="732439433" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 10 Nov 2021 00:18:03 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 10 Nov 2021 00:18:02 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 10 Nov 2021 00:18:02 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 10 Nov 2021 00:18:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kviaVhGjX+HpjgBlr5Hz5N1js0riPoRtvjLnlaeY6/JOTvIdZfYWTGBJ0FhDispWIvq1ShSIErRk7x/6EcJOt6HioSrcpw5LY8glCJL0Jgr5MujrFH1EBm4e1g1gxjgGmRP0Tu1s47nHskAHwFo7Y0S9FOyQzIcJPNtj4P83ZXydCV+zN5UZW7Y7AGYnY8qXAHG3AXD9BM29TwSnb33J7KmDbYRJdj2q/j0SEaTrtxwqPCAY0Jkg7oNAqq8zOugpNK8tAjYsv5CO4WyeJE6v3lyE0iAAETQ0rHWPaSWXwmSDLHPWJk6+J3SEGA+nLYkJVzw9lUc37IOd+W2d9c8N4A== 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=MZX/wH7lxLqF6ZpQQhXAS03v2CNub8wE7tq3hqGqLYM=; b=X65b6JF1zryHF0c0znw2eLBPt5+jhMcGJynVjY9AbUqF8jkUsmC2Z1sco5aXHM7RRXvoUecoCJ41DJKQmBxYqGdfi97G4dcmO5MDI61dYQskaSoh2Ml5y1eGLsgQ8ODSVa0+uhiTFdLgJWFaVAeGgejLyNdf4ABCdFf2RSxiTaI5v14u3/F36uinteYl6zKFEsYmmY6L0w9y0mkq+PoD14XH13IuC6KOtNAP6rRwkNHUBkrY6iKRClJYhSz4paWnWe2ZxhKEKyhJxEWPFNMSnx+fBWddliqXLTUsYushXj2XKlI6XhSUHi+ZRsC7NbEA02FM2SFLNkNAZhIB6QLbYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MZX/wH7lxLqF6ZpQQhXAS03v2CNub8wE7tq3hqGqLYM=; b=Cc/Cgq2Bbe/S0L5eVAmeXT6swicFkSxVgdmqy5QzVdJ+SFuu9eNb8gqFjSGDGkvqN7PRJrv9mLV2zWHPh6PlHFIBtfLYEbZvBO6Trt+cYjikXQp6cQHg95CbkEV3zqYAeEZl/jjCeFNqhZ0ZxM68eZNa8m+d4z2WJqL4eQqsrSk= Received: from PH0PR11MB5159.namprd11.prod.outlook.com (2603:10b6:510:3c::20) by PH0PR11MB4904.namprd11.prod.outlook.com (2603:10b6:510:40::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 08:18:00 +0000 Received: from PH0PR11MB5159.namprd11.prod.outlook.com ([fe80::892d:1e06:1026:6760]) by PH0PR11MB5159.namprd11.prod.outlook.com ([fe80::892d:1e06:1026:6760%8]) with mapi id 15.20.4669.016; Wed, 10 Nov 2021 08:17:59 +0000 From: "Xu, Wei1" To: "Lu, Wenzhuo" , "Wu, Jingjing" , "bernard.iremonger@inel.com" , "dev@dpdk.org" Subject: [PATCH] app/testpmd: fix parameters order when calling rte_ether_addr_copy() Thread-Topic: [PATCH] app/testpmd: fix parameters order when calling rte_ether_addr_copy() Thread-Index: AdfWC2I0yQfIDfUuT0qr7doTyxyMOg== Date: Wed, 10 Nov 2021 08:17:59 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd98d1ad-808a-4be6-4c94-08d9a4229bc8 x-ms-traffictypediagnostic: PH0PR11MB4904: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lX3SwZXqUfXQ1VneI61iOLHvHGIWljahH4+5mtMLkG7Iz4+y7mT7fbdaee9BtA2Q3p3cxkN7+7yGsH13ZnhZ/25gBH8FQHYcccAN+ubfAouQ1ldeqnbv4WqHHhq6luZvk7PWLU3yIS0TsbPlgE0BcggkBOv8NiP7J4TAZLrHd+atdQS9jfcMlqw6nhKOgd08/HyemRTbAldcqIP0L9MMDvDLVTfgacG6EXHKy3dfuQR6KUy5tzy6FEoYan2myRdtMg/Ro/3dntKofBFL0uPeAjrOx1YKg/phYISlap5UMSgBrok+nmv9prFKgMSMfnQa7NgJoM0Ex7iOLg4vgKJNqgTIKD7Te8pM2X08NO+HizoGsMNbkuVUXEPCPZWNx02oVArteLdljblAgEk5xvAq/Dd7S3iavtVFM3M8l/P7ACuPsMLnM3+2SI+3s48LvmDp29bOzB5LE5MNWBM8kDOV/dnRulEX42aX1joBQAx69cJOuVT/9Qq7VQpIFDAWedto+LbCGG/1Esem51AQY41Jp8/QOkZm/dNdb7xFTR3K6jHM5lbPte3/riou4ZOoPY13jxs3+lfaGt5nbVDikV6hWrEdYLq68ohyou7x6/XDd/+x+FzLXqrko8BJDBbV0/GbXPzAqJEBni5AoYS1tV/L/MCShT5FfEZx7jESHBygiLTSwUZ1IRPHjqLehhi8/IYjVQfC0ZxAR53xk0cN8l97xg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5159.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(122000001)(83380400001)(186003)(9686003)(508600001)(8676002)(6506007)(66946007)(82960400001)(71200400001)(66476007)(8936002)(66556008)(7696005)(2906002)(66446008)(76116006)(64756008)(38070700005)(38100700002)(26005)(110136005)(5660300002)(33656002)(316002)(52536014)(55016002)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TYq+7+5DTLfCJXj8eEQx8uCy7BxtV3qeg7KNgzlnfRht7K9Y0Op4Nt1wp1mH?= =?us-ascii?Q?CdijBnHoYSxpTHRiq4qvbnXIS/Ch2ffRQfH4ceQ+sDshgB0X2BTa5n2gAhxA?= =?us-ascii?Q?hB62/5hfiAI5ZXktOFIAipHcxHnbMkFdEEpj8Sp+KxkGygynr1nxv5Dq6ReF?= =?us-ascii?Q?rhqu5tvOOTDQ6Y4Sbfh11l/W94ILaLbScAcw26L5SE8L11FtYvwTJ+Y5jXii?= =?us-ascii?Q?P5mzCuNjllqWXcPxhhDeZBnKyHgcS2YOA5SqHu9rVKDO/wnfv2neEe9HpeFK?= =?us-ascii?Q?8ZHWMk2ONlmLLjuMZJ1rjjbiqb+mw/HruwuCqXhplyUkcSw0gI3lmcLBtY2Y?= =?us-ascii?Q?6d3k+emXltp3oQQbm8wOPOvf2s22XCE/pfH8GJBGcPx60rkB7zmWamO1T8iS?= =?us-ascii?Q?+gFvCyMrcs//U6VrX3T6vOwOFeGIOjk9TgiqzZSJoa04tvpIxHLZPCV92Av1?= =?us-ascii?Q?kq30Q2IvRt4eJ8FRELkc+TK9kEn2pWodHjySq9xIgtB9nl+JNH77UQ5S4feh?= =?us-ascii?Q?xHL5u5IE3JI3pBjC7EV0VHH80QMOf1jSjKBifOq7VZpgnpQrPuDEo7o+68s4?= =?us-ascii?Q?+pwsCXuUzuPfNdFv4s0NTU3cHzAcVpfdSrom/lMIsDzEUfqFxnpScF2fLJvZ?= =?us-ascii?Q?YXCY3qxhlq9VSvY4BuH1ZfTDYRz+Y25dtFA5qOXi1jzpMaW4UrxFFxYwhD7Y?= =?us-ascii?Q?nXZr27Gql2jQW658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fO7prJH96hvqIz?= =?us-ascii?Q?P+r2eeRn1ygZjkvPdosk8dQ=3D?= Content-Type: multipart/alternative; boundary="_000_PH0PR11MB5159C100715402B318E8B086A6939PH0PR11MB5159namp_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5159.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd98d1ad-808a-4be6-4c94-08d9a4229bc8 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2021 08:17:59.8556 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: doPuvcp08UQpfKQkdEGWmsNpNYt0SeRQiQuT9CuWhhSB3g1nj4O2A0NUgBGv9lS+s1Qnt7gdnuVxdNmd7+7YdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4904 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Wed, 10 Nov 2021 14:59:54 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_PH0PR11MB5159C100715402B318E8B086A6939PH0PR11MB5159namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Running in 'csum' mode, the 'from' and 'to' parameters are not in correct order when calling rte_ether_addr_copy() which means the src/dst mac addres= ses will be overwriten. As a result, the packets will not be recognized and received by the receive= r(s). Test CLI: ./app/dpdk-testpmd -n 1 -l 1-2 -a 09:00.0 -- -i --forward-mode=3Dcsum Fixes: 10f4620(app/testpmd: modify mac in csum forwarding) Signed-off-by: Wei Xu wei1.xu@intel.com --- app/test-pmd/csumonly.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 8526d9158a..08484fcda2 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -872,10 +872,10 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) * and inner headers */ eth_hdr =3D rte_pktmbuf_mtod(m, struct rte_et= her_hdr *); - rte_ether_addr_copy(&peer_eth_addrs[fs->peer_= addr], - ð_hdr->dst_a= ddr); - rte_ether_addr_copy(&ports[fs->tx_port].eth_a= ddr, - ð_hdr->src_a= ddr); + rte_ether_addr_copy(ð_hdr->dst_addr, + &peer_eth_addrs[= fs->peer_addr]); + rte_ether_addr_copy(ð_hdr->src_addr, + &ports[fs->tx_po= rt].eth_addr); parse_ethernet(eth_hdr, &info); l3_hdr =3D (char *)eth_hdr + info.l2_len; --_000_PH0PR11MB5159C100715402B318E8B086A6939PH0PR11MB5159namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Running in 'csum' mode, the 'from' and 'to' paramete= rs are not in correct

order when calling rte_ether_addr_copy() which means= the src/dst mac addresses

will be overwriten.

 

As a result, the packets will not be recognized and = received by the receiver(s).

 

Test CLI:

./app/dpdk-testpmd -n 1 -l 1-2 -a 09:00.0 -- -i --fo= rward-mode=3Dcsum

 

Fixes: 10f4620(app/testpmd: modify mac in csum forwa= rding)

 

Signed-off-by: Wei Xu wei1.xu@intel.com

---

app/test-pmd/csumonly.c | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)=

 

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/= csumonly.c

index 8526d9158a..08484fcda2 100644

--- a/app/test-pmd/csumonly.c

+++ b/app/test-pmd/csumonly.c

@@ -872,10 +872,10 @@ pkt_burst_checksum_forward(str= uct fwd_stream *fs)

        &nbs= p;            &= nbsp;        * and inner headers */=

        &nbs= p;            &= nbsp;        eth_hdr =3D rte_pktmbuf_mto= d(m, struct rte_ether_hdr *);

-        &nb= sp;            =         rte_ether_addr_copy(&peer_et= h_addrs[fs->peer_addr],

-        &nb= sp;            =             &nb= sp;            =              &a= mp;eth_hdr->dst_addr);

-        &nb= sp;            =         rte_ether_addr_copy(&ports[f= s->tx_port].eth_addr,

-        &nb= sp;            =             &nb= sp;            =              &a= mp;eth_hdr->src_addr);

+        &nb= sp;            =        rte_ether_addr_copy(&eth_hdr->d= st_addr,

+        &nb= sp;            =             &nb= sp;            =             &pee= r_eth_addrs[fs->peer_addr]);

+        &nb= sp;            =        rte_ether_addr_copy(&eth_hdr->s= rc_addr,

+        &nb= sp;            =             &nb= sp;            =             &por= ts[fs->tx_port].eth_addr);

        &nbs= p;            &= nbsp;       parse_ethernet(eth_hdr, &info= );

        &nbs= p;            &= nbsp;       l3_hdr =3D (char *)eth_hdr + info= .l2_len;

 

--_000_PH0PR11MB5159C100715402B318E8B086A6939PH0PR11MB5159namp_--