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 5B04241C97; Tue, 14 Feb 2023 19:15:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40E5A42FC2; Tue, 14 Feb 2023 19:15:20 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2045.outbound.protection.outlook.com [40.107.96.45]) by mails.dpdk.org (Postfix) with ESMTP id EFAA542FAE for ; Tue, 14 Feb 2023 19:15:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LnHs2CJ8W7CEfDBvzeRgvYZ4kopKfJ312ZK3xL2A2MbNJbr0brcod9hbLMhuYpMT9H4sPMbsOHRi15zOruXyC/uLeNS2KzlFpPj8Y/1pommoPcb57vFJNG2xShRM1w3M0cPPS5FyCJXbC6PjHS8GuF0yMOSkqEc+wuvbNf6DvlxmbZqmafR4sUt+lonxshYEQbi/j53qHHBH0eWtMmiynJZEbJcJtBaYREdKkcRw/UJZrsnHlr9jlVcQ2yf+NcyIEmMPkGdgEVis6N4gWyInDxmdOw9hKksbjsgv6gC70LqGNW6oZL1i22qH9AhC3TGOkgPPlnWQo4hpdTciZ4NeSg== 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=O0smzGHxS7XPcPg9PfS+9O4HNS+sgCvLlTDFta3qpaI=; b=RKAbAu3tG2VnWY4RWcfDqBuDh5oG5nOzvp6JI/KrLKLQgBkOZefqHZQyhs6uNP/vJTCvWo+N+543vUYfiEtvFvwcdWitCCjgjYqZ0pYCjFcRb2UFVY0Wigxz0UFNeaT/F5q51F5PP2QEi8gB8zLpiDnXqDai6Q5cfaAck2tPK4RMp6dwyi93DdDAhNMS94+IghDR8EZvt8VUTYHiWODb5498vKdNbryS+jdMFSmm+At0SIizPaQAwxnGVWc24/rZ2y7L459tTPbGvd4kcQQBGm3YWslX/AAEuz+OraCngxW7X2yXCuHjV7pfEa48Kc2Xyzkqzr8uSUojEuZfoY8pBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O0smzGHxS7XPcPg9PfS+9O4HNS+sgCvLlTDFta3qpaI=; b=NXHUse5m6cLqJeuySNerRunpd4Ky+NRtyOkC22hRoFDi2Am3Sw1c6EzCHCTNGjd0Cg0Rq/TizeXNfl8SdybPUDiFk3FJpj4Qp9yjG8vy5Q8RKDL3QFT5vNtFWxLcQahTQLYSMs9AAAw4wHStvhEBQdgR5dtIpO4YA6kykpS5RL8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by BN9PR12MB5083.namprd12.prod.outlook.com (2603:10b6:408:134::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Tue, 14 Feb 2023 18:15:16 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6086.026; Tue, 14 Feb 2023 18:15:16 +0000 Message-ID: <6c008fd5-979b-92fc-a994-3b084cb3719d@amd.com> Date: Tue, 14 Feb 2023 18:15:11 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Content-Language: en-US To: David Marchand , dev@dpdk.org Cc: Aman Singh , Yuying Zhang , Robin Jarry References: <20230124104742.1265439-1-david.marchand@redhat.com> <20230124104742.1265439-6-david.marchand@redhat.com> From: Ferruh Yigit Subject: Re: [PATCH 5/6] app/testpmd: factorize fwd engine Rx In-Reply-To: <20230124104742.1265439-6-david.marchand@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO3P265CA0011.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:bb::16) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BN9PR12MB5083:EE_ X-MS-Office365-Filtering-Correlation-Id: b82ac5ee-e7fe-41e7-a414-08db0eb76c8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l4jU9RKokPQqi3MswaAHjKLFtnE+JdLlYINhq8jZVlOm0CKbJ66t2X2R8mFTX4GJdb7qyWYmS1g4LafwaIMHKwoXv865wKp5qTB3+7nA1EtXRAunlltEnmW3LVnHmb6M9Ea7lQD7CsMuGEBJYFlmPKpuqoPdYmb67f8BYil+uZGIEE2yjaSoFx8Fz2kgAPohLZEEutxVHfZi3q/tPqEOps7dFNLviwbZZhLW17iRVcWpgJLYywV7Kn7HoP0e+XvfL42NTvi7dRzqiID/6dYI5cDW12qF2nAvfno4m/FVSUiWlyvp72opqVmSi9h8IVXFlPwp2nt1g1tTdj3eemnqDgC3ZJ8BpqhpS1jf9JYyUCeG3e7D54SKVUT9Ae1FqDFMXr1x+rkbVAb4ySGZQApEpJkZH0t2E1ONV0Ql+Mrce7S1s90FFpV+T8Z3m0y6k2waETkjvKI6XlxPo8dhgaxTxVlNj35Nfd4EUr3Ccp2pE27fRNKgGXkmxxHg/cAb+1WIvRykxxs+yFg/2xkwopEt0txt7vqQSTaYsiyqoNPJiiShMueUV7DLyKl/BESTC83z03CE+S/gycju96CirCPAaYs9p3rIVakSc9tjJSrdUlqF47H2Q+a8eHrjMdSP3gq65knIbbeIR5EwWuBww/konpQFABh8aiUpzsVO1MVwtcZ5fcC7hVpXr1t+IdHZ4JfG9iGwLbqBCe4/eVGAKZ6Tj8JjJjUxXkzdGFtodvFR5hQIsBu2MOeLaaABWHf0VHZ7BXIty1LabUuCKEbPbIekVw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(451199018)(53546011)(8936002)(6666004)(316002)(186003)(6506007)(26005)(6512007)(2906002)(5660300002)(4744005)(478600001)(44832011)(36756003)(54906003)(86362001)(6486002)(31696002)(31686004)(66556008)(41300700001)(66476007)(4326008)(8676002)(66946007)(2616005)(38100700002)(83323001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K1NWRk4vbEtramthQ2xNRTZhQVRwY3BzUkUycDdJWEJ3KzVISHBubnV6Q3RX?= =?utf-8?B?dy85UHF4eTVOZ0VrNnQ0c0xTTk9qdjU0R3Uzcllid25mdWQ0bFc0c1d3Q1Vj?= =?utf-8?B?bkNkL2xDVEwwa2dXbUVHUnZBa0F5QlRYc0R0L08vRWVKWTZYbEpWbVV6Mk9k?= =?utf-8?B?ZkxSdmRPSFZ0NTBNUmJwdGhBaVZKSmhUc0lOSk01eVlDNEdZRTdJUTB1QlB2?= =?utf-8?B?UlNTN2hlbGRuMGRFU3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YdURIN1BjM2wzaGl4TmtzZVpz?= =?utf-8?B?UjRoYUJDNWc2QlkyMThlYTF5NlozT0ZSUml3UGZBZTRoZ0NZWlU5Z2tUTnN1?= =?utf-8?Q?Ue1kSkYL0ZfPeaBwi1BEwN12R?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b82ac5ee-e7fe-41e7-a414-08db0eb76c8f X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 18:15:16.8245 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c/q84Llzq1mNgFCTst/e822gqRIJDrvnrfn4msbMPF7RA682SqSo165t3+y5e+DX X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5083 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 On 1/24/2023 10:47 AM, David Marchand wrote: > Reduce code duplication by introducing a helper that takes care of > receiving packets and incrementing rx counter. > > Signed-off-by: David Marchand Reviewed-by: Ferruh Yigit <...> > @@ -857,6 +857,18 @@ inc_tx_burst_stats(struct fwd_stream *fs, uint16_t nb_tx) > if (record_burst_stats) > fs->tx_burst_stats.pkt_burst_spread[nb_tx]++; > } > +static inline uint16_t > +common_fwd_stream_receive(struct fwd_stream *fs, struct rte_mbuf **burst, > + unsigned int count) > +{ > + uint16_t nb_rx; > + > + nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, burst, count); > + inc_rx_burst_stats(fs, nb_rx); > + if (likely(nb_rx != 0)) > + fs->rx_packets += nb_rx; Minor but since "nb_rx != 0" is likely case, perhaps we can drop the check and just have "fs->rx_packets += nb_rx;"?