From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720070.outbound.protection.outlook.com [40.107.72.70]) by dpdk.org (Postfix) with ESMTP id 05870239; Fri, 9 Nov 2018 06:50:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cHcurLZJH4A83PfkZ2yQ34NEFqdl3OzYfJaDpDZhRRM=; b=lPbOXpljkzb0TgWxszgcSGu2PqssTfItyJlSL5s2fUvuWmBmrq5Ji7ZMY6Ay8FXo80YUnBwbR1WJFyRXTvVxOArmMH2SxZcOVFOC5IEp9f0aR/k8BSo4pw2rOJymtLvER2gYrY57hjsh5+/j7giJMRQp2NSmRThfsOCLelRYyRE= Received: from DM5PR07MB3180.namprd07.prod.outlook.com (10.172.85.142) by DM5PR07MB3513.namprd07.prod.outlook.com (10.164.153.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.38; Fri, 9 Nov 2018 05:50:56 +0000 Received: from DM5PR07MB3180.namprd07.prod.outlook.com ([fe80::201b:173e:1856:e1e2]) by DM5PR07MB3180.namprd07.prod.outlook.com ([fe80::201b:173e:1856:e1e2%9]) with mapi id 15.20.1294.034; Fri, 9 Nov 2018 05:50:56 +0000 From: Nithin Dabilpuram To: "dev@dpdk.org" , "Jacob, Jerin" , "Czekaj, Maciej" CC: "Nilla, Subrahmanyam" , "stable@dpdk.org" , "Dabilpuram, Nithin" Thread-Topic: [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode Thread-Index: AQHUd/AuSS2AzzKAgEaWUfJgiWHgWg== Date: Fri, 9 Nov 2018 05:50:55 +0000 Message-ID: <1541742633-798-1-git-send-email-nithin.dabilpuram@caviumnetworks.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::34) To DM5PR07MB3180.namprd07.prod.outlook.com (2603:10b6:3:df::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Nithin.Dabilpuram@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR07MB3513; 6:sbxdhlHwtKS66Djk2UUYC6jjgIg9NMEj++Rj6Vpfh3PQm1zwO1M90QBAUlm7n0Kvc3e3GjG857zyeR/6bhGMpv215mmR76f46v33ag+i0rMkptp5Usqqf+o1DNhh8GUrOplOgdZ98r7nZ1AiE9bi07EAjSQATlf+swdk+vVgsOGmuX3yj6BpFt1UkwfAUU4qRpNk1DytuEBo5UgzWLbFe3JyTjj7bF0X2Eh1bx5ksQTIw+39AhZyhhPQcmdToh29wvnVpeZO52drLn/9HLI5vznb70mGjMyBUo/nleRS/nSY7te5HgzqN1lhKaez/4VspPnYPHDAxx7u4SxT9k+4L39PEnHz4d52JRREX80fQWD5d5ulcdDFPeIlZBTCkaquydh3cLeRlJ2wo4dTZOY2VDCBteHx8zsGom6a2h4EZo6CqN62iD01dHdAWKA/lmC4Zl8qG2kFAIjueDkpsd0u0A==; 5:RVmkgsdZKU4/0vwjRzjXRgUaZJ+zUUvB0ngf+VLfBSBu54diyu6pVBQZK/tr8PToPn1TtHMJRw3hnZe7tk9wzS/+nTUHQOrLr7IKLRkvgWaw3lxkU1CyTZaz3B2ln6N0oeSibLep37/Aq7NgLSFxnS3uUj+kd2b3URjnssgnWWQ=; 7:GpCgOziacko8DpuiwiyqqinsylS+PKuGs0sJq/y5agU141N59ayZogodErGVvEv3O1bhaVdVy9o2yO764B4KjyVboHqF08PusldZwlFyZXzbOdXV/PuOovHYy79edvvW6eqrprJJO6fmJF5z9fogcQ== x-ms-office365-filtering-correlation-id: a83fba7c-0858-4be2-ca2e-08d64607508c x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DM5PR07MB3513; x-ms-traffictypediagnostic: DM5PR07MB3513: 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)(93006095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:DM5PR07MB3513; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB3513; x-forefront-prvs: 08512C5403 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(136003)(39860400002)(346002)(396003)(199004)(189003)(81166006)(110136005)(42882007)(478600001)(8676002)(107886003)(2906002)(2501003)(186003)(316002)(99286004)(71190400001)(71200400001)(305945005)(8936002)(14454004)(5660300001)(81156014)(486006)(102836004)(106356001)(256004)(14444005)(54906003)(105586002)(450100002)(2616005)(4326008)(52116002)(1857600001)(6486002)(68736007)(72206003)(97736004)(53936002)(6116002)(55236004)(26005)(6512007)(25786009)(7736002)(6506007)(2900100001)(66066001)(36756003)(3846002)(386003)(476003)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3513; H:DM5PR07MB3180.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: kaHgAESEzYot5wVY2LdVAgXNz9w/FBDC3DTYE+2kPGtcUxE6v3Ri9s0I0ob4rews82PVIU5UJSe993UdtA2G+UyOVhiMDWxV4kqhdrWNyQZ0D4+7XrpMlcfPIxBQWly2UgY3JjaxbQZDKSL7LoEHEX274NIhezg7VZfvZTYf5q2Flrsn57myErszzvCVBI2B4s7VULF4i2cuABtSEFRfjRyYurk2Ame2SB6sjtXAQjVcPPU/rYDQdYEsNSMxXZPO+91ZYv5Kdg8KT43LixWm6LFW9cadQdmUYU3PhWKT/aU0t/g6tmSitIuTlFJwAH9k6iCAo733gp0T6y6Mf+uEUq4DJiTy4bRirQGFYvxr0uA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: a83fba7c-0858-4be2-ca2e-08d64607508c X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2018 05:50:55.7810 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3513 X-Mailman-Approved-At: Fri, 09 Nov 2018 15:31:15 +0100 Subject: [dpdk-stable] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode 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: Fri, 09 Nov 2018 05:50:58 -0000 From: Subrahmanyam Nilla For performance reasons, word1 of send_hdr_s sub descriptor was not cleared assuming it is always having default value of zero since it comes from fixed offsets of SQ buffer. This is causing issues in case of SG mode because, the size of send command might change and hence the word1 of send_hdr_s is not always at fixed offsets of the SQ buffer and hence not having default value of zero. This fixes the issue by clearing the word1 in case of SG mode for every packet. Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx") Cc: stable@dpdk.org Signed-off-by: Subrahmanyam Nilla Signed-off-by: Nithin Dabilpuram --- drivers/net/thunderx/nicvf_rxtx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf= _rxtx.c index 247c356..1c42874 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -61,6 +61,14 @@ entry->buff[0] =3D sqe.buff[0]; } =20 +static inline void __hot +fill_sq_desc_header_zero_w1(union sq_entry_t *entry, + struct rte_mbuf *pkt) +{ + fill_sq_desc_header(entry, pkt); + entry->buff[1] =3D 0ULL; +} + void __hot nicvf_single_pool_free_xmited_buffers(struct nicvf_txq *sq) { @@ -204,7 +212,7 @@ used_bufs +=3D nb_segs; =20 txbuffs[tail] =3D NULL; - fill_sq_desc_header(desc_ptr + tail, pkt); + fill_sq_desc_header_zero_w1(desc_ptr + tail, pkt); tail =3D (tail + 1) & qlen_mask; =20 txbuffs[tail] =3D pkt; --=20 1.8.3.1