From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0054.outbound.protection.outlook.com [104.47.42.54]) by dpdk.org (Postfix) with ESMTP id 7A2B41B44F; Wed, 11 Jul 2018 11:06:14 +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=/iaQ+Sn3BdI+LQje3p4UF1YVkOx9VpIBVuXtTqP0sSI=; b=jW8q+t2HS9o1YBhfCRUbD57NEnfZnLKiKUrLt7PL523SLI2E8oVCu4iqDyCeVvTKbJMYdrMT47WLXQAufDOtE+6KIgAXr9byKSp9jEtdrDCyBkUU367+nlphS3sl38A/mc8mW2n2O/x4dnNOe60Vx4XFlhDyvA0VD1xcned/H4E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (50.233.148.155) by CO2PR07MB2517.namprd07.prod.outlook.com (2603:10b6:102:12::23) 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 09:06:09 +0000 Date: Wed, 11 Jul 2018 14:35:59 +0530 From: Jerin Jacob To: Kiran Kumar Cc: maciej.czekaj@caviumnetworks.com, ferruh.yigit@intel.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20180711090557.GA22077@jerin> References: <1531293723-930-1-git-send-email-kkokkilagadda@caviumnetworks.com> <1531297476-4604-1-git-send-email-kkokkilagadda@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1531297476-4604-1-git-send-email-kkokkilagadda@caviumnetworks.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [50.233.148.155] X-ClientProxiedBy: BYAPR02CA0060.namprd02.prod.outlook.com (2603:10b6:a03:54::37) To CO2PR07MB2517.namprd07.prod.outlook.com (2603:10b6:102:12::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5c184df-6036-44e8-bf1d-08d5e70d8c0e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:CO2PR07MB2517; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 3:9P0E8NTkLw9P+h17mgyC1AGCb46uvM6DpJQrNCVVO9wYtIChQ03dAM0ySu8gbbYN5fxqHINxx/lJ/W56P1pgFsCF0BTTI9w8+0UxakfFEqucKvI04dqiURc+BVa8pVqjEsgDEPLXaHNXG/SYUpzhgYOGeZzYWDlMFo6DYGb6c8A3OlenhKmvbPJQBg1G2q7LAgOmrahh4PNdyjCWQooyE+MLgPTpHJhZsS1gYmQqWGXqn15guY7jxImGZW4NGV5Z; 25:KZUQ+w6979vvfwBwcmqSucIgSGC2/GAQmhZREZ62+BzhctYENnmmU+c6hq9MngYaS8q5WDGKIYEdrTERbGkub9ebe88Dd4PidCUf5uU+YmsRXgYSnG8nyeJEXD/IuIW+CdvfHKMJkZ5fwnyefgyEXFl3a1tOTvVfxC3U2WPb+T7/WvKK+ERuTl3O35BMoyo2ExaEINt64rEse4X7x4snfbarC2x4tyD+UNNq5MYiIbjfwsNJS+NWh/AS/lUuoJHdXowLPwOKZIYW6eMB5AIkkWxihDyjcgKINIReQ+tfsG8nL1Mgpz3giTk5nTQS6bosyAppAe3C9k0qw7XDOe5YbQ==; 31:SZVUkCuh/2YY74dQ6a3we5erMTcmGoO8MAr6H9tZ70Gm6hBL1kZP6LtkmzlSuRGuLtFgk6ffzlizYhrPA6jA/7W0mTaRDBf95sh5i0UWWI811ErX26DIv3U+QEHmExlwm7nW5Om6Sh1LJj1K7mAMWxR2Iqw7BKSQCNi00ga98I1GbfbhN0SxA6RO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cscHREizyUzR X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:CO2PR07MB2517; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2517; X-Forefront-PRVS: 0730093765 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(346002)(376002)(366004)(39860400002)(396003)(13464003)(189003)(199004)(52116002)(6116002)(8936002)(55016002)(3846002)(4326008)(9686003)(81156014)(6666003)(33716001)(53936002)(25786009)(8676002)(81166006)(6636002)(6862004)(23726003)(68736007)(1076002)(97736004)(7736002)(5660300001)(2906002)(229853002)(446003)(476003)(486006)(11346002)(956004)(106356001)(105586002)(16526019)(47776003)(16586007)(66066001)(58126008)(316002)(44832011)(6246003)(42882007)(305945005)(33656002)(6496006)(76176011)(33896004)(386003)(26005)(50466002)(478600001)(72206003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2517; H:jerin; 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; CO2PR07MB2517; 23:CrH49CRUOwedi0kbqSBRbhjUD7O1wfziqyanyrL7m?= =?us-ascii?Q?nvdEWiTQQhToujBsYPul/BU2B6fF8o7rFhjGvrYw76rQRR6J8/XvBDhXh7Rx?= =?us-ascii?Q?pylCxKu1edd4YAA+zOu/UMnruAC4i0oDI0+LjEkghLiTSj/d0xaDGkHYxau5?= =?us-ascii?Q?sC/Mh81q2YFsW7ERp2Oqub2GJIJ76TUigbMFirtPMTe0kfLWzRcHIjMVVVeN?= =?us-ascii?Q?mg7RvCk+BvGNle1F32ZuMN/m/w68WEgl4uYfUSaCh6ng7JzANCQwrZofvvuB?= =?us-ascii?Q?RRpTTuU1yQrnD6o3Yq8DN5RerNYq37ryEXjo/rzY4me0ZPgzL8qa4s8j5uHI?= =?us-ascii?Q?weOAPcoRCr459Pozn5BC4QNx6VnNMxZHsI3jHDdswqh+MZS9zAgNoUA/22et?= =?us-ascii?Q?TIHHkziKk691/tLhRbKcjeV5XMDA8cIhYaD7bhff6ceROcud8w12ORq/tsVD?= =?us-ascii?Q?VYo9i5time+u3tU+kpyNdcr8QKuyd4/8sYMEO5lScNyW/4kJQzrclCBfxBhS?= =?us-ascii?Q?lAJiU+nmBfK+tpc88U0o9Q9teWDyybegpEPgKwFFfFRPQGJTqVfEkbOBtAZa?= =?us-ascii?Q?f7ylhPyJJRpB4A4YAuoXq5GZjtuqIzADy/d13OLhKdrxxwSctuZbOun/o/xk?= =?us-ascii?Q?mCJBSVsuzv77RDn1eF8V89WJo445/6oi1Mwv+S8JCqIw+HYNxxgwe3OYzL5g?= =?us-ascii?Q?s/nRcK6i60Qu+OA9IHxA/Pr4M161YVqOQtsZDxzXANDB+dUbdks9NdhpqDGo?= =?us-ascii?Q?pOAZELlvsuZPafSVRaCeeCn7zQGcjJrpeIs6OtDOcIgqJtjadRM6xvefDfxn?= =?us-ascii?Q?XfmB8AnezAYveqfOlwyILjHgs88bxFRI2oZzbaSv8ypjHLIBY+zENAl0GpYs?= =?us-ascii?Q?HBGCtrbZEY/jjCy6S2GjtTscSTk4qJMsX1VEeFs+WwwnR/cLs8shmiyUcWEt?= =?us-ascii?Q?ZpNqnQctXOyoNmsV24KoPNCWSmLWoA/hp0HE1hKilXPL0aus37gSInXNnWIB?= =?us-ascii?Q?Z+46qVao49yG/krFpMrvr5pjyhkXvWNzdH6THUe4LE8yXVToc12Z2nsWZKZK?= =?us-ascii?Q?2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fxnSTpwULZol19v/+OPnk8Pf5GZZyurYBmTMICl/nHwo+2Ng0DR6rxFJ2KuJ7JacwBAHlqXuVv4i0smxxz9IXhAaSSVxTtR1l4t6syt+ZeIVZJ5LzOnirXJWOkQh2/B4E6Yc/SleA==; 5:bZEHu04deNF7C4aV8xwaOJR0shShXwPKpWSbA3ajDZnQgOaFYfx0MgOzJH6GbRyHOu0ZHzPdDYKK9cO7Lahs4MopGegZ7I6PfbHCfT4WroBSHgAKIhnsCYcLGzytLxQOtCdMAzC6G9NP7GXzu2ZOtI50TttHy23e6D+o0SxVk+k=; 24:7D7kz3fpKGbvxwZxtebU1r1TeRMKwrWDbZ0wT8c/tbt4YNkIAqZDb5wOR5SMkrmb9d5g4ARrzmB3WjbTDoEhSH9wn4zhwz7ow2oeg9hH2d8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 7:opD9/cS1cyFRe0BmynXxML244h+XARSU8IzLPXxQwq9RJbs0URJdr1pdtDvjUeoZmOWDu3hQ0lTu3+WS+I9bL98WvK3xMj/90cX2Uk5/MuYx15OzOiMI6bth8mU+lABmLKRXp0EETHTwokgYTuR2TthRZqpgN6znK8b40DkFsyRGxLnfZ9L+gNfOLfegFJOBT5SBd95L3qsTyVJh4VPNJ/CKGolvSi4Wfe644KKM8idbrbJQy0LcO79weSht+GdQ X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2018 09:06:09.0662 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5c184df-6036-44e8-bf1d-08d5e70d8c0e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2517 Subject: Re: [dpdk-dev] [PATCH v2] net/thunderx: avoid sq door bell writes on zero 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: Wed, 11 Jul 2018 09:06:15 -0000 -----Original Message----- > Date: Wed, 11 Jul 2018 13:54:36 +0530 > 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 > Subject: [dpdk-dev] [PATCH v2] net/thunderx: avoid sq door bell writes on > zero packets > X-Mailer: git-send-email 2.7.4 > > 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 Acked-by: Jerin Jacob > --- > 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 >