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 29537A0C54; Mon, 9 Aug 2021 17:18:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C689F4068A; Mon, 9 Aug 2021 17:18:33 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 2FE624003C for ; Mon, 9 Aug 2021 17:18:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10070"; a="212856593" X-IronPort-AV: E=Sophos;i="5.84,307,1620716400"; d="scan'208";a="212856593" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2021 08:18:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,307,1620716400"; d="scan'208";a="514991579" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 09 Aug 2021 08:18:30 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 9 Aug 2021 08:18:30 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Mon, 9 Aug 2021 08:18:30 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.170) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Mon, 9 Aug 2021 08:18:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1SQ/8VVVr6Zm0i+RbkzTqu12emBySpoQL4rXebFahS3wZEo4g5CsLgAiKDg3Cnv7CJ3D19kqVdS2JfdMI031OD6+omuFNCv0agRBf9c/OEhC2naJkjtYXiWQkHt3sUnG8zGGDaKFt9/DM090kCltotJIAbACMlv4oFnaXY9duBli60uumiaVdF0MxtjCIOIwwCHi36/H6RGr62Es5/3AnyCeWmBQaGMaSdwIf/lr4eBncUF+dEKacalqd0/5o/3vC4NBuvK5j+5KcMgJEGCH0O39cX1wK1dic1c46n7oVR+vGoydof3/9yZ5JHV7u0XJy2Qiru1Qipj8a1AmwFvuw== 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-SenderADCheck; bh=5QsFKBpW4QyAKXeYNaXFBlvZuKt2Ex7HXpowLqfCW00=; b=HOHUyxeVa8noA4qirlEfgn6zwTNF6sAwSZcgGpgDluecEYUmTS305RVXj8QGcszwj7SSm0kUMXlTevpZbIxWXAOzw+HSPdfssEgbaokJPGNWX+HLJ0nb67qpGIGYEHigjJT7mgNtFUeUwF0VUsizkCM1OF+p5lsuzJ9GN8rdX6oKDIy8uPQjtwyeVUGA9o6UIug4BhCwcUHJnUOeXL3ecTgvDbFq7DuBTw2HqJeJ9cP0ihQzMmSE4Bw8cO7TtXXSboEX9C7ShjZW3muiggzgkw1Gu0CAvrP1gTSPf+6FiFEIE3DHJVVeq5EfiJFfWa5Sw0xT487uhDaXIuHGNWxx6Q== 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=5QsFKBpW4QyAKXeYNaXFBlvZuKt2Ex7HXpowLqfCW00=; b=qVNwo4Jt/3y+p5vipIbGknDgvkVojYUW51eENioG+Crpe/C/bTxpRGjM3n0U1dgrO6QRAnuFA4HgKnsCh6q+gmK7qCQEo3lQQ2wSNWAD0mLPK8gzls5uLW5FIiJVSVPbZN2OoFBnAExca9ftfgCVtzPOFH/Rk2W9Pgx3QkFI2UY= Authentication-Results: tilera.com; dkim=none (message not signed) header.d=none;tilera.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4823.namprd11.prod.outlook.com (2603:10b6:510:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Mon, 9 Aug 2021 15:18:27 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf%6]) with mapi id 15.20.4394.023; Mon, 9 Aug 2021 15:18:27 +0000 To: Zhihong Wang , , References: <20210809062548.30187-1-wangzhihong.wzh@bytedance.com> <20210809065200.31134-1-wangzhihong.wzh@bytedance.com> From: Ferruh Yigit CC: "Singh, Aman Deep" , Igor Russkikh , Cyril Chemparathy X-User: ferruhy Message-ID: Date: Mon, 9 Aug 2021 16:18:21 +0100 In-Reply-To: <20210809065200.31134-1-wangzhihong.wzh@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM0PR02CA0075.eurprd02.prod.outlook.com (2603:10a6:208:154::16) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.206] (37.228.236.146) by AM0PR02CA0075.eurprd02.prod.outlook.com (2603:10a6:208:154::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16 via Frontend Transport; Mon, 9 Aug 2021 15:18:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0372ea4d-794d-4488-9414-08d95b48f024 X-MS-TrafficTypeDiagnostic: PH0PR11MB4823: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HezIq0sbLNVj2sDrjyNKtaDgAt3gUdJUaRC1dsnSGrPVUhabUVPXdYHMOiD+O8kd57nSfu7Np54ulpAdpErRaC4q39EvFO4mew0mEWWI17orYCU3lCLvVpNpYF8/msDUVZ1mKN/eSbHjnJdEkaiOt8Abhehl7Ja7P+VqGEMsWaJySIj8ygPxIy6zH7vSzMxkTAvUkdUVwty5Df7GEgI2+XL26AKkCh3nFAtKuA2R0B8ZmYnyEVXPSvmxq8iJqBk+oZz9XAMg2dobZv4UBpBbFP9pQ9fy1Q9/H5bi7DF4Gbj/W8PiRAZfV+McJ2ieN/Ck0IhVk6T6zq9zWfSXJeqyDdtEMDuMD2kLWiZj4cZxmdGdrTdNLjpL1tkJRBqM/LX4eMEyF6jF7YbPJgLS6vFI7IZQK/i7lpJ4TlUcbyQq2bUsfF1LHNkvHOfATA/RUnbZ+5VoEftA4375c4CLZhV9qCLn5/u31qkbOAp0uTMRpjynGwbWgAY3buUcAr5XFj8N7LeK+f5CMZq/xy/yUOg/8vAS5Pb6k9K0j5th47rfG8XKyHGPwJaPl9LnsoWerzS/fYTTN+I5Uug6RVAzG667ZwTszDlnLdP2I8c0y9svJ0omxJgBa5VoGxWLft40jLIBs9FRpzrQFyFMO+B8APKPkrXPtml4P8FQi9/JOsGHplPQPxplpxAaUOTamsTN02rpPQnJEovu8NhRD2L2bgRdKg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(346002)(39860400002)(366004)(136003)(36756003)(38100700002)(44832011)(4326008)(6636002)(2616005)(956004)(316002)(31696002)(5660300002)(2906002)(478600001)(6486002)(83380400001)(53546011)(16576012)(31686004)(8936002)(86362001)(66946007)(54906003)(6666004)(8676002)(66476007)(26005)(66556008)(186003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cVNvUE9iYVdxMEtIYTlkb1lqODU4MThVci9jdDdvNHFlRld3Y0JuL3hnWjRz?= =?utf-8?B?bXNGZks0bi9CcHhDK25RRUgvWEdvQlZhakhUOTlQcDAwMzM5dlR4N0NlOGVU?= =?utf-8?B?Q3ZwTmUwUjFvMGhzaE4zNmhJcXRTWFBqa1dyNW9aVk53UkFmdHdpTFdYT0Iw?= =?utf-8?B?bndWUWUwVWhhMWx6dy80ZU5yU0gzVzZ5UFQxSjZsdWt1aVllcithK3ZNZDdH?= =?utf-8?B?NlZJZ2tnRVRLOFNzKzQ2Q1JrUEpHd2JNRUFXeEdJRllWS3lveU1mK1EwMGFT?= =?utf-8?B?MDZ5R1ZQUHZyY1hCTDlPL3hQdCtBNEdUYnVIN2NEL0xTZE5ERUNVTElPbUtG?= =?utf-8?B?R3RQSy8vMEVyakVuZ1JDbmJoaDZHbG1lNTZZcXdRVFVDdU1WUkxOQUpWYXEx?= =?utf-8?B?K0lXZkxmVWZrSnNqalVpM0V2SXZnSjk0bkJ2NUxyV3BiUkw3ZzJRNXZVVHh6?= =?utf-8?B?bnFJ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pjcDgw?= =?utf-8?B?aTRQWlBNaDFkWXNzOVFGallCS3hqNHZMb2c3c043aGRLc1RWSU5nVmsyZlBC?= =?utf-8?B?eWFiZWFVUHEvbzRNNGZiNkZyT21oR1R6RHRBaFFDVUhTcWhCQTFwYU5CUVIv?= =?utf-8?B?ZDRxUGtzZGhpMVRyYW5hMzBnVlpvejZ0YVRhcEJmUm9tU1RicEtVR2VqMnEx?= =?utf-8?B?cGRNWTgzaURhSTh0ZUNlZjdaRUdxbVFIODR4UXc2VldSRXdtK2pKb1RQbmZn?= =?utf-8?B?UGtPb2gzNmt5WllPWDBlZTBTeHgyZjN3UENMZ0FxU0krQytmOXR1aWFiT3pF?= =?utf-8?B?ZGZGWEZGQXcxS3AwWjEyLzZQWUFkVStRRUVPbnJxb1pBTEtYTTB4eFVtdmR1?= =?utf-8?Q?dvq36d84FmQwTCaCltOjAtgHq3tebL7s69p85SY?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0372ea4d-794d-4488-9414-08d95b48f024 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2021 15:18:27.5542 (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: 8wro25+znC7gEcJYc7bpmhGTTnVjXWKoMZLxV1KnURtMUryx3dYIhK38NXqhmdT8IMr569Mh6MGuo/qS5Xjmzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4823 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: flowgen support ip and udp fields 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 Sender: "dev" On 8/9/2021 7:52 AM, Zhihong Wang wrote: > This patch aims to: > 1. Add flexibility by supporting IP & UDP src/dst fields What is the reason/"use case" of this flexibility? > 2. Improve multi-core performance by using per-core vars> On multi core this also has syncronization problem, OK to make it per-core. Do you have any observed performance difference, if so how much is it? And can you please separate this to its own patch? This can be before ip/udp update. > v2: fix assigning ip header cksum > +1 to update, can you please make it as seperate patch? So overall this can be a patchset with 4 patches: 1- Fix retry logic (nb_rx -> nb_pkt) 2- Use 'rte_ipv4_cksum()' API (instead of static 'ip_sum()') 3- User per-core varible (for 'next_flow') 4- Support ip/udp src/dst variaty of packets > Signed-off-by: Zhihong Wang > --- > app/test-pmd/flowgen.c | 137 +++++++++++++++++++++++++++++++------------------ > 1 file changed, 86 insertions(+), 51 deletions(-) > <...> > @@ -185,30 +193,57 @@ pkt_burst_flow_gen(struct fwd_stream *fs) > } > pkts_burst[nb_pkt] = pkt; > > - next_flow = (next_flow + 1) % cfg_n_flows; > + if (++next_udp_dst < cfg_n_udp_dst) > + continue; > + next_udp_dst = 0; > + if (++next_udp_src < cfg_n_udp_src) > + continue; > + next_udp_src = 0; > + if (++next_ip_dst < cfg_n_ip_dst) > + continue; > + next_ip_dst = 0; > + if (++next_ip_src < cfg_n_ip_src) > + continue; > + next_ip_src = 0; What is the logic here, can you please clarifiy the packet generation logic both in a comment here and in the commit log? > } > > nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_pkt); > /* > * Retry if necessary > */ > - if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) { > + if (unlikely(nb_tx < nb_pkt) && fs->retry_enabled) { > retry = 0; > - while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) { > + while (nb_tx < nb_pkt && retry++ < burst_tx_retry_num) { > rte_delay_us(burst_tx_delay_time); > nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue, > - &pkts_burst[nb_tx], nb_rx - nb_tx); > + &pkts_burst[nb_tx], nb_pkt - nb_tx); > } +1 to this fix, thanks for it. But can you please make a seperate patch for this, with proper 'Fixes:' tag etc.. > } > - fs->tx_packets += nb_tx; > > inc_tx_burst_stats(fs, nb_tx); > - if (unlikely(nb_tx < nb_pkt)) { > - /* Back out the flow counter. */ > - next_flow -= (nb_pkt - nb_tx); > - while (next_flow < 0) > - next_flow += cfg_n_flows; > + fs->tx_packets += nb_tx; > + /* Catch up flow idx by actual sent. */ > + for (i = 0; i < nb_tx; ++i) { > + RTE_PER_LCORE(_next_udp_dst) = RTE_PER_LCORE(_next_udp_dst) + 1; > + if (RTE_PER_LCORE(_next_udp_dst) < cfg_n_udp_dst) > + continue; > + RTE_PER_LCORE(_next_udp_dst) = 0; > + RTE_PER_LCORE(_next_udp_src) = RTE_PER_LCORE(_next_udp_src) + 1; > + if (RTE_PER_LCORE(_next_udp_src) < cfg_n_udp_src) > + continue; > + RTE_PER_LCORE(_next_udp_src) = 0; > + RTE_PER_LCORE(_next_ip_dst) = RTE_PER_LCORE(_next_ip_dst) + 1; > + if (RTE_PER_LCORE(_next_ip_dst) < cfg_n_ip_dst) > + continue; > + RTE_PER_LCORE(_next_ip_dst) = 0; > + RTE_PER_LCORE(_next_ip_src) = RTE_PER_LCORE(_next_ip_src) + 1; > + if (RTE_PER_LCORE(_next_ip_src) < cfg_n_ip_src) > + continue; > + RTE_PER_LCORE(_next_ip_src) = 0; > + } Why per-core variables are not used in forward function, but local variables (like 'next_ip_src' etc..) used? Is it for the performance, if so what is the impact? And why not directly assign from local variables to per-core variables, but have above catch up loop?