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 X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8410C4363D for ; Fri, 25 Sep 2020 14:09:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8AC1C20BED for ; Fri, 25 Sep 2020 14:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601042966; bh=x46ZxXXAbuoXn4xaE8AKhV7/n/wHF76Ca3nxs64Ign4=; h=From:To:Cc:Subject:Date:List-ID:From; b=SO8a/Zx/RtnGNVTd9AoWluS+ld5SO1UZTB475i2nNZVDuY0w4P19vUBRPWEfkFyAT iXE4qbml67CkRZEUxRIIKPC19bTXSzDt3AoIUUWd3gBuEL1Rx8xro6hnGLTITbFLqc X4kx0/CM53WqsAI25LZVsFkxtO01i+Ipn8pxZhWI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729035AbgIYOJZ (ORCPT ); Fri, 25 Sep 2020 10:09:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:45998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728466AbgIYOJZ (ORCPT ); Fri, 25 Sep 2020 10:09:25 -0400 Received: from lore-desk.redhat.com (unknown [151.66.98.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4FDD1208A9; Fri, 25 Sep 2020 14:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601042964; bh=x46ZxXXAbuoXn4xaE8AKhV7/n/wHF76Ca3nxs64Ign4=; h=From:To:Cc:Subject:Date:From; b=0TGgbShoieFz/DAmHLyaDPpo7bQ6DSMbVw7jaI9WEWrP+72EuFO00BFN70hPRwZCU oMYJNE6IkFjYr/hk188d1LkKegEs7JbqEnVGt5+Nx1H5e5owmXwwxP5KcA6EU33G72 uGbv6HKC93WmqfDvQPqE6XEAEXAgO4q+nA2VIAgk= From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, lorenzo.bianconi@redhat.com, brouer@redhat.com, echaudro@redhat.com, thomas.petazzoni@bootlin.com Subject: [PATCH v2 net-next] net: mvneta: try to use in-irq pp cache in mvneta_txq_bufs_free Date: Fri, 25 Sep 2020 16:09:11 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Try to recycle the xdp tx buffer into the in-irq page_pool cache if mvneta_txq_bufs_free is executed in the NAPI context for XDP_TX use case Signed-off-by: Lorenzo Bianconi --- Changes since v1: - run xdp_return_frame_rx_napi for XDP_TX only --- drivers/net/ethernet/marvell/mvneta.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 14df3aec285d..bb485745b72a 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -1831,7 +1831,7 @@ static struct mvneta_tx_queue *mvneta_tx_done_policy(struct mvneta_port *pp, /* Free tx queue skbuffs */ static void mvneta_txq_bufs_free(struct mvneta_port *pp, struct mvneta_tx_queue *txq, int num, - struct netdev_queue *nq) + struct netdev_queue *nq, bool napi) { unsigned int bytes_compl = 0, pkts_compl = 0; int i; @@ -1854,7 +1854,10 @@ static void mvneta_txq_bufs_free(struct mvneta_port *pp, dev_kfree_skb_any(buf->skb); } else if (buf->type == MVNETA_TYPE_XDP_TX || buf->type == MVNETA_TYPE_XDP_NDO) { - xdp_return_frame(buf->xdpf); + if (napi && buf->type == MVNETA_TYPE_XDP_TX) + xdp_return_frame_rx_napi(buf->xdpf); + else + xdp_return_frame(buf->xdpf); } } @@ -1872,7 +1875,7 @@ static void mvneta_txq_done(struct mvneta_port *pp, if (!tx_done) return; - mvneta_txq_bufs_free(pp, txq, tx_done, nq); + mvneta_txq_bufs_free(pp, txq, tx_done, nq, true); txq->count -= tx_done; @@ -2859,7 +2862,7 @@ static void mvneta_txq_done_force(struct mvneta_port *pp, struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id); int tx_done = txq->count; - mvneta_txq_bufs_free(pp, txq, tx_done, nq); + mvneta_txq_bufs_free(pp, txq, tx_done, nq, false); /* reset txq */ txq->count = 0; -- 2.26.2