From patchwork Mon Feb 6 10:08:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 53127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2151053wrn; Mon, 6 Feb 2023 02:11:17 -0800 (PST) X-Google-Smtp-Source: AK7set9sPhsVWEEDaqorUnG/9Vka6f81rvF9cHFZoBN8c8ed3jxSRdufct3WkrH8D6lyisVLLTD1 X-Received: by 2002:a50:f68a:0:b0:4aa:c354:a0e7 with SMTP id d10-20020a50f68a000000b004aac354a0e7mr584585edn.25.1675678276890; Mon, 06 Feb 2023 02:11:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675678276; cv=pass; d=google.com; s=arc-20160816; b=zKCwtrW01sAr/gXY6AU91/26PD7c0kJnexdR9GICqD/KmdNfrPQXRV2ylyCK2tqbSW lr1q80Df5DDqIs82kIXcDmPVW8/0vR2l9z2Ypuyfnt1+NtHYHdW5mNeR/aLKvKsBX1LZ A0zIKaDO+LMUXTLeBhAhitdYNU7SM9fA33LNhbcpxZNmEi3CxPIdBWjwGDO//sCszg3R hJFfWQxWe+DZjYxUoCoBOEzdCLLUkhh/mtp9LZ10GFSWOE2Y5ePdOQSoiGrOplXLV+xK q56mmGMMJtZmx2A0Qy8K7D1qJG/IMk0+ktinRh09ttVZKKDtbU3TPzL10IjmKyx910Pc v90Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8Oki15vmcIgJjBGTfklTBzJKOfHFRepAumEeMsAKh4M=; b=u+jcpUKxzar/V8xhc7uTL/En1WJX6t/AG2ffDNmkCCfUQcgCpNXbejZzzsbgz11BAU K7CuKNR0BrItQDL4tBVqvOkHNzgkkBunTxesLky6WfRhiKuWFjzzPV7Mn/KcMIV/+nO8 nrxBkooeZ7ulSWcUev4HYClUfdrVGQfCJhpBMfwLzKR2A5NFMvVCN/vAFXf+vHCkqMqm 49ylOhB4Q8vZZm3jmHpv3RkFpfdGF383U0KN/EnHAgoAvsK8Z/AFlMu8Yvb7iIBQnEGd D+Dp+KZqknXQYUCHPftVTCcCcosLsg7i3OJMzWc1eGLCpi3WN2PAtJdSGo1FzB26f66v BWpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=NJRGLgoL; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j25-20020aa7c419000000b004a14cb2a5bcsi1790484edq.499.2023.02.06.02.10.53; Mon, 06 Feb 2023 02:11:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=NJRGLgoL; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbjBFKJd (ORCPT + 99 others); Mon, 6 Feb 2023 05:09:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbjBFKJZ (ORCPT ); Mon, 6 Feb 2023 05:09:25 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0621.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::621]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E19B12F3A; Mon, 6 Feb 2023 02:09:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EE8yHemtFxMl5rYCpb1B8yaqVtGaZbr3aBERQXGfFLyaGp3wI1CUkuDIDwoQGJ5O+F/F+/RdGZcgrOjHsn0tLUlJeMXmWKPeAafzvl6/fgE9a+Qh/0IAjqgmSeDWMs2CExwON4rTxO6tuyl0jvd46QeZxxwJ4VO4l6MVPK9KrokO1sUBlCNK6ypkQurQMqL/jUs0rXxjbZbvifZMnwr9qULWCP0yRJx0B2J3GBkb4+QsPasnjEQV3Fp+lw6t26Mb9U+dBfoJ8jOaPVkeJN+FZbzW8t0nEoAyTncQ9FXrD/FSk40r65zKerqiaJAjaJWZMoXEImUsf9hFA2u7beh2Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8Oki15vmcIgJjBGTfklTBzJKOfHFRepAumEeMsAKh4M=; b=DE+rWfmUOozDm2dlKPGvcnLhgOC2x5WVJlJ7xNuakR+S8v5d+nGYG1ZlDyNl9Amt3l8Fba2xk34iiWDGQBL9tTr2hiDRmVL66oGYpI1hFeVaDzJNt8gvXEozG1dtz1joRqd1ECEJec/d1DPTXr04++lgqVseWWg4IZ7A3/wasEkhHAGC0txrMyGrZNMjz/r1ALeI6+KQ0QzeK7saRkJosXOy5LU7+A3AMIq7ZKv2BXkhcsA30ADlZ2Vok7wgCgn3NZk287FXFRLXdwHSSN28552xNYiGhFhIcCCPgsl8LJ5v9Cz+DYRADEVYNzCLidHESyEquUXqKe+giQJLMIG7Ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8Oki15vmcIgJjBGTfklTBzJKOfHFRepAumEeMsAKh4M=; b=NJRGLgoLjQWoMrwRBhkqL2ZUXfKCFRW49rcD59/2VpEKG7VyUll8uMVdqJTnz7NYvE8IXOM9AcUUYec6Xw1pmauJXYHMlxplNYC3yx4FyG0mEm63iXNyipxPsg0tdA60GTJ3J1piGpFHSASMD1/0LWaxBZmvGgVoN+DcDZXr8xU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by AS8PR04MB7813.eurprd04.prod.outlook.com (2603:10a6:20b:2a4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 10:09:02 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%5]) with mapi id 15.20.6064.034; Mon, 6 Feb 2023 10:09:02 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Maciej Fijalkowski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next 03/11] net: enetc: rename "cleaned_cnt" to "buffs_missing" Date: Mon, 6 Feb 2023 12:08:29 +0200 Message-Id: <20230206100837.451300-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230206100837.451300-1-vladimir.oltean@nxp.com> References: <20230206100837.451300-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR10CA0019.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::19) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|AS8PR04MB7813:EE_ X-MS-Office365-Filtering-Correlation-Id: d7d17353-7759-4a49-a080-08db082a2bc8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8IxLpDxOI2nxZCfHIIZM3eL0LK+lxt7+VeywuHkbyxK65wfdCHLiMtVoP+gOZgs+lL2aZZxAs60f5GQ5tfCIO2OcRGzmpVWsoQqzW8BcwKYfj+qY83OGeYU+uD0ixoJkBh2EUPUuzdzUNfWjEwzZHgqIJTmWGQKBw27ITdnSnfTmVcbkh7X6upk8VoBuiZrzss+mKdN6q1Qxwc/ardfqlX0Ka5e++DFgai9GAi+BEeNkkLqLmgXY8tYNFneIuOMib2CviU924NIWrr2Iz6PkPE6R+tEStKU9iGytM2x1kIzjCLc7y8TooLnyTyHkyQiSAhigjttP5HBtfcYq/L0HcDSd2saqk5N0+uuwc3dJlNWN4t2+5gnkec7+ifdu2XV6sF5O8YToWRArcaC5dXpdhAennYdR5gBN48EnDfL0aeEHWtukJDn1TC3JSi2SrCY/qLB/StzlzMsq4GpYt7CCoUdJt6Alf+MQiA3J87VyVsxUlVteaQZNO2dr6CnVU1wfQDrI+cbDWUmxlJbrPKw1cK88mqBiSJeSnRk7/hTj1N9QPjVGhieYSrgUo1Pa6/jL/BWrT9JpbTLnrzKrRQbX4QmBV3hbhN+6H1fqM4ooisp9TjMFkDW82j6vdAfDVT//nj1ydRFRgnt9Oz17/OSqbYWVYMFtjJvK68vT3CoDw4RUyVLJHXTi46M7rFezf9YMba99nMIiLgw0C3kZbXd65w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(376002)(136003)(39860400002)(346002)(396003)(451199018)(86362001)(2906002)(36756003)(83380400001)(52116002)(6506007)(1076003)(6512007)(2616005)(186003)(26005)(478600001)(6666004)(6486002)(5660300002)(8936002)(7416002)(38350700002)(41300700001)(38100700002)(44832011)(54906003)(66476007)(8676002)(6916009)(66946007)(4326008)(316002)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: etzV0fE7kM8SbvTaPh/m+aF/0iENuzTUFdW7S3Qms2tMHbbgz+b7udUMNwXeqIuB4tyjOpjkECviZnZYTDR1s5rrMIxIoYXMTabtGTWiKi14QSS0yqI6/ZM9Ged/OaDYj7oVknkh8Ks3HPj09xwU67XiVHCLGzQXGx4TVkmg4y3oHAWTMUhCrCfY7V3UC5g49mdMWyP7wFJ/CQbG8IZinCUdDYixOxfca948tguxbEUoSINo3rtrB/s3g8Wp/ewWvDqbpEw58m/foW/Xn1y0JTHJoTM7A7WguYN8QU9cR0+qoWss3RQju2nJiBeXz4DTAHqY2yU7bZjI8bj+5lEt8Ef3uGAk33BY6hhMcu0YZQWm9T+oZTtrMhffHAd9d7qsfzZPts6fpmlFMLLeXLPGrbxWaBFcLeZe/GUPUw2DJfVfChUeglivu/7fxapHxP6Bskr/Mwffbrjj2cTDyXe+EFZHZS6/m3bnFlN6JJxZXmvcWdhPesUilyBTBhZ3j/t9+DRyqzH5pfZPejaHgqij+4EYiztHU6CebtxkTeQlfIzmeHUozlUxCsZad1iC5OWkFYzUQ0wO2bGBOZ2X1nBPtybN59NXJcwox8xLqZIlgeYkcOF554NtkvItqs5IWuarWB3X1Jdzu9C5PMGSNxoEVu2C+LkaatYXqiFJSDd5yQxJz0+laIRnQUmS4fSZ9hHwtvHO7BedOdqLbCwak0OwuK33TyHt5buMkpwc3O1GS92V2potdQmnfBI2+JiGdp92vKNbNh+Numi1N1PLbKblK04zcT9btzmgosGWUodLujJi1fxYmS8sJXhy+DzRCMBzOWKmZwXDwj/yd6PPDZeED5b6r8TigfmG8U15UAPfoX2CehnTMm2HfjrkVNpNxb8DunNzZQBbDQu5oj0rsqUHkrSAKhptS3M1r1/VwsoS2FHVZjvC/piI+4DpZ8/qHI1pZlkkNmY3zODCIHiycRqNYp6S7jBw2quex126cLdG6d7wj8Yo8N/336t2Lkhv7GfhBzoEKeLBcyUJqVJzJrWJwZYQs7AOas69+OGtIYvqao0F0iuhyDl9S7hEGIxvM0qCagmInTn639V0ZTzYVVZiitFdvef+FcxB7m2rjfqSJwic+ZuXtS224UMCyb+hAZBv2VZHE5xA0o4Y8wVWJ33jZiKO0kPDgqRyHkXyb5pGUIeOXwDg9I6J8yJ+lEjDmHWAQIr5doKn4nhsgKZs0zRmHlXOuKGdzHIlUSaqIggPdY+47Xab2wbzSXj0v7YQ6FV2dxPGhBZzf2P4VLoF6LlsJE++QUuTsIy353N0Tcr8GAlQCg+d923CFyc6/fm3QLxrwJcJj1IbDZJ5aCb47Kj5lAR+gmYoK+0vabXjQTJQA3TPvLy5nUHHqsYdyUchFx14arPDqKsdj3Fc6SHNzjMAezFngQ8VMsyQ+aWLl70PDcXWlNQ5zMPdulrk2LEbZNP3TuPv+jvD4eOISVYvCdblcXl7bljCyP09hmjIzYYhfajBijM9CVNo8Yv9PwDAnIZwblUcGVrkrsaaLjrcDgcGRRlg79cqwQioPpqJjqdGnrpeyeneZJn+GZU36eo42Nc0lcvHCMAOkfVY7XUF/0ikAA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7d17353-7759-4a49-a080-08db082a2bc8 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 10:09:02.1305 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H4OJZcZNUjmtry94GgmWP6Xoc6LqOy0Q+CfmSalnCw6zaMuHnRIhcBZXFEL4YBxXO3SNXpkIyqT/OoYABoJCPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7813 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757076024625135819?= X-GMAIL-MSGID: =?utf-8?q?1757076024625135819?= Calling enetc_bd_unused() on an RX ring returns the number of descriptors necessary for the ring to be full with descriptors owned by hardware (for it to put packets in). Putting this value in a variable named "cleaned_cnt" is misleading to me, especially since we may start the NAPI poll routine (enetc_clean_rx_ring) with a non-zero cleaned_cnt. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/freescale/enetc/enetc.c | 41 ++++++++++---------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index 2d8f79ddb78f..4a81a23539fb 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -1145,7 +1145,8 @@ static bool enetc_check_bd_errors_and_consume(struct enetc_bdr *rx_ring, static struct sk_buff *enetc_build_skb(struct enetc_bdr *rx_ring, u32 bd_status, union enetc_rx_bd **rxbd, - int *i, int *cleaned_cnt, int buffer_size) + int *i, int *buffs_missing, + int buffer_size) { struct sk_buff *skb; u16 size; @@ -1157,7 +1158,7 @@ static struct sk_buff *enetc_build_skb(struct enetc_bdr *rx_ring, enetc_get_offloads(rx_ring, *rxbd, skb); - (*cleaned_cnt)++; + (*buffs_missing)++; enetc_rxbd_next(rx_ring, rxbd, i); @@ -1173,7 +1174,7 @@ static struct sk_buff *enetc_build_skb(struct enetc_bdr *rx_ring, enetc_add_rx_buff_to_skb(rx_ring, *i, size, skb); - (*cleaned_cnt)++; + (*buffs_missing)++; enetc_rxbd_next(rx_ring, rxbd, i); } @@ -1190,9 +1191,9 @@ static int enetc_clean_rx_ring(struct enetc_bdr *rx_ring, struct napi_struct *napi, int work_limit) { int rx_frm_cnt = 0, rx_byte_cnt = 0; - int cleaned_cnt, i; + int buffs_missing, i; - cleaned_cnt = enetc_bd_unused(rx_ring); + buffs_missing = enetc_bd_unused(rx_ring); /* next descriptor to process */ i = rx_ring->next_to_clean; @@ -1201,9 +1202,9 @@ static int enetc_clean_rx_ring(struct enetc_bdr *rx_ring, struct sk_buff *skb; u32 bd_status; - if (cleaned_cnt >= ENETC_RXBD_BUNDLE) - cleaned_cnt -= enetc_refill_rx_ring(rx_ring, - cleaned_cnt); + if (buffs_missing >= ENETC_RXBD_BUNDLE) + buffs_missing -= enetc_refill_rx_ring(rx_ring, + buffs_missing); rxbd = enetc_rxbd(rx_ring, i); bd_status = le32_to_cpu(rxbd->r.lstatus); @@ -1218,7 +1219,7 @@ static int enetc_clean_rx_ring(struct enetc_bdr *rx_ring, break; skb = enetc_build_skb(rx_ring, bd_status, &rxbd, &i, - &cleaned_cnt, ENETC_RXB_DMA_SIZE); + &buffs_missing, ENETC_RXB_DMA_SIZE); if (!skb) break; @@ -1447,14 +1448,14 @@ static void enetc_add_rx_buff_to_xdp(struct enetc_bdr *rx_ring, int i, static void enetc_build_xdp_buff(struct enetc_bdr *rx_ring, u32 bd_status, union enetc_rx_bd **rxbd, int *i, - int *cleaned_cnt, struct xdp_buff *xdp_buff) + int *buffs_missing, struct xdp_buff *xdp_buff) { u16 size = le16_to_cpu((*rxbd)->r.buf_len); xdp_init_buff(xdp_buff, ENETC_RXB_TRUESIZE, &rx_ring->xdp.rxq); enetc_map_rx_buff_to_xdp(rx_ring, *i, xdp_buff, size); - (*cleaned_cnt)++; + (*buffs_missing)++; enetc_rxbd_next(rx_ring, rxbd, i); /* not last BD in frame? */ @@ -1468,7 +1469,7 @@ static void enetc_build_xdp_buff(struct enetc_bdr *rx_ring, u32 bd_status, } enetc_add_rx_buff_to_xdp(rx_ring, *i, size, xdp_buff); - (*cleaned_cnt)++; + (*buffs_missing)++; enetc_rxbd_next(rx_ring, rxbd, i); } } @@ -1524,16 +1525,16 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, struct enetc_ndev_priv *priv = netdev_priv(rx_ring->ndev); int rx_frm_cnt = 0, rx_byte_cnt = 0; struct enetc_bdr *tx_ring; - int cleaned_cnt, i; + int buffs_missing, i; u32 xdp_act; - cleaned_cnt = enetc_bd_unused(rx_ring); + buffs_missing = enetc_bd_unused(rx_ring); /* next descriptor to process */ i = rx_ring->next_to_clean; while (likely(rx_frm_cnt < work_limit)) { union enetc_rx_bd *rxbd, *orig_rxbd; - int orig_i, orig_cleaned_cnt; + int orig_i, orig_buffs_missing; struct xdp_buff xdp_buff; struct sk_buff *skb; u32 bd_status; @@ -1552,11 +1553,11 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, break; orig_rxbd = rxbd; - orig_cleaned_cnt = cleaned_cnt; + orig_buffs_missing = buffs_missing; orig_i = i; enetc_build_xdp_buff(rx_ring, bd_status, &rxbd, &i, - &cleaned_cnt, &xdp_buff); + &buffs_missing, &xdp_buff); xdp_act = bpf_prog_run_xdp(prog, &xdp_buff); @@ -1572,11 +1573,11 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, break; case XDP_PASS: rxbd = orig_rxbd; - cleaned_cnt = orig_cleaned_cnt; + buffs_missing = orig_buffs_missing; i = orig_i; skb = enetc_build_skb(rx_ring, bd_status, &rxbd, - &i, &cleaned_cnt, + &i, &buffs_missing, ENETC_RXB_DMA_SIZE_XDP); if (unlikely(!skb)) goto out; @@ -1640,7 +1641,7 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, if (xdp_tx_frm_cnt) enetc_update_tx_ring_tail(tx_ring); - if (cleaned_cnt > rx_ring->xdp.xdp_tx_in_flight) + if (buffs_missing > rx_ring->xdp.xdp_tx_in_flight) enetc_refill_rx_ring(rx_ring, enetc_bd_unused(rx_ring) - rx_ring->xdp.xdp_tx_in_flight);