From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51989C433FE for ; Fri, 30 Sep 2022 16:29:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232167AbiI3Q3p (ORCPT ); Fri, 30 Sep 2022 12:29:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231376AbiI3Q3k (ORCPT ); Fri, 30 Sep 2022 12:29:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA8F625DC for ; Fri, 30 Sep 2022 09:29:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DD4E0623C6 for ; Fri, 30 Sep 2022 16:29:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B5A9C433B5; Fri, 30 Sep 2022 16:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664555372; bh=ppK2RTDOAnP2rrbRJ6gQCIAuZ4vZ9k3FHmMxnArcFa8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nFZPhAIcaa2QBpkGmxklUzcVnJlkkInIOmDBUUxZp9Zl6FKYNdBo+CuGr1OpI40fB C9U7eVeT0V9fXQvwk/ukpxt+rEhAyBGwE9fjV3LpBZ1HlB3QehnZfXGeCFg2sPj0qL 3IOVBfxGuTO2FheP8Ru1NHgzzVIgezb5bxeJl6XsSrsWoGsNYAm7sR98Huoh/bmwGk SUxgzhmjJWbUsDTsWYe04t8pRRT3/ErOK1dYrL8neg8TC3ERDhv6euCS5WQ8/d0qYp 6aFAi3u54ki2aschoMgj74KCb3fuZDbRBMPKN1cWqjqRCZ3AMCmP3im6P+gPeXfHzY jYuiU82lKShGQ== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Maxim Mikityanskiy Subject: [PATCH net-next 06/16] net/mlx5e: xsk: Use partial batches in legacy RQ with XSK Date: Fri, 30 Sep 2022 09:28:53 -0700 Message-Id: <20220930162903.62262-7-saeed@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220930162903.62262-1-saeed@kernel.org> References: <20220930162903.62262-1-saeed@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Maxim Mikityanskiy The previous commit allowed allocating WQE batches in legacy RQ partially, however, XSK still checks whether there are enough frames in the fill ring. Remove this check to allow to allocate batches partially also with XSK. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index ffca217b7d7e..80f2b5960782 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -429,17 +429,6 @@ static int mlx5e_alloc_rx_wqes(struct mlx5e_rq *rq, u16 ix, u8 wqe_bulk) struct mlx5_wq_cyc *wq = &rq->wqe.wq; int i; - if (rq->xsk_pool) { - int pages_desired = wqe_bulk << rq->wqe.info.log_num_frags; - - /* Check in advance that we have enough frames, instead of - * allocating one-by-one, failing and moving frames to the - * Reuse Ring. - */ - if (unlikely(!xsk_buff_can_alloc(rq->xsk_pool, pages_desired))) - return -ENOMEM; - } - for (i = 0; i < wqe_bulk; i++) { int j = mlx5_wq_cyc_ctr2ix(wq, ix + i); struct mlx5e_rx_wqe_cyc *wqe; @@ -841,8 +830,7 @@ INDIRECT_CALLABLE_SCOPE bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq) bulk = wqe_bulk - ((head + wqe_bulk) & rq->wqe.info.wqe_index_mask); count = mlx5e_alloc_rx_wqes(rq, head, bulk); - if (likely(count > 0)) - mlx5_wq_cyc_push_n(wq, count); + mlx5_wq_cyc_push_n(wq, count); if (unlikely(count != bulk)) { rq->stats->buff_alloc_err++; busy = true; -- 2.37.3