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 97161A0A0C; Fri, 2 Jul 2021 18:45:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2181141402; Fri, 2 Jul 2021 18:45:18 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id D452A41363 for ; Fri, 2 Jul 2021 18:45:16 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 6AE017F4DA; Fri, 2 Jul 2021 19:45:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 6AE017F4DA DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1625244316; bh=cJbUvGO/1kZqnFr87T3lkf/U/e0A6PlkjCB5POptxnM=; h=Subject:To:References:From:Date:In-Reply-To; b=XZM71UMpAt8Z9mWCaTqsgsZLbOqLufpxNRkOrEMb7qG4v0xFDKRs1FrnM4bEx2IpR zKdDGXEv/Cvqia0Yg0TjCnptTfgqAe+CqOZMbrYk9h+LVl4jQy3a8YK1gIXuUmXVPF veb6/AypGA0NNj4MlGq4T3cPcunF+6SwTa7SbQGk= To: Jiawen Wu , dev@dpdk.org References: <20210617110005.4132926-1-jiawenwu@trustnetic.com> <20210617110005.4132926-16-jiawenwu@trustnetic.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <11dd5bef-33fe-5061-5439-20af74e280f5@oktetlabs.ru> Date: Fri, 2 Jul 2021 19:45:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210617110005.4132926-16-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 15/19] net/ngbe: add simple Tx flow 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 6/17/21 2:00 PM, Jiawen Wu wrote: > Initialize device with the simplest transmit functions. > > Signed-off-by: Jiawen Wu The patch cannot be tested before device start up. So, it should go after corresponding patches. [snip] > +uint16_t > +ngbe_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts, > + uint16_t nb_pkts) > +{ > + uint16_t nb_tx; > + > + /* Try to transmit at least chunks of TX_MAX_BURST pkts */ > + if (likely(nb_pkts <= RTE_PMD_NGBE_TX_MAX_BURST)) > + return tx_xmit_pkts(tx_queue, tx_pkts, nb_pkts); > + > + /* transmit more than the max burst, in chunks of TX_MAX_BURST */ > + nb_tx = 0; > + while (nb_pkts) { Compare vs 0 explicitly > + uint16_t ret, n; > + > + n = (uint16_t)RTE_MIN(nb_pkts, RTE_PMD_NGBE_TX_MAX_BURST); > + ret = tx_xmit_pkts(tx_queue, &tx_pkts[nb_tx], n); > + nb_tx = (uint16_t)(nb_tx + ret); > + nb_pkts = (uint16_t)(nb_pkts - ret); > + if (ret < n) > + break; > + } > + > + return nb_tx; > +} > + > /********************************************************************* > * > * Rx functions