From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f50.google.com (mail-qg0-f50.google.com [209.85.192.50]) by dpdk.org (Postfix) with ESMTP id 4BCDD8E63 for ; Sat, 29 Aug 2015 20:25:18 +0200 (CEST) Received: by qgi69 with SMTP id 69so17089372qgi.1 for ; Sat, 29 Aug 2015 11:25:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Aaes2L2V0Zi/pSukb6A6zNNHOaBbX7cwAB3JyWw27zk=; b=dwEqM7JEZp+OXpuvY/rBnLvtNu+xRdaiPfiT3Q1bCtCltux4QYOxbX3pT1EmSsEGC8 3IKvWQocMi7avgIePgEZpNed5TMdC8/o4aIPG8kDariba0gWjPPwn0LNKebBG86TfCpz f9r1dHFK7T/Yf3xC6yS45BNBoCXcmSZUcGuTCjOuqWLReaoq6BnLGaQWTZZ8aWt+7O8l h96/3rawEtl1z9dDkhMSXUDQKDGV48t3m1EjlUTnkeZsL0F/DxSa0WW71f/R5gsi3tOb qnKwMICXwSulWef9v6NHGNp80ePMak0Gdmy0En9UiZEdhWk7HUccMp9ItlL5e6emGmvD J9jA== X-Gm-Message-State: ALoCoQl8tft5YEsxrMaABagZt8Um55Yejwt/yaZ4ZmOf3MwH0obqSNbhZoCtFa9GedFV/37xfWG6 MIME-Version: 1.0 X-Received: by 10.140.218.149 with SMTP id o143mr27771479qhb.25.1440872717829; Sat, 29 Aug 2015 11:25:17 -0700 (PDT) Received: by 10.55.114.5 with HTTP; Sat, 29 Aug 2015 11:25:17 -0700 (PDT) Received: by 10.55.114.5 with HTTP; Sat, 29 Aug 2015 11:25:17 -0700 (PDT) In-Reply-To: References: <55E0B0AC.7060509@gmail.com> <47CEA9C0E570484FBF22EF0D7EBCE5B534B644C7@szxema505-mbx.china.huawei.com> Date: Sat, 29 Aug 2015 21:25:17 +0300 Message-ID: From: Vladislav Zolotarov To: Masood Moshref Javadi Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] rte_eth_rx_burst only returns up to 32 packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2015 18:25:18 -0000 On Aug 29, 2015 16:55, "Masood Moshref Javadi" wrote: > > Thanks a lot. > > So I assume the only way to see if there are more than 256 packets in the > queue is to count them using rte_eth_rx_count Sorry for bulging in but i think Masood rose a very important general question here, which is: how do i check if there are more pending packets in the PMD Rx queue without actually polling them (out)? As far as i see it the short answer is you can't. Or more specifically - you shouldn't. Because if it happens that your code depends on it - it most likely doesn't fit the PMD model. The thing is that u can actually go and query the Rx ring about the number of pending packets but the truth is that by the time u get this query result it may already be wrong since new packets have arrived. The only correct way to deal with PMD Rx queue is to actually go and poll for new packets: if there are some - handle them and if there aren't any - poll again. This is my understanding of this. Thanks, Vlad > On Aug 28, 2015 8:32 PM, "Gaohaifeng (A)" wrote: > > > Please see _rece_raw_pkts_vec function. > > > > Here is part of its comments may explain this question > > /* > > * vPMD receive routine, now only accept (nb_pkts == > > RTE_IXGBE_VPMD_RX_BURST) > > * in one loop > > * > > * Notice: > > * - nb_pkts < RTE_IXGBE_VPMD_RX_BURST, just return no packet > > * - nb_pkts > RTE_IXGBE_VPMD_RX_BURST, only scan RTE_IXGBE_VPMD_RX_BURST > > * numbers of DD bit > > */ > > > > > > > > Hi, > > > > The documentation of this method says: Applications implementing a > > "retrieve as much received packets as possible" policy can check this > > specific case and keep invoking the rte_eth_rx_burst() < > > http://dpdk.org/doc/api/rte__ethdev_8h.html#aee7daffe261e67355a78b106627c4c45 > > >function > > until a value less than nb_pkts is returned. > > > > But the function returns at most 32 packets regardless of the burst size > > parameter (nb_pkts). For example when I set the burst size to 256, it only > > returns 32 packets even though the queue has more packets. This means that > > I cannot rely on the returned value to know if there are > > > 256 packets in the queue or not. > > > > Where this number 32 comes from? Is it because "PMD: > > ixgbe_set_rx_function(): Vector rx enabled, please make sure RX burst size > > no less than 32." ? > > > > I use DPDK 2.0.0 and Intel 82599 10 G NIC. > > > > Thanks > >