From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0041.outbound.protection.outlook.com [104.47.42.41]) by dpdk.org (Postfix) with ESMTP id 7D4441B446; Wed, 11 Jul 2018 10:25:10 +0200 (CEST) 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=N+k4fhZKscB2lPM5CXrKSCXqsCQbS3hzCpFvaYfYaGk=; b=FE8gVnAkBBl5nNLWaXS6cPeJhYYRA/kwSQp18SpaFIRLx1/ilvxBbbfbvVJdXHYht2neQwaARqOgzc9uZVFrfRSPAhUn4sFkQdhYAuobbCbuwQ8fjKV6xI+e2Sdh/A9+05vKg1o8UIlL+4v7Jnb2brOxfAxOVE0El62tVw7T9t8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kiran.Kokkilagadda@cavium.com; Received: from kkokkilagadda.caveonetworks.com (111.93.218.67) by BYAPR07MB4949.namprd07.prod.outlook.com (2603:10b6:a03:5b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Wed, 11 Jul 2018 08:25:05 +0000 From: Kiran Kumar To: jerin.jacob@caviumnetworks.com, maciej.czekaj@caviumnetworks.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, Kiran Kumar , stable@dpdk.org Date: Wed, 11 Jul 2018 13:54:36 +0530 Message-Id: <1531297476-4604-1-git-send-email-kkokkilagadda@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531293723-930-1-git-send-email-kkokkilagadda@caviumnetworks.com> References: <1531293723-930-1-git-send-email-kkokkilagadda@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR0101CA0030.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::16) To BYAPR07MB4949.namprd07.prod.outlook.com (2603:10b6:a03:5b::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65a5b041-982e-4e22-e94f-08d5e707cf86 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4949; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4949; 3:hddA0vgbrlv2l8eVuzyqKFfm4GCDhWVagXhYEGyLse5oWvxt7MAaFTnYtWxXQCso2vgieHP0FWOQGQwu2M+DYhneduKki/LORIyMxiw75YzjKP7YgBy8hFkVrBdUX8kGyF/oYK6GsH2f1UBpkwdLV51BJLw5BN22TBEJDQffeO2cQANAZ2rlU91q9wMPWuVu5xg3katEN2S7rcsQ/IxnKC17as6l2TbbCNxUHX0AQCqPfRCJ8+uwPG/Rqp1JSbe6; 25:QihfX+1ZnR7klUPdUnq8QXycKPv7CvST1ubyW+KxBXjwD1H3Fd128MXdjQ20IqvLRt+m6ApIvjBc8Jd9aD0Zf6Sjg9KF+xwFRsZzZQsQvYt4fE9DPFxmiPkvJrevOImfOTLWURPhvUV66D8SZjnpr0G+G7U9r5GKUyl7OI0T14Ps08EAdSA752mJcqnIPStn6ds8He36cIDRsNX4+DksfqdxFKrdN/11XLks5kB9aFo+QJJwTSeYE2+7DpeNo6rmUpZZdwcHC58jKgAwlVHyKHLkZ5fpe+0MafJWff8+LBNIWSozvuNMshTz4yKX2ov+/1rkT9Whm6K/PhO6rTNRTw==; 31:ym0reTygvrzd70umzHASSh5j24behQR18pYkGmVrvDOTgqHEw24RoD7GNWKmnEz1Wrteer/YfvhcOrOOSWy0Lkiy3pz0vhajO+zWtf6/pViDrFvJ7veE820C66Xp61GDKD8VTg7jq+6ZxyoivJUhBG9m22XQwbAvJPwnNX9TrAKKlzOFeYIgeC1N+JdhH1mJXAvPAm453iHf4CsrXS220WCXAWVHxI912HQiXsw1FpM= X-MS-TrafficTypeDiagnostic: BYAPR07MB4949: X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4949; 20:Y8jxv3WLFnabe8sViZ/+dN3Zspd3K8Xb/YRZQiYzB77rr7sM3D360L+mlOHpbN9v8kYo08CzXf3xKN0HnFx9gZIHUC4gxhoFxpWCrC/JnmsMl8IK44erWP0ob+QCgQS17SY6Rv7y6z6AuWZu/CB6zezWRlrKBElIvBodc9jU+G9BqaxPj9P3s1L0FvPwiwCTHqnvw1qLHP8vHQ5zBh3ozOn8/nzld3veLJy4epyA1K0SIDDW5IHiSQgP97XIX8qqyahhTNM3PoaWlQLFgab24TVgmj8nlusZuQip+44pJ8oxeFTrAo2AQZ+ArmCDztZ5KE/M/LPDLhgQmCfO7retTwSzTTLKGpK4QLkeqMc4afHS30OVKd8xAOq8pywLAvQLUmBgVXzZG42EEyurdHR73UJ79ujlimnSwsl5+OgMIRB6VytMES0E07JKAw8IaNTisgwl0PjyMQ9vDna1/lDOlVmZub+A1Nr3Uf4TfQduI/aN3PF69TrrtmgCURgD7slwI3YndXgIw3aRjCmsqLE0QSjdcKVWLmUyKab3XY/Tgidx58QkqWE1s/oGyYaNkfT1f95e6wle/HfD+9HenudsJSOviB1CbcM18grzpyNssrw=; 4:bUuT4BAUE57o/9dsz5GNKK3Yn3o2WVWk4fgqJTkpn9TyoivB/tbutxwvakmsWAVzf1A3eXuX3pfIPaiyqIqd5yjnk6VaVWvrGG7NbYG+vBi8lKbSlp5GLMuPQJX1LMDW8kYKCtq+EE5kBKNOETohp9R4dolA2N3kj0c1EJDLwvOL+DdwkMHubvYj24qrz3Uy3FRMyut1aq19QQy3sWhRsgi9tpDDdVbxDIK3J5i9DT8SEKn86BjK/hbSHtFenvHGhHTQzanRw5jO2Re0FVmhHQ== 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)(10201501046)(93006095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:BYAPR07MB4949; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4949; X-Forefront-PRVS: 0730093765 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(136003)(366004)(346002)(396003)(189003)(199004)(50226002)(2616005)(81166006)(5660300001)(11346002)(6116002)(53936002)(3846002)(69596002)(446003)(305945005)(47776003)(956004)(81156014)(2906002)(53416004)(105586002)(106356001)(66066001)(97736004)(8676002)(5009440100003)(6512007)(72206003)(6666003)(42882007)(50466002)(316002)(16586007)(4326008)(8936002)(6506007)(52116002)(48376002)(6486002)(76176011)(386003)(16526019)(25786009)(476003)(1857600001)(68736007)(26005)(51416003)(486006)(7736002)(36756003)(478600001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4949; H:kkokkilagadda.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR07MB4949; 23:1tDPrbKH5MoifFOGVHN+UUnnA1iyBDnXoJCXabg0p?= =?us-ascii?Q?YswK4nlzE4HIwZ3oy4KhSPLgjHy5xSwIf+X41jSPPe1Lu3xQgNuOjAgVUgg5?= =?us-ascii?Q?vC0V7eqtRcqIzLdI3MbXX+MHM41tIVmSzqoBn6pvgu64BR+02CZEeBH7HdT0?= =?us-ascii?Q?dL/uBRitf9vp6gV3gfh7TdbGk5ymr1NPkZzjrriI2W0FZHO2zw13q1CEtvSU?= =?us-ascii?Q?0Ol0n7MuMA+YduOWlnDR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xyk+8HjXuhdMQ==; 5:LJVq1YS3rQOYAWDl9sJn4QgiDPKAfUkhRnAgpPf1Lv1u3SkDBgJNOvesK3L84cKku13Ogn2UHltfh/3xZ1ADH9VLNe8AhTNlV7ulkErlo8apZYFuxx08MtDCbcgb8RL2OwHkE3H7p0OraIyQdHF8gS/c6teLvLTGm5CjgCI3BLU=; 24:g/F6vWALc17jTLtAmE5Wr+HRTxzlEdz+FAawbZuvMYPl2IUp7qND7YIPv7pLb0DrPMg1J+6LBABjntRfLuklcrN9zPCeqCOwtTEv/WHL354= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4949; 7:NfKOEWjISFVCJDgj9JMfXeVKPlvxRjji/YiD69rIEgFv9BwpCoLxsONRa0B4MP2psyCRln06GtATooHfEnlXiUAg/KLNPVjRVGfXR6OENNp70CXlIzJjl3uL1h/4Medfft2cn+GfSU+HKWA2LHEePS8R6RUQFF3ZQSyJJuob4nVj7so6ceMfJEIaVtVCpP8ISfct+UKs+uuYFhbJGpD3To1PaS58qaWQarScGABcW/jBfqDQV0Kjwtnssy5Rhkce X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2018 08:25:05.7854 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65a5b041-982e-4e22-e94f-08d5e707cf86 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4949 X-Mailman-Approved-At: Wed, 11 Jul 2018 21:19:23 +0200 Subject: [dpdk-stable] [dpdk-dev] [PATCH v2] net/thunderx: avoid sq door bell writes on zero packets 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, 11 Jul 2018 08:25:11 -0000 Avoid sq door bell write on zero packet case to reduce additional traffic on register bus. Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx") Cc: stable@dpdk.org Signed-off-by: Kiran Kumar --- v2 Changes: - changed summery and description. - added same optimization to nicvf_xmit_pkts_multiseg drivers/net/thunderx/nicvf_rxtx.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c index 72305d9..6e075e2 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -162,12 +162,14 @@ nicvf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) free_desc -= TX_DESC_PER_PKT; } - sq->tail = tail; - sq->xmit_bufs += i; - rte_wmb(); + if (likely(i)) { + sq->tail = tail; + sq->xmit_bufs += i; + rte_wmb(); - /* Inform HW to xmit the packets */ - nicvf_addr_write(sq->sq_door, i * TX_DESC_PER_PKT); + /* Inform HW to xmit the packets */ + nicvf_addr_write(sq->sq_door, i * TX_DESC_PER_PKT); + } return i; } @@ -218,12 +220,14 @@ nicvf_xmit_pkts_multiseg(void *tx_queue, struct rte_mbuf **tx_pkts, } } - sq->tail = tail; - sq->xmit_bufs += used_bufs; - rte_wmb(); + if (likely(used_desc)) { + sq->tail = tail; + sq->xmit_bufs += used_bufs; + rte_wmb(); - /* Inform HW to xmit the packets */ - nicvf_addr_write(sq->sq_door, used_desc); + /* Inform HW to xmit the packets */ + nicvf_addr_write(sq->sq_door, used_desc); + } return i; } -- 2.7.4