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 7F459A09E4; Thu, 28 Jan 2021 17:58:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 678D740682; Thu, 28 Jan 2021 17:58:46 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 0E50E4067A for ; Thu, 28 Jan 2021 17:58:44 +0100 (CET) IronPort-SDR: sDIZSreIbM/k/0OZWvnNmdgHrjACGJo30D8bZq3DaR9/hCvKTG2vxXWRMCr9iwoaqSj8ZfznEZ HvkhRaVXibsw== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="179486970" X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="179486970" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 08:58:42 -0800 IronPort-SDR: 4Aj69wDdjYPvGmt++csVR1jHsajgARCyCPpW76dG3TIrytCHPaSdEbLxq4XaQWmDsY8tgEQQf6 YVRxIm2XEyGA== X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="388897508" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.197.127]) ([10.213.197.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 08:58:41 -0800 To: Nalla Pradeep , Radha Mohan Chintakuntla , Veerasenareddy Burru Cc: jerinj@marvell.com, sburla@marvell.com, dev@dpdk.org References: <20210118093602.5449-1-pnalla@marvell.com> <20210128152220.214485-11-pnalla@marvell.com> From: Ferruh Yigit Message-ID: <33d414de-2c1c-3b45-5df8-a864e815c6ab@intel.com> Date: Thu, 28 Jan 2021 16:58:39 +0000 MIME-Version: 1.0 In-Reply-To: <20210128152220.214485-11-pnalla@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v5 10/11] net/octeontx_ep: receive data path function added 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 1/28/2021 3:22 PM, Nalla Pradeep wrote: > Function to deliver packets from DROQ to application is added. It also > fills DROQ with receive buffers timely such that device can fill them > with incoming packets. > > Signed-off-by: Nalla Pradeep <...> > +/* Check for response arrival from OCTEON TX2 > + * returns number of requests completed > + */ > +uint16_t > +otx_ep_recv_pkts(void *rx_queue, > + struct rte_mbuf **rx_pkts, > + uint16_t budget) > +{ > + struct otx_ep_droq *droq = rx_queue; > + struct otx_ep_device *otx_ep; > + struct rte_mbuf *oq_pkt; > + > + uint32_t pkts = 0; > + uint32_t new_pkts = 0; > + int next_fetch; > + > + otx_ep = droq->otx_ep_dev; > + > + if (droq->pkts_pending > budget) { > + new_pkts = budget; > + } else { > + new_pkts = droq->pkts_pending; > + new_pkts += otx_ep_check_droq_pkts(droq); > + if (new_pkts > budget) > + new_pkts = budget; > + } > + > + if (!new_pkts) > + goto update_credit; /* No pkts at this moment */ > + > + for (pkts = 0; pkts < new_pkts; pkts++) { > + /* Push the received pkt to application */ > + next_fetch = (pkts == new_pkts - 1) ? 0 : 1; > + oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch); > + if (!oq_pkt) { > + otx_ep_err("DROQ read pkt failed pending %" PRIu64 > + "last_pkt_count %" PRIu64 "new_pkts %d.\n", > + droq->pkts_pending, droq->last_pkt_count, > + new_pkts); The format specifier seems fixed, but in a second thought, are you sure that you want to add logging into a fast path? Even if it doesn't log anything it will consume cycles, and if it logs it will impact the datapath a lot. There is a 'RTE_LOG_DP' macro for datapath, you may consider using it.