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 88E8BA0548; Tue, 17 Aug 2021 11:37:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B86140DF5; Tue, 17 Aug 2021 11:37:31 +0200 (CEST) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by mails.dpdk.org (Postfix) with ESMTP id 685544014E for ; Tue, 17 Aug 2021 11:37:30 +0200 (CEST) Received: by mail-io1-f54.google.com with SMTP id d11so1844102ioo.9 for ; Tue, 17 Aug 2021 02:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aUA9hfSAtUqU8bivbj6mvAoGxT/rn1spE62+1ao9+2E=; b=mMYYXSch7DLJW5ReYEqSuyWZdDyXdS+KElnUYXM5NCYPp89yKmt5pTGxShwXbssGbR nn1vrvy27JBbYpWnbPfIzjs2azqLtTU7HioQUagGpVVs856UElgM8MJlFmxs73iOaD1i UhshKe5i/TlblfN0wbohJ81CY1T6Nm2iyENSvsqnrd8Ci2dBJLsq3pLnY0MiOGeDkWpZ FSAVZsXh4us80axkuZb0L/L3kzv7TfDiob21OkK7S6cwdH2Qd4kFnRWohw8qetkCeu7m EWJjdT0aQ5fwU3HhVQ4QtqrQDQJcBUUNDD7Qot/ZqzGfqByNcZ72RexVK6YL84tffrib awCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aUA9hfSAtUqU8bivbj6mvAoGxT/rn1spE62+1ao9+2E=; b=enPAnP0dW8q31AQ701TnvWYec5h3DIrB5T3ME3nSeDJgDvfGXSPFOMNbvH1XB+EImQ YTafZM7N2i1C7JWiezFXb5eQieuvoLuj0Uc+dS6M3iiSqeOMIq6YRKGYhvOYijPanEL2 hKsD7xYqv05kq93ZSlNOHW6wwv/x/Hagtp/Egi/h+wnQg5DaPfLFiv3k5MW6V2EWdYHc 6m1xCm6Kko9Ps8jN2sBXr/5xSADeEvaLr1zcrd0Im3OE15RRvYttHczOTWF/o3ILzemp ZT8xMVOcRHxYi2GJIMI0YZRHprvZmpQiXSZYtbHDHACINvFqF0443v6K97M5RxTBA6pf MCfQ== X-Gm-Message-State: AOAM530GckIm4W49RFJTMl/zHLbOkFNOUVhIFjJa46V1qZeBbXyuEDqC 7Via9zb3mTNLY642SW90dijwWsoUVtLIFIQLOR8= X-Google-Smtp-Source: ABdhPJwmRXGtT+Vi9MJMHi3LaRBLNd1REUN5BEpcjSuiYmmrDvEduiawEnQC8163vFvan5CxAHVCyxWxzcN0fLYuzP4= X-Received: by 2002:a02:84c2:: with SMTP id f60mr2089812jai.133.1629193049854; Tue, 17 Aug 2021 02:37:29 -0700 (PDT) MIME-Version: 1.0 References: <20210727034204.20649-1-xuemingl@nvidia.com> <20210811140418.393264-1-xuemingl@nvidia.com> <20210811140418.393264-6-xuemingl@nvidia.com> In-Reply-To: <20210811140418.393264-6-xuemingl@nvidia.com> From: Jerin Jacob Date: Tue, 17 Aug 2021 15:07:03 +0530 Message-ID: To: Xueming Li Cc: Xiaoyu Min , dpdk-dev , Xiaoyun Li Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 06/15] app/testpmd: add common fwd wrapper function 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 Wed, Aug 11, 2021 at 7:35 PM Xueming Li wrote: > > From: Xiaoyu Min > > Added an inline common wrapper function for all fwd engines > which do the following in common: > > 1. get_start_cycles > 2. rte_eth_rx_burst(...,nb_pkt_per_burst) > 3. if rxq_share do forward_shared_rxq(), otherwise do fwd directly > 4. get_end_cycle > > Signed-off-by: Xiaoyu Min > --- > app/test-pmd/testpmd.h | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index 13141dfed9..b685ac48d6 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -1022,6 +1022,30 @@ void add_tx_dynf_callback(portid_t portid); > void remove_tx_dynf_callback(portid_t portid); > int update_jumbo_frame_offload(portid_t portid); > > +static inline void > +do_burst_fwd(struct fwd_stream *fs, packet_fwd_cb fwd) > +{ > + struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; > + uint16_t nb_rx; > + uint64_t start_tsc = 0; > + > + get_start_cycles(&start_tsc); > + > + /* > + * Receive a burst of packets and forward them. > + */ > + nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, > + pkts_burst, nb_pkt_per_burst); > + inc_rx_burst_stats(fs, nb_rx); > + if (unlikely(nb_rx == 0)) > + return; > + if (unlikely(rxq_share > 0)) See below. It reads a global memory. > + forward_shared_rxq(fs, nb_rx, pkts_burst, fwd); > + else > + (*fwd)(fs, nb_rx, pkts_burst); New function pointer in fastpath. IMO, We should not create performance regression for the existing forward engine. Can we have a new forward engine just for shared memory testing? > + get_end_cycles(fs, start_tsc); > +} > + > /* > * Work-around of a compilation error with ICC on invocations of the > * rte_be_to_cpu_16() function. > -- > 2.25.1 >