Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2141691rwb; Thu, 29 Sep 2022 06:47:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5I3VRg/PV8b3Tw7TOnQBwLk76b+AYQP0maF3Kk5HirJci24lyZ6Hz/ZH8lpv/AE0+Cp1HL X-Received: by 2002:a17:903:1112:b0:178:a030:5f72 with SMTP id n18-20020a170903111200b00178a0305f72mr3617319plh.12.1664459241157; Thu, 29 Sep 2022 06:47:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664459241; cv=pass; d=google.com; s=arc-20160816; b=lI6KZ1sQ/ZTtvNuC7kQr2WwEwQIO+5KoOjDf1UMNZe2pxRdELQIc90xbMExEZoiuzG rUdPvjdP0kyZJm0L/4on31upS3jNmz6IcqqdSkrtny3f+J5ufMqb/SFJEXazYDYR6jmz 1Mx1gLM9zhoZV07zntDwMRIpkbxjTMTCm2ox1/3wSao+1jQooIuFOwvSWnWqXmz08duP NWO3MMbFGs8tv6uGQNxhaUwovIIqJPas2WnIqxbq/7Fv95mcfdBNvx7h9lkqb+n4+2Uk FATQlQ94yl4xj7X65IJoWOlcchVkVvtvnCfTP679g/o7bSCFeGmS7D2PYqAWb41o6rCq e2Tw== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=Lha1ZC1TEfPH5fyC1Ixux4rF8XHGTtKWWI0rdFRzBU0=; b=a+A56XQMU/VYr2PhFznYPWklR0z7JWyhgGJap2faLjbrVYOfXoiGcDRGnsaKJVGu2K Ul6K0fycFbEdEUgQRoemqoQY4aEfPWNI1DVmGy3SXTL8Pcydr2l1W2E27P4xVYGredwU YZg83hpSeuQs5SaoayJu9ddNXQsAwzK0NUdDN116LsCvOgAsM0y6dGL0C6Jcd3B0Kuz6 i8M4OemyVXzWJ2cQLnBcoBOBTP4AI3vycQm65LduZLXbTxLw/0QYRZE3M4kqJJ2Xkq6j NSJoMqIeNXOjRBzP40BtuRd0ix5iUBWxOYJGoVjw4sXQ7/XnLJGIEK3ApTDdMod5/JAD Qcxg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=a4RCFasH; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a056a00198900b005549a8dba24si7233332pfl.357.2022.09.29.06.47.06; Thu, 29 Sep 2022 06:47:21 -0700 (PDT) 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=a4RCFasH; 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 S235142AbiI2NfS (ORCPT + 99 others); Thu, 29 Sep 2022 09:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234988AbiI2NfJ (ORCPT ); Thu, 29 Sep 2022 09:35:09 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60068.outbound.protection.outlook.com [40.107.6.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA29C4BA78; Thu, 29 Sep 2022 06:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lNIoPLoshTeaxEiMroJpfkfB1XKL27GXDyV5/BYcWbTEgWkSp9UC58juTHXetxRszLE3OhISX5Gxaq4qAKqq1VG1nHg2/22fNUXlzhEeKaI+dCkMrlBk4CX849/TWVYTI4U4hrQ6qjhjlzWbzzG8FMl1nmX/kQHEKvqROydMvdu4p+h1X1r2lA+eqodzIvNPhpMLomhPENs+uxxVfTZf5BfbsIZzR+rPyoVul5Tv1ta0q5vFSU+nJPDFy2PHJFGRS7Th2aopx7LaBSWpD08POPAx26/k0PZRnFMC73gs1HLNHwOdSTJHL7k+qZrPc+YbdO4w5GGw4/pzD9Oah7VTyg== 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=Lha1ZC1TEfPH5fyC1Ixux4rF8XHGTtKWWI0rdFRzBU0=; b=Vv+wBpUhxup8uYzvcGCi2YLAQUThKUZ3PBLBp2DkgYLbR6SMjMyd1E1uMutuFKPrIYatS5nilq8lW5MGcLBu1Mz/pH9kCQ2nwvAOfBy7zWAfS6SC7tKEr6/na8DY5uGaoFJHPFB836434+JHeUU/c0nXb1QPA32vP5quHx2FmHqAOtXv3L/WoC+xERIWcdxtQPbVOhhwQPUnFjlIaIy+tjKv+JHsQ3zn+zJOhTKL9e7spKUqpZZuN52hewxVcB3S+ZEYP1rRxolQmFFiMtpjZ3UPOSHp/lABKiaX0ML9aX3DYw5D+n6jD9YeJpGI5di2W05oRC+xwV/h8yT4ZGz3tA== 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=Lha1ZC1TEfPH5fyC1Ixux4rF8XHGTtKWWI0rdFRzBU0=; b=a4RCFasHFG4WDkvGqh/NPDtDkrqBnNnKoSE4Wsg+eOFPaOAhyoo+oDbhhdQzfdscF+iH9vhgLGDZYVf7yxzT7S136JvYWd7YSsSLDiHfHaKMX2p4Qy3dw9cSWPuhOV+efk/YM6/BQDzvGXcO5RP8g1vnJY3VtzLeWaeD34LY0Hk= Received: from PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) by AS8PR04MB7686.eurprd04.prod.outlook.com (2603:10a6:20b:290::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Thu, 29 Sep 2022 13:35:05 +0000 Received: from PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::a543:fc4e:f6c5:b11f]) by PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::a543:fc4e:f6c5:b11f%9]) with mapi id 15.20.5676.020; Thu, 29 Sep 2022 13:35:05 +0000 From: Shenwei Wang To: Andrew Lunn CC: Joakim Zhang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "imx@lists.linux.dev" Subject: RE: [EXT] Re: [PATCH 1/1] net: fec: add initial XDP support Thread-Topic: [EXT] Re: [PATCH 1/1] net: fec: add initial XDP support Thread-Index: AQHY006sqGpD/PA5gEmZiYlRlE0jhK31pSmAgAC11xCAAAviAIAAAMVg Date: Thu, 29 Sep 2022 13:35:05 +0000 Message-ID: References: <20220928152509.141490-1-shenwei.wang@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PAXPR04MB9185:EE_|AS8PR04MB7686:EE_ x-ms-office365-filtering-correlation-id: f4062e7b-5a28-4180-ef98-08daa21f6b65 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: m88mGo/sG76T8Ji6+57j8ngzZ5sDqdMHwZiV29AhvM51IN3UtGXjzDhWyjiPyxrd5x7xEun2R9IUVE8AwJ6Fpsp/dvztOKNY/D/Vy2GUimfQ5qogoqN5UVXMN6yb4NdW1xezisZ+2y2W12NZBeH/GkSbM1ulwvlBT54fkTyW1xJEKJ0coL3P56RYhIiGXLzgUGg/D86fGEBcSW0mFGHrOzhRzQm10vD8aQ63NdEpvt0hWPfotVGs2SPgEinC0qpmVEXUx0MJCK0LzZtzyVIvNQ/PGtdQsd3HL/DMq/PE7cdByxunxZD2hKPH+tTsOKjzKt2c6aA3VwTlvtGEcCCC2mkdU2NbNaXqz6EeAhbT0DWtePxZZVOKoJ8WeakXE8p4uWIy50U4BjPkARCNXMqtp0tuFfr6XMyokvcCABPV/9iETFzZSfDpydFp/xG2OF8o7JsjMUO3aAVhDFaBHLnpkqOg1xdIEMdUpTTrPj9yO+9XSdTziIYJaXKSseHjfr2Hjyiu1BqXUmIi6wfaYUDI/Omm25qdTbqK6yfGrBT2eRmkrUmXVvCNmmMdb20dtaP1JF84TmEkVKcCs1WOvaLPsrlTbLnpiAAjD+NqylvBPRRz9EAuGmlUH+9JuAnZfbQZIunorIl1/oKDRmKdEt4Ee/8Powmz2K6Uz4IEg1Fw+UDdCfOeK9BCpSe86AwIwE41V3znESJsfUyjqHWo4Wxs9JljaGiXMhUVKmy1c/+WLFQhq/7xZvLuMDDMKdluTbUrmn7LLfMLPiaWZL29I4HQZA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9185.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(136003)(39860400002)(396003)(376002)(346002)(451199015)(44832011)(33656002)(5660300002)(7416002)(8676002)(64756008)(6506007)(7696005)(41300700001)(4326008)(122000001)(55016003)(86362001)(38070700005)(38100700002)(83380400001)(186003)(478600001)(71200400001)(55236004)(54906003)(6916009)(26005)(53546011)(66556008)(52536014)(66446008)(9686003)(66476007)(8936002)(2906002)(316002)(76116006)(66946007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eBWfgDdpIm9y4GRHi94ThkSFuFmr9/txykrHnR3F73ekNIK/Whv4IFjJGVeP?= =?us-ascii?Q?ryssDEXvnzjUFvKv+19Kq0110dneij4bXIpMOY9iDg/hDyX7gdDd6roSx17m?= =?us-ascii?Q?RzMRuA5ge+sFizCFq4XTTO/KgUyU46nZLWoKLZruwDg1a+vowWEWg7EiDElY?= =?us-ascii?Q?f1ILcKEFDuT6PdvHNT/vBK4P0ZuhsPd2Xy4b2Ff02Kf4S38DbPzVfOuyx3jT?= =?us-ascii?Q?x0WMFwG7paSq0+iadt3O1hi86aPUZM8/P72T3Cjqca9GmEpquRhuQyOFFi/e?= =?us-ascii?Q?uf3SRSw4hgYBT04WVtU7r1aBWiEHsi0WMVYnzolnxEN7g3yr2g/0ieXbN6UG?= =?us-ascii?Q?qziNpSGwlcwZIrOy+VSb6z4+4hfQmk3yiCBqamvFWrnbc7qeuEb5vbKhpnoE?= =?us-ascii?Q?Waq3kUA2DnKN+1hJ9MEtH9zXdS//WnRhi50OnlrFVhobIBDMUJwEJKTLjNim?= =?us-ascii?Q?4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fcS2vcPUpJt?= =?us-ascii?Q?oq/fZo8NAwUSwVnntOXds3LiEFe/m21bleJZ1fMJUlcXmg6cxJKegjvnn/Bs?= =?us-ascii?Q?8bptdnQj//hNwdstoGc7KHq460gM9OAMgKdcpUEYDcj9hv5PKH9EDMREhoRS?= =?us-ascii?Q?H1TAAm9VEGqJq2YaNyXAKSePfsYmBPIO7j0WnAd4VHghzdXfYEF1Ur0U8wPg?= =?us-ascii?Q?AjmnfKeHGmDEThKnqxtYvqzFi8R/M3EHA2JFI8gR?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4062e7b-5a28-4180-ef98-08daa21f6b65 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2022 13:35:05.5718 (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: lvbnMXM7IKCRFLNIPTZIYwyV6NT6h2+LSrAI5mz9hr+FVQBNlNvvLi163eiCPj0YHrzPukOHS8UACUIF2u7nrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7686 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 > -----Original Message----- > From: Andrew Lunn > Sent: Thursday, September 29, 2022 8:24 AM > To: Shenwei Wang > Cc: Joakim Zhang ; David S. Miller > ; Eric Dumazet ; Jakub > Kicinski ; Paolo Abeni ; Alexei > Starovoitov ; Daniel Borkmann ; > Jesper Dangaard Brouer ; John Fastabend > ; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; imx@lists.linux.dev > Subject: Re: [EXT] Re: [PATCH 1/1] net: fec: add initial XDP support >=20 > Caution: EXT Email >=20 > > > > +struct fec_enet_xdp_stats { > > > > + u64 xdp_pass; > > > > + u64 xdp_drop; > > > > + u64 xdp_xmit; > > > > + u64 xdp_redirect; > > > > + u64 xdp_xmit_err; > > > > + u64 xdp_tx; > > > > + u64 xdp_tx_err; > > > > +}; > > > > + > > > > + switch (act) { > > > > + case XDP_PASS: > > > > + rxq->stats.xdp_pass++; > > > > > > Since the stats are u64, and most machines using the FEC are 32 bit, > > > you cannot just do an increment. Took a look at u64_stats_sync.h. > > > > > >=20 > > As this increment is only executed under the NAPI kthread context, is > > the protection still required? >=20 > Are the statistics values read by ethtool under NAPI kthread context? >=20 You are right. The read is not under NAPI context. Thanks, Shenwei > Andrew