From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 11F05A0096 for ; Wed, 10 Apr 2019 10:23:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DEB344CA7; Wed, 10 Apr 2019 10:23:50 +0200 (CEST) Received: from mail-vk1-f195.google.com (mail-vk1-f195.google.com [209.85.221.195]) by dpdk.org (Postfix) with ESMTP id C9F574C8F for ; Wed, 10 Apr 2019 10:23:49 +0200 (CEST) Received: by mail-vk1-f195.google.com with SMTP id l17so366781vke.7 for ; Wed, 10 Apr 2019 01:23:49 -0700 (PDT) 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=Xg4K5HYKDMJ1zvGE3vJfJ49wJmztHW/0X449Eh94+WY=; b=EEZLXoto9Wq2/vfDFiMUEIiWK74eYTaj71CHz5CrH3Z4a0aSH4eF55kYDqRBJd2qrj 0AqDTvagJWAvsyR0CPyrRuQtQZ8ve4rI1BDibu+eMGzWUJcBFNEzE9TBwS7oojnfwcNV 4H6eJJYMRhnogr/TwN9SMfaGBFGR1NoFu2Ju6q/MHCl+m2gUQOXzdqQOjZE/wJ1px9oL n4q6jUAhGajgkMHO8OCC5PzzRfNoQHeXHqQPnmRC03nv5shMXSGYNBEk0iarnZZDaRWI qdKmWpYlNHPZhmXiVHq0AA6+HcMRt4LjyqT3rVaQWlKWmsnGmUnQxXSjWOFoT0WfIbdF vv9w== X-Gm-Message-State: APjAAAWnuqlQsb3wP1O2lKOwRdYJNq6mmK1uocqPd9UvZI9SebEztbVQ cvG+ElteLnUvhsdWfGSjaDcr4oJDjLzalC0tfu0Vcw== X-Google-Smtp-Source: APXvYqzeKtxGIVL6NCXz8dAOu3uSawimBfxUheR77FEYegJFWgXuE3TYR0xHj6JscBvLs2pfXkgHUHGQ0OaO0Zld++A= X-Received: by 2002:a1f:bf4b:: with SMTP id p72mr22952018vkf.77.1554884629203; Wed, 10 Apr 2019 01:23:49 -0700 (PDT) MIME-Version: 1.0 References: <20190409082128.33896-1-xiaolong.ye@intel.com> <20190409151902.14675-1-xiaolong.ye@intel.com> In-Reply-To: <20190409151902.14675-1-xiaolong.ye@intel.com> From: David Marchand Date: Wed, 10 Apr 2019 10:23:38 +0200 Message-ID: To: Xiaolong Ye Cc: dev , Ferruh Yigit , Qi Zhang , Karlsson Magnus , Topel Bjorn Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: enqueue buf ring when allocate Tx queue fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Message-ID: <20190410082338.FU5DMk2bF8Qptcpo_qi0TiWZP_1GiggfyxTmEFc5FiU@z> On Tue, Apr 9, 2019 at 5:24 PM Xiaolong Ye wrote: > When it fails to allocate enough slots in Tx queue for transmitting > packets, we need to return the dequeued addrs to buf ring. > > Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") > > Signed-off-by: Xiaolong Ye > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c > b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 007a1c6b4..5cc643ce2 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -276,6 +276,7 @@ eth_af_xdp_tx(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) > > if (xsk_ring_prod__reserve(&txq->tx, nb_pkts, &idx_tx) != nb_pkts) > { > kick_tx(txq); > + rte_ring_enqueue_bulk(umem->buf_ring, addrs, nb_pkts, > NULL); > return 0; > } > > -- > 2.17.1 > Looks good to me. But I have an additional question. After the for loop that only picks the mbufs it can copy to the xdp desc, is it normal to call xsk_ring_prod__submit(&txq->tx, nb_pkts); rather than with valid count ? -- David Marchand