From patchwork Tue Mar 16 14:47:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 12142339 X-Patchwork-Delegate: kuba@kernel.org 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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 7EFBDC43381 for ; Tue, 16 Mar 2021 14:48:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 507C465086 for ; Tue, 16 Mar 2021 14:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237404AbhCPOsQ (ORCPT ); Tue, 16 Mar 2021 10:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235695AbhCPOr5 (ORCPT ); Tue, 16 Mar 2021 10:47:57 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF86AC061756 for ; Tue, 16 Mar 2021 07:47:56 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id ci14so72448721ejc.7 for ; Tue, 16 Mar 2021 07:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LhJuhikxc24QKZZG9OF8S1Z4/usCbY8j/7Kimi/+4oo=; b=KcRzqwL2OX7lDSQr5eThQ57aUGBLut2Enj4WjsqgCLW2UgxqN4Fhi75GkNDMXwwnJ9 xMjUYA4y2hzyUUZuupBX4Szn2KyUjbID6eZGRh3hyO7jCHrXDCmGux2j140neB9oCJkY 7HDYE9e6pFH2PBSsz1UXCDqhnyx8HLXN+8fKhsoe86Xm5YIphn1F49XV7twNwdzwHbZa xshOa5Tgiw6xD74ZWNtmhergp+qO69OmaK9ArVgfWC5mg56NtaWewR0K7PQLexQPEoLo 17Hth2v0jPMAp0myToKwKnfEihrstpqPYKJfgcChl7hLHqUONanuK/MobL/gsvfQzQsd 9ddw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LhJuhikxc24QKZZG9OF8S1Z4/usCbY8j/7Kimi/+4oo=; b=dBC1nLiTgk9ZdktXrY4yFy2HL9xRBqdrwm0XUJPs1gkz9019/mvikLIWt4qPnNz6Nk KYJkAfPojXDhLhyElePlWVTUsjKYfi5bGXkMlCqxp/Vei6B+8o4QuJpvRu38rDkYkDol /aU378OgpZgDSjLPMbm3VKvm9ySwAkFgs2Lmgq4/QHYsMi18bgrDKwTV4wmB/ifk/SwA SIP5ElSNL5hFjXbccW6rXwJSnnyu0Fak36z5slCwuspNYGgcLgCVpM81C3Gh8BxVLtAv B31Onjw3mrmhi59r+nBWpiKDBYAHQgVsYgSit09XmNJihPDEkOq4PVT3iE/PbTYJZviP KnTw== X-Gm-Message-State: AOAM531vc0EyTS/CnG5rCDnFeYW9rOvWPTWxbiC+NAPXg52X4OsC2S4i uPByYeLlO9PdlYB0ZtSAmyQ= X-Google-Smtp-Source: ABdhPJyStqhE+nG+XpJAYMa5glYuhUrNR13iLudXky9ZoIXvfqTbrwXY0fSDC3q6Ujc3fkyw/NMRSQ== X-Received: by 2002:a17:907:1614:: with SMTP id hb20mr14970291ejc.77.1615906075557; Tue, 16 Mar 2021 07:47:55 -0700 (PDT) Received: from yoga-910.localhost (5-12-16-165.residential.rdsnet.ro. [5.12.16.165]) by smtp.gmail.com with ESMTPSA id de17sm9467441ejc.16.2021.03.16.07.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 07:47:55 -0700 (PDT) From: Ioana Ciornei To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: ruxandra.radulescu@nxp.com, Ioana Ciornei Subject: [PATCH net-next 1/3] dpaa2-eth: use indirect calls wrapper for FD enqueue Date: Tue, 16 Mar 2021 16:47:28 +0200 Message-Id: <20210316144730.2150767-2-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210316144730.2150767-1-ciorneiioana@gmail.com> References: <20210316144730.2150767-1-ciorneiioana@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Ioana Ciornei We can avoid an indirect call per Tx packet by wrapping the enqueue of the frame descriptor with the appropriate helper. Signed-off-by: Ioana Ciornei --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 492943bb9c48..7702b921ab0b 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -266,8 +266,11 @@ static int dpaa2_eth_xdp_flush(struct dpaa2_eth_priv *priv, num_fds = xdp_fds->num; max_retries = num_fds * DPAA2_ETH_ENQUEUE_RETRIES; while (total_enqueued < num_fds && retries < max_retries) { - err = priv->enqueue(priv, fq, &fds[total_enqueued], - 0, num_fds - total_enqueued, &enqueued); + err = INDIRECT_CALL_2(priv->enqueue, + dpaa2_eth_enqueue_fq_multiple, + dpaa2_eth_enqueue_qd, + priv, fq, &fds[total_enqueued], + 0, num_fds - total_enqueued, &enqueued); if (err == -EBUSY) { percpu_extras->tx_portal_busy += ++retries; continue; @@ -1153,7 +1156,10 @@ static netdev_tx_t __dpaa2_eth_tx(struct sk_buff *skb, * the Tx confirmation callback for this frame */ for (i = 0; i < DPAA2_ETH_ENQUEUE_RETRIES; i++) { - err = priv->enqueue(priv, fq, &fd, prio, 1, NULL); + err = INDIRECT_CALL_2(priv->enqueue, + dpaa2_eth_enqueue_fq_multiple, + dpaa2_eth_enqueue_qd, + priv, fq, &fd, prio, 1, NULL); if (err != -EBUSY) break; }