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 1561EA00BE; Tue, 14 Jun 2022 11:44:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0843E427ED; Tue, 14 Jun 2022 11:44:18 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id BD3A940C35 for ; Tue, 14 Jun 2022 11:44:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655199855; x=1686735855; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=bEkntR071fkMjxQPTr1tMuiG4JOWq/x14O98fA96uhk=; b=T3zCqVkDcUIVtQMOo0ay3l0wFyuFZ7552k9McJBCyklvyYS/5nuojbQJ HkSrI7+vIdjHPwpK0kA8M3tda2/605kPEm8SNV6jPMQh7lIVKwtFDgU0o n15okNEFtk5yXqUGw5UZqIvLxG7Y3Z7WM6UULJmmkQ2qw8YrRgqvRuZAX C9TwLaFNHxbLAzwEH86wRN+NrooLbXbwR0qu7jC22tY+6WPRkk8cWOKQu J+lj3vkz6wGH6S2F5Oa5GbIlHg3c1McEl3GtYGMKGvDvGBt6c9UAz1zIK jE3Ea8mrj4G/TzPvYgMZuH1yk2Zw5H7zYRbPgcoaX5uw2S8uynCyBQa6z g==; X-IronPort-AV: E=McAfee;i="6400,9594,10377"; a="364904725" X-IronPort-AV: E=Sophos;i="5.91,299,1647327600"; d="scan'208";a="364904725" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 02:44:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,299,1647327600"; d="scan'208";a="910907361" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 14 Jun 2022 02:44:14 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.2308.27; Tue, 14 Jun 2022 02:44:14 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 14 Jun 2022 02:44:13 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 14 Jun 2022 02:44:13 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 14 Jun 2022 02:44:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aCO3Mc7KvjRRSZYhCijF7hnMQAViZ22QOMf17v2zLYp7RlTs7CUNfLU/UnfteXh9ymTVzSHBbKlqR7RPwtq5c7l8z9jFKdupX4wY3q6Bh1bTqG8fcmBsoADaQvM4jTe1NXx3FzpUmgORrv4Foycm8uK+Mtg37JMZWgvdXzjjYWtqrKud4Oqum3SLHP2PlM2mlXNRVay1vhXMwlsuKk1ZthqfaVQSAndXr9/ee+75wrxJwewdKSwZhQUfzmTWxCS0iHtXuutVMCWlXtEi90cKYV2X6XEXr879DEzIeYHPTA6Mpv1TP7Yrni8Tat2jpOCdukTOge8yNeQo076uuBzscw== 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=22TuBowOQCuNH4STm0IBTniyHjPNY44U4Bqa0n+s7RQ=; b=RNqwrI9gRbQtQNNDSNuBnlTxPeyHy4kWsiPioGnpLSTgczo5719ogbdQteiUZYdIdABGet5F8dGczL69Vpox2sCUlA/SULrxsCy6PwU6ENXNAWBXRbyQR1lnuU8Y3Kbiykhey/eScTwS0b8O58WX7HarYmYFs5959qfxvLJkpkhQFIEocTmiWnkSHK3AcIv9Z748yV9j9CbFLUKsTz4zcI3583tYqEt+lLYBU5EMYDVahyHAValQEpN79Wn6Qg0YbOuU/klk3wP5TEKCWyPTD6uaxOyiFTXdgWAJNjYhvWBcQ78QAA6w6HjtQGY4ZQxd+hNePY8Vinc61lGB82Gozw== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by DM5PR1101MB2361.namprd11.prod.outlook.com (2603:10b6:3:a6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15; Tue, 14 Jun 2022 09:44:11 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::28de:cb68:fa21:3225]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::28de:cb68:fa21:3225%6]) with mapi id 15.20.5332.019; Tue, 14 Jun 2022 09:44:11 +0000 Message-ID: Date: Tue, 14 Jun 2022 15:13:59 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v6] app/testpmd: add Host Shaper command Content-Language: en-US To: Spike Du , , , , , "Wenzhuo Lu" , Beilei Xing , "Bernard Iremonger" , Shahaf Shuler CC: , , , , References: <20220607125942.241379-8-spiked@nvidia.com> <20220613025006.1596552-1-spiked@nvidia.com> <20220613025006.1596552-2-spiked@nvidia.com> From: "Singh, Aman Deep" In-Reply-To: <20220613025006.1596552-2-spiked@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:98::9) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac7f4c76-0c82-45d9-aadd-08da4dea6f58 X-MS-TrafficTypeDiagnostic: DM5PR1101MB2361:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fOGWDWbJyq9T2DTS7KSX3IbcilL38vH+OzTXYXQvIbZUnR5zFN6jZ4V/9F6qeStW575xzVp+2GkXVTy7agf60tSXv0gf1YtlflUYLQMRVeMScB1Rj1hl+7yq96gQcZ2pubM2nMhCDwaqcb0j95PDXWBk3bVzB642algub36Qt5oGyQ0TWil6IZY9iSoGBy7NXkkty8R2sde40ipZQ5PYAcYHoh/whVimlNdc6X0iU+EbDK5BB0LfwFDejevqF+w00ASVy+WKqNdaMwXH2MetuB0lPHih0r76B4mo26i8sacWbV7rOOq/iwZ0Ak90byos1q3ke60QHKg0m0Nr0QeiWQmJpmNbadiAOyUD4tSn+srw+JE9mN9N0l146Vodsa/z1s8k0FuZ5tv+1WLwRJHjaIB/x0kWmEdT8Prf9wwSIsJeLAP2EFJrJrXA/1xha6bcRgVQwNpxspc+uPM5WDmQ4B4sVpwt6qR4SvoaJdhK//sB3qKEaYy6xD0DJWWs30MGF6XjYGzxiB+aUlH4PBXZcbT/1XefcEl1NPV5uo06veBj3eRWY5n1xlrBaTQHxEUAAXCEiBdFlcEbczI7Os87An8/nLgsNk+cil54iN7VVYRubbU2gPXvxwco5lGeuoo3Dl7s5mcVERt7DWEUjRxxf6B2JK/L3S9RmoLQKSI6zfWXHR+ASE8mTJFPWmjQ41JUNgQ51vwYM6okMTMS0iS138kqRBuJciL9iy6QRM/BBUU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(38100700002)(7416002)(31696002)(66556008)(2906002)(66946007)(86362001)(26005)(6512007)(316002)(5660300002)(66476007)(82960400001)(186003)(2616005)(8676002)(4326008)(6666004)(31686004)(508600001)(6486002)(36756003)(8936002)(53546011)(6506007)(110136005)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UDBDcml0cFRLYXZMMCs1L2JDRERjZmdURHIrZWNteC9mVDFScjM1NG1aRjBS?= =?utf-8?B?azJwdExmVU1KZFlDOHpSZ2JJWVNLcVVyaC9icklpL3NmdElCRW0xVnBNMlJX?= =?utf-8?B?SXRWRmo4VndZTFNmcUl5a1kzblFRL20zek04Tjd5Z2NsTEp3d29Rd05SSk1P?= =?utf-8?B?NGZtRmRrR0VWUmVzelZzU3BUOWpKbVNwblVnNzRIUHZBTXFsd3lRQzllNVR1?= =?utf-8?B?SjAxUDhheVV1T2VIaVpaSWZlTFVPOUU1RG1CUVFMTGEwTDIxR3JhTzMrYzlK?= =?utf-8?B?Y2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3BodjR6NDUwdTN2TGY0eFB4aldm?= =?utf-8?B?Y3V3Y29YMjRReDVkNEM0bVR6YWM5NTYycVl1VXAydksyOXpHVXhJTUR6SVFx?= =?utf-8?B?VTdsaWUxa1UraloyNVh0NjNwSGxuZFF4M3QzZzNVZ29pWFpNQmJlNXNPbG1h?= =?utf-8?B?eFR0NGJjTWFIQWdZOWZkQWZnKzZ3Rms5d1lMZ05zZXpOd2FDbmxtci9LTFNi?= =?utf-8?B?NHRnOXl4OWhyTW1UK1FDUTdJd0F0N2RENFozSysvb3RxKzlvcGlieDl6M0RB?= =?utf-8?Q?q7Ab5YYU1wQgpnkQ=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ac7f4c76-0c82-45d9-aadd-08da4dea6f58 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2022 09:44:11.5707 (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: hb5UBgaPJ80CXGneaatHaVThdQppSFXzWps6J+1gfO1gxU99RUsBdrkazWfH6V6zkxKvCJXcsen0Y9Y3IKSyRONp3H/h+eikPGrMzBAFGNk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2361 X-OriginatorOrg: intel.com 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 Hi Spike, On 6/13/2022 8:20 AM, Spike Du wrote: > Add command line options to support host shaper configure. > - Command syntax: > mlx5 set port host_shaper avail_thresh_triggered <0|1> rate > > > - Example commands: > To enable avail_thresh_triggered on port 1 and disable current host > shaper: > testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 1 rate 0 > > To disable avail_thresh_triggered and current host shaper on port 1: > testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 0 rate 0 > > The rate unit is 100Mbps. > To disable avail_thresh_triggered and configure a shaper of 5Gbps on > port 1: > testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 0 rate 50 > > Add sample code to handle rxq available descriptor threshold event, it > delays a while so that rxq empties, then disables host shaper and > rearms available descriptor threshold event. > > Signed-off-by: Spike Du > --- > app/test-pmd/testpmd.c | 11 +++ > doc/guides/nics/mlx5.rst | 46 +++++++++ > drivers/net/mlx5/meson.build | 4 + > drivers/net/mlx5/mlx5_testpmd.c | 206 ++++++++++++++++++++++++++++++++++++++++ > drivers/net/mlx5/mlx5_testpmd.h | 26 +++++ > 5 files changed, 293 insertions(+) > create mode 100644 drivers/net/mlx5/mlx5_testpmd.c > create mode 100644 drivers/net/mlx5/mlx5_testpmd.h > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 33d9b85..e1ac75a 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -69,6 +69,9 @@ > #ifdef RTE_NET_BOND > #include > #endif > +#ifdef RTE_NET_MLX5 > +#include "mlx5_testpmd.h" > +#endif > > #include "testpmd.h" > > @@ -3659,6 +3662,14 @@ struct pmd_test_command { > break; > printf("Received avail_thresh event, port:%d rxq_id:%d\n", > port_id, rxq_id); > + > + struct rte_eth_dev_info dev_info; > + if (rte_eth_dev_info_get(port_id, &dev_info) != 0 || > + (strncmp(dev_info.driver_name, "mlx5", 4) != 0)) > + printf("%s\n", dev_info.driver_name); > +#ifdef RTE_NET_MLX5 > + mlx5_test_avail_thresh_event_handler(port_id, rxq_id); > +#endif > } Wanted to check the intend of above "if-statement". Currently i think only print() is dependent on it. Do we want to call mlx5 event_handler, only if driver_name is mlx5 ? > break; > default: >