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; } From patchwork Tue Mar 16 14:47:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 12142343 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 8B751C4332D 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 6830B65089 for ; Tue, 16 Mar 2021 14:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237438AbhCPOsV (ORCPT ); Tue, 16 Mar 2021 10:48:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235702AbhCPOr6 (ORCPT ); Tue, 16 Mar 2021 10:47:58 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBDB2C06175F for ; Tue, 16 Mar 2021 07:47:57 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id e7so21828947edu.10 for ; Tue, 16 Mar 2021 07:47:57 -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=RePJBW/g54muuXnPyV/NLg+5wnsE8oNrG8mbSfM4rOg=; b=U60RxrCup5C2RZ6uyVoPQw8MZ8Y2jK+G8+DSm4RNhwCpQBppJNAu/jVf7aLQnbXCai JngNkxAZ5U4qaGofV90LoO6ibAONvsojSI15DAw39zFrBR0xUoFnbfbAOhNyxG52XzZG QXMKG1T23BInel0pPpIiPezQLTiKiNrMHNILU0PNhvQxVn/oTfxMngeycmHLzsof3PD6 ebfKpGmtj8GlCjVNaZ1PNJ8/x8DJiTwdHZKH/e5nXj3X8eeCEM9ptyA4cbNBR/D6gHpP 7FKc4f6LB55YFtr4t4aRT6mpgvtBKxijSo4Jt4dw1axvSsOOGxqljL8jj6G7mfEvgINi FgsQ== 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=RePJBW/g54muuXnPyV/NLg+5wnsE8oNrG8mbSfM4rOg=; b=koK3HlJERkBYHS9fI+o44O4wqSEi4eljxoMovlHwl2nVQH/FSZANMExNKYKOekQ9zD HmaG3O2wiYBxttYuUjq8PTwtn1aGNLwzchjWjKyCidic1gGp6b65COUVpA8JOAOBbjyh 48nbx682h19ewhnd0fKaKKMgjK+0BqpuSg04wsxctId/fXbIMpE5A7Ky22GqeGrvFDaP CObdIOhISIWmmtSZSDCy8Dc1zza4bH/GIbzZYtcGCALrqIE+HufC7TFHDDMOrI5/uf19 jc3sBRh4L/ivNMRv9QWULVOsBCz5wNejtLQ7/gSaOHCJDqn4iDm4kPRuiqp2Jw6VqQWs iOWA== X-Gm-Message-State: AOAM533LwZ+hg1s+8Ijobn9LapY/94KOJ5xgwNii0Pjfcy4N+4i9JsnW zXY/vFRW3kHKFhmwSyQDSC0= X-Google-Smtp-Source: ABdhPJw/q82gGieGV0xD2WFLU4EPNcpcQUIAuylHbxbJ3ucgUCns1pUc/ehBJyNtp1EBdA3mguwmPQ== X-Received: by 2002:aa7:d1d0:: with SMTP id g16mr19970077edp.358.1615906076531; Tue, 16 Mar 2021 07:47:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 07:47:56 -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 2/3] dpaa2-eth: use indirect calls wrapper for FD consume Date: Tue, 16 Mar 2021 16:47:29 +0200 Message-Id: <20210316144730.2150767-3-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 Rx packet by wrapping the consume function on a frame descriptor with the appropriate helper. Signed-off-by: Ioana Ciornei --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 7702b921ab0b..4ea0bbd9e4c2 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -605,7 +605,8 @@ static int dpaa2_eth_consume_frames(struct dpaa2_eth_channel *ch, fd = dpaa2_dq_fd(dq); fq = (struct dpaa2_eth_fq *)(uintptr_t)dpaa2_dq_fqd_ctx(dq); - fq->consume(priv, ch, fd, fq); + INDIRECT_CALL_3(fq->consume, dpaa2_eth_rx, dpaa2_eth_tx_conf, dpaa2_eth_rx_err, + priv, ch, fd, fq); cleaned++; retries = 0; } while (!is_last); From patchwork Tue Mar 16 14:47:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 12142345 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 21461C4332B for ; Tue, 16 Mar 2021 14:48:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBA3664F44 for ; Tue, 16 Mar 2021 14:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237467AbhCPOsX (ORCPT ); Tue, 16 Mar 2021 10:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236665AbhCPOr7 (ORCPT ); Tue, 16 Mar 2021 10:47:59 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD212C06174A for ; Tue, 16 Mar 2021 07:47:58 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id o19so21853757edc.3 for ; Tue, 16 Mar 2021 07:47:58 -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=0JAq1q5tCN/v7xeyqA8I2lBkvE5Excawis9bpCSfpO0=; b=QRHYrTz/i2sLlL+XhTw5o0eEjMcyGSnREwnW4h7XEaDeaAcvcVVe0wIbEckbknqy+e YhYk/RUazKmmRvMN6bsn7in5ihJI4kpDqLWqHiZ1vF7/QuH92a5tosJkDeOAw6fTmPP4 FutBA/N+j3iwrfPig08KDNfwDMD3DpcxINcxdrfnfNJJOQjdoVlNhiX210UdO0YXVL1v daJK5Cz38vMDLymHdT0o5RdxhubSVPQJQBY4vvgm2NNcf+bvlXzE+NOr7L31BglhryAn KetpJ0ZY9EZObzgZX50rSbtAyZiZeWsssQgRUcpev0eBzGJ/Bnb7dvk3B1NQ6nFRIB6T dOFA== 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=0JAq1q5tCN/v7xeyqA8I2lBkvE5Excawis9bpCSfpO0=; b=b5QzZRU2+edwCMjhl7rnUspbI79sfjkoLP3hPfrA6sm0AUF4Do1V+08dXANE9kFLGM GmPvRdcOVMnafqSmHxqE7O3nZSotpsMdOgC4hZwX+31kIeEtisVMOxVWxujbhm8raTuM AbI7nj/qhvhofUE7XcJV7LTTWXgMCpCYfAayywXcnmTUeVuvm4/D5vgPVuv2vxgQIQ54 Ear7sh3W9+TgJ0XJoYE4PJLtspBXNXJ/0lN7KAF1pGnI9pApQdyKiuPGXqMJOKHIpptH blXn0OOVVwl8qx7MuIImA15Rci8KPvwQ0v0LX28XimUYpY+RSiuywLzgKYs5UoEIhAAM nPoQ== X-Gm-Message-State: AOAM531GA15BLZUVcCxQYcwr8UHK7IPEetQheIKDr0ImWpylnspmUzIJ F0CcFs5wWdu1vs7JbG9rTnk= X-Google-Smtp-Source: ABdhPJyzkJMT1yhh4UB1SEiO2XJm02hDMWaOKoeemAT95b/jtpC19BwOTobC8y3TV6yOwRyEk/ow6A== X-Received: by 2002:a05:6402:17d6:: with SMTP id s22mr36152727edy.232.1615906077498; Tue, 16 Mar 2021 07:47:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 07:47:57 -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 3/3] dpaa2-switch: use an indirect call wrapper instead of open-coding Date: Tue, 16 Mar 2021 16:47:30 +0200 Message-Id: <20210316144730.2150767-4-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 Instead of open-coding the call to the consume function of each frame queue, use the provided INDIRECT_CALL_2. Signed-off-by: Ioana Ciornei --- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 12 ++++++------ drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 2fd05dd18d46..e6ec5de0e303 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1917,11 +1917,13 @@ static int dpaa2_switch_setup_fqs(struct ethsw_core *ethsw) ethsw->fq[i].fqid = ctrl_if_attr.rx_fqid; ethsw->fq[i].ethsw = ethsw; - ethsw->fq[i++].type = DPSW_QUEUE_RX; + ethsw->fq[i].type = DPSW_QUEUE_RX; + ethsw->fq[i++].consume = dpaa2_switch_rx; ethsw->fq[i].fqid = ctrl_if_attr.tx_err_conf_fqid; ethsw->fq[i].ethsw = ethsw; - ethsw->fq[i++].type = DPSW_QUEUE_TX_ERR_CONF; + ethsw->fq[i].type = DPSW_QUEUE_TX_ERR_CONF; + ethsw->fq[i++].consume = dpaa2_switch_tx_conf; return 0; } @@ -2208,10 +2210,8 @@ static int dpaa2_switch_store_consume(struct dpaa2_switch_fq *fq) continue; } - if (fq->type == DPSW_QUEUE_RX) - dpaa2_switch_rx(fq, dpaa2_dq_fd(dq)); - else - dpaa2_switch_tx_conf(fq, dpaa2_dq_fd(dq)); + INDIRECT_CALL_2(fq->consume, dpaa2_switch_rx, dpaa2_switch_tx_conf, + fq, dpaa2_dq_fd(dq)); cleaned++; } while (!is_last); diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h index 933563064015..e4d8a99a6d32 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h @@ -84,6 +84,7 @@ extern const struct ethtool_ops dpaa2_switch_port_ethtool_ops; struct ethsw_core; struct dpaa2_switch_fq { + void (*consume)(struct dpaa2_switch_fq *fq, const struct dpaa2_fd *fd); struct ethsw_core *ethsw; enum dpsw_queue_type type; struct dpaa2_io_store *store;