Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2113557rwb; Thu, 29 Sep 2022 06:27:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6jl6XS7DYDMoCHkAqJhngszaYM+aGFAhKl75+SEhxV1wK48B/74TR66unTWUNqd0vXOp+e X-Received: by 2002:a17:906:8a46:b0:781:7171:74d0 with SMTP id gx6-20020a1709068a4600b00781717174d0mr2769024ejc.214.1664458057272; Thu, 29 Sep 2022 06:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664458057; cv=none; d=google.com; s=arc-20160816; b=wl4z7OGSdEVRBSy3YmGJUvS9cIwAhx07Brq2np35LWG1SrPFUkSBl41mq2XBkbCSry 7r9uo/fe/obCgDwRAR+X2LIR35077e8YUvLPgx9/wqcosJ3CAevP4oiLZsrJMEBksc4m FOirbzb23csM9RveOxXT2lpyyzTQv70C+yhhjuJDBRiAqvOAKzLk715PjG+6/GhyYl2R pK0tAl1nZNfvHSo7/d5H5/EFtRRxrjj/gMzvFJciiw4o0S6pJVUASlw7H4LqvdlIeEDS +ERJSqhaIAVZ4JWTkmLBamY7ROfawI36IGRQg8lgM8jLL3W13UC23wbEQPb97/sH+Zpv DmrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GFmE0LoqXWikNphWZFYNpMrFo7yy2CuxJ2DWoSYNxVY=; b=AgkxLMlDhQlpcUDfk9sBkQXl+6XGCIL3iVUPyrn6TtVYgZomRjHgXJHKiGDf06ExV3 fh6NclySd0/XzeRVm8mXpg4Zf33YiYCApNO9Y996XK3+hh348Q0qi7aoiOwtSWtkvAh2 AeOOSQc3zuuaBrvJpj1dSg6AvPt36c5FDu0ZRXXUVtE8PCdWB0kT5UwCRWWVsZIdYjbE zBVMoPxm7ypKYdVPdmBdOHLo7PcAVLzVUTv+qay7cfZdDgThVCZlTMepuffCjce2Cdpp 2mRDb1PWvSogo5eDC/tf5DvfS44BxY5O5c5myAB0V4iLtvNwEcf9EwjJ6BSPtwOzPPw5 RT+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=MSKKijug; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a1709065a9100b0078261e73261si6065849ejq.567.2022.09.29.06.27.10; Thu, 29 Sep 2022 06:27:37 -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=@lunn.ch header.s=20171124 header.b=MSKKijug; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235273AbiI2NYo (ORCPT + 99 others); Thu, 29 Sep 2022 09:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235476AbiI2NYU (ORCPT ); Thu, 29 Sep 2022 09:24:20 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548A81822D8; Thu, 29 Sep 2022 06:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=GFmE0LoqXWikNphWZFYNpMrFo7yy2CuxJ2DWoSYNxVY=; b=MSKKijugu/O/kh0yv74PpZNETo FF4caSWlOapcQmrDnXO9pL5Dd/CiQUrf6+NSvST1Ok5dnXEFDp6uU00URC6befQVI+aQrqRbcOsBH Usf0YCKdxjk7EEKxrH4rGE5AWcqFU/T2q5euWd2SidkiRa6XNQAacj6tYNGd05C+OfDY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1odtWI-000cOg-9e; Thu, 29 Sep 2022 15:24:06 +0200 Date: Thu, 29 Sep 2022 15:24:06 +0200 From: Andrew Lunn 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 Message-ID: References: <20220928152509.141490-1-shenwei.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 > > > +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. > > > > As this increment is only executed under the NAPI kthread context, > is the protection still required? Are the statistics values read by ethtool under NAPI kthread context? Andrew