Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp517165rwb; Thu, 10 Nov 2022 04:09:46 -0800 (PST) X-Google-Smtp-Source: AMsMyM6Fh0GXwVo66kIIqmHP8HZ6j8tdWINpcY5BS+8pCo1QoJxxTL8AFC9PXopfI9ygz7zQ6ZRl X-Received: by 2002:a17:90b:3886:b0:213:5ccc:973b with SMTP id mu6-20020a17090b388600b002135ccc973bmr83435412pjb.193.1668082186276; Thu, 10 Nov 2022 04:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668082186; cv=none; d=google.com; s=arc-20160816; b=efW2R4mZ0mBEJiaaF1q7teiSGigahYvOubhadZTgYSflN+YTleslSizBhoWIoseA0F sjEP1uMduAqjsV31VLzYk/Zf28JhTYCMuRUyZp+6TEgN5vhDDy7LAPQMXwJnBbl8yZr0 gniTwXljHQ9adf0cEmApFvCMIprK4FPXDsE1fUSPr7ad8hFaSOMc938O5f6lDgR2JbUb xl3Aon3RhUkfJlu0WkZ/tpiXzvlAA785d5EG0WbgdzJnHCrxahmU3ImtmjriisTBiuWx jf6XoY9Ceg0XhG1z0sJtEqMUhUiZikXvMveHDcYWgQPXqQS0sNlHrA4QwZmgTdSkktLd dwjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=DBXYRpLp9moONU6VGCquLi5t9Eh718cfLlFyFi9l3CA=; b=DMUfYSKfgXPe2hQuK9dsCyzoJUPx8OGPVCl9vKNK28XXJRA16Ld8mfUSTUWpnOMr2W uY3ssFeIFklV+6PTLEGutIjxHeYzbfpZ9ZdLQNIL0lNOwr7GI/xSxEZUKIoYcBfMT6+b U3CBcUAcDoPDMCLnHsqfRYeErwWZWbFKmqRNtHLP62j3RvRAOdW6fq1VFntBZnXPZXPr 5ehA4uXUyiGQ8C6KNGcM7k3lfmJjAAEWirxU63+54RLPSI4J16Lc6lTuL2s7s3oVQs86 O4Y0uxpV8lwCG8LelDi2vYOqRngypw9ipQljmtJXCOyywrO0hggfL8UneNxyB6y0JYI2 wxhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fAbtH5bE; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw15-20020a056a00450f00b0053b082ebe62si18888363pfb.269.2022.11.10.04.09.33; Thu, 10 Nov 2022 04:09:46 -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=@redhat.com header.s=mimecast20190719 header.b=fAbtH5bE; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbiKJLzV (ORCPT + 92 others); Thu, 10 Nov 2022 06:55:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbiKJLzT (ORCPT ); Thu, 10 Nov 2022 06:55:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 080A45D6B6 for ; Thu, 10 Nov 2022 03:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668081261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DBXYRpLp9moONU6VGCquLi5t9Eh718cfLlFyFi9l3CA=; b=fAbtH5bEpWweISKPfGk0FD6NungyyK+939ASZxNfUsDkZ1ifeTtC6OuqWCxk62W3A6upAm H0PwnJHVRdqHyTLHVDAx4JkdCIqSH8dpFoU+56879NI8qs1MznBH831gWE9N9IYfVVq2d6 rMh7Xlsw5Z8Eq20Xrbzly069NOkRl0o= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-590-CBsAB1dVMK252uL5g39_wQ-1; Thu, 10 Nov 2022 06:54:18 -0500 X-MC-Unique: CBsAB1dVMK252uL5g39_wQ-1 Received: by mail-qv1-f69.google.com with SMTP id ob9-20020a0562142f8900b004bba5363ad9so1279626qvb.8 for ; Thu, 10 Nov 2022 03:54:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DBXYRpLp9moONU6VGCquLi5t9Eh718cfLlFyFi9l3CA=; b=rUuR76u30Ycj3y1fcyWyBXpkqAX8SZ3hGg6ylPMsfcQsx319Hh54J9V76hN9rCcSpZ SSVKur1VgCiKtLI+wxILv/E6YJRsEuIS9C7fyPjQrEpS0/D9w24BvGjClRkEq24C2v3K CGw4iI5D2aYXkDHVz7aYxtT8x1rbSG3WQ717Y8WuToiPgnPUWjETmLmD3qN/nu3sEn7B a2rcPZgn8WTWLbUBv/mC7VbmO/C0dIMzPquBIuEgb2/V6WHWy5GIhDwZWPxiDcXY6zgx c4JS+8ty1xqemG8EzCsB5O24lhBQ07p1LBZrnFFPMamLh988zIsda4840UE8vnXVOEgW qEEw== X-Gm-Message-State: ACrzQf2VPr5xUfYigQXxBRltcoTySHoU5UEPCztmeLPC5mW5L7+XQUPN 8AkuhGJXpQt3+voX54noopoZeuCCItVFYQJW51ypcZczoocykSLcXd9dgdDj1Ej4rL/7aGtZO2n 8iI9UvTU4mPIERIbN7jknz9Ct X-Received: by 2002:ac8:4b5c:0:b0:3a5:3819:4f6c with SMTP id e28-20020ac84b5c000000b003a538194f6cmr38476103qts.115.1668081257433; Thu, 10 Nov 2022 03:54:17 -0800 (PST) X-Received: by 2002:ac8:4b5c:0:b0:3a5:3819:4f6c with SMTP id e28-20020ac84b5c000000b003a538194f6cmr38476094qts.115.1668081257203; Thu, 10 Nov 2022 03:54:17 -0800 (PST) Received: from gerbillo.redhat.com (146-241-120-203.dyn.eolo.it. [146.241.120.203]) by smtp.gmail.com with ESMTPSA id o16-20020a05620a2a1000b006ce3f1af120sm13196566qkp.44.2022.11.10.03.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 03:54:16 -0800 (PST) Message-ID: <4349bc93a5f2130a95305287141fde369245f921.camel@redhat.com> Subject: Re: [PATCH v2 RESEND 1/1] net: fec: add xdp and page pool statistics From: Paolo Abeni To: Shenwei Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski Cc: Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Date: Thu, 10 Nov 2022 12:54:13 +0100 In-Reply-To: <20221109023147.242904-1-shenwei.wang@nxp.com> References: <20221109023147.242904-1-shenwei.wang@nxp.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Hello, On Tue, 2022-11-08 at 20:31 -0600, Shenwei Wang wrote: > @@ -2685,9 +2738,16 @@ static void fec_enet_get_strings(struct net_device *netdev, > int i; > switch (stringset) { > case ETH_SS_STATS: > - for (i = 0; i < ARRAY_SIZE(fec_stats); i++) > - memcpy(data + i * ETH_GSTRING_LEN, > - fec_stats[i].name, ETH_GSTRING_LEN); > + for (i = 0; i < ARRAY_SIZE(fec_stats); i++) { > + memcpy(data, fec_stats[i].name, ETH_GSTRING_LEN); > + data += ETH_GSTRING_LEN; > + } > + for (i = 0; i < ARRAY_SIZE(fec_xdp_stat_strs); i++) { > + memcpy(data, fec_xdp_stat_strs[i], ETH_GSTRING_LEN); > + data += ETH_GSTRING_LEN; The above triggers a warning: In function ‘fortify_memcpy_chk’, inlined from ‘fec_enet_get_strings’ at ../drivers/net/ethernet/freescale/fec_main.c:2788:4: ../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 413 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I think you can address it changing fec_xdp_stat_strs definition to: static const char fec_xdp_stat_strs[XDP_STATS_TOTAL][ETH_GSTRING_LEN] = { // ... Cheers, Paolo