Received: by 10.192.165.148 with SMTP id m20csp3952341imm; Mon, 7 May 2018 23:48:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp26ZjFtvZMk1d99xbazdSMGeEF1KRefvhv+I18uQlA1DQlWT1PXGKkgWa69lIHbQgdaMVT X-Received: by 2002:a17:902:64d0:: with SMTP id y16-v6mr39672805pli.349.1525762096278; Mon, 07 May 2018 23:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525762096; cv=none; d=google.com; s=arc-20160816; b=09YpJSgXQRAZmNGisjlIt1pmplHTsxZUPU8JbgeUVsMo5b03Q0vHwp7cBhoovLk01M n262f0N1bLUpNYZp6gpN/ZLSnTsHaMcPqc1LqFNALDrewu8sUzR6OpVIFppHbtszeDJv 3L74CK3wWvogEuHT8+dFLBB/Vj2MkAkukA2ZApcvaXaHp+RarIFJnwNbB8BtqdMAElSt Pffs6ngBy6bOvoJDjhoK87Djs2kPOWHY779uiFWPuwg8qPUy0/pBm/l203DdLcMxkd94 C0/RvC0zT5whLrNxXAOLxjQR1eKD/tIbVF6yBO43EbOJsQ0A6/k4ORQJkHdPj3qh5oCV W/ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=8qpqkUWZl+UBgicr8jMUvp5Eony89HIZBkuWMTUvSs0=; b=EpjodpWIObqmmBujTJmGGSJIE4GxIdh/8iJeHPz1YOj+tZ6DbEuPPkZiyoL5cust0B dD9l8P50t7W8PY691JumLDYlCjfPQE+u0XriR1+HnlQ9e71E53v6UTjfnpLzk714KQ6Y Ap1tuQ3GNyPu75wCMjfoalH11hbYXFgVXkD8SXybDqf8ZLPhiBXQmVQm7i1x3wmqjmYe eXW6QlRnN8pSR/A+bqUWagigI0VgeT9Lhw2+rweP6ilen/5XIrZDHvQa3eJSKeFbq333 531vFqMqM0z4wTTu2uUHMq2o+2fB8EmDMWh97KkG30iI7rdm9FboavZ+HAvW/+h73+ND 1ZyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e5fDS1Ei; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si4343189pgq.641.2018.05.07.23.48.01; Mon, 07 May 2018 23:48:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e5fDS1Ei; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754287AbeEHGrs (ORCPT + 99 others); Tue, 8 May 2018 02:47:48 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:45989 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754081AbeEHGrq (ORCPT ); Tue, 8 May 2018 02:47:46 -0400 Received: by mail-pl0-f66.google.com with SMTP id bi12-v6so1634417plb.12; Mon, 07 May 2018 23:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=8qpqkUWZl+UBgicr8jMUvp5Eony89HIZBkuWMTUvSs0=; b=e5fDS1EiohkwKlto0k2HWp7is2LB4APjdiVg7BcFuGzlr9NXUZciqiNzGufaAo2hCO oIAE51+SAQJXP64xGUMZmwtY8SAG9Wu0NRI8eO6Gd+jd9vL3FXqHrgDDXDqkLPkfbCtp q0tPMmdXDCWk7stkDU98bdaJEBut5BwDhl7gufze2Gqdz2MI65PmDNZgHDpm5SoBYOjy UxYNY7iBLWmfzg3/sZYvJ4pEM8xpeMFAHtMTGMn3NCkQDCuKht3I6cIa0oPIey8RR/qI nL7EolVCR6x4EHCsw/l3qono9ugU3eRt8iP1GeeMTtb7D+uM07PNMcW3lHzOrQx3uIQV qfbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=8qpqkUWZl+UBgicr8jMUvp5Eony89HIZBkuWMTUvSs0=; b=OZkuhPGD7lF1uUayHPJHy8YAUS9/9Tkr5TpmKUXh4Cie9K3yRLtxyl2CAcYWxJ6xQL sB7fbnRRvoYvvjQg+f09prtN1k0hW7gGRr4bJXkwV/ipdyNx/6j+5gCDKrnrQd9wxLuw uVwxxL6OUVee5nmU4KvR6bLhDnubHbhAlKA2XDnOPd5bx0r6apDFfdMquCCxhmfKz+g4 07NPQmIazM7LuPsnB/A48PoFwIcb5GHq3QX8d7UkcBuS6MhYprDMf3KRfSGubStaioYx TACOcGi0s33oW3E4UxVsco1PccHlpOyg4sWZy5OeUMoCWhxer9KM1ftov6iCtT12vh8x W+lg== X-Gm-Message-State: ALQs6tDzpvDk09M+Av7WfWUygksCRkAJDKs3hvfBok9AH+40z/rhG1jE Eqngmwu6zjnnhCDC12KLdcC5ATpl X-Received: by 2002:a17:902:aa4b:: with SMTP id c11-v6mr40262281plr.17.1525762066079; Mon, 07 May 2018 23:47:46 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.9? ([2402:f000:1:1501:200:5efe:a66f:4609]) by smtp.gmail.com with ESMTPSA id c18-v6sm36077845pgu.63.2018.05.07.23.47.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 May 2018 23:47:45 -0700 (PDT) Subject: Re: [PATCH] net: 8390: Fix possible data races in __ei_get_stats To: Eric Dumazet , davem@davemloft.net, fthain@telegraphics.com.au, joe@perches.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180507140809.28847-1-baijiaju1990@gmail.com> <6fe51782-2169-53c8-9bac-1715262e716d@gmail.com> From: Jia-Ju Bai Message-ID: Date: Tue, 8 May 2018 14:47:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/5/8 13:04, Eric Dumazet wrote: > > On 05/07/2018 07:16 PM, Jia-Ju Bai wrote: > >> Yes, "&dev->stats" will not change, because it is a fixed address. >> But the field data in "dev->stats" is changed (rx_frame_errors, rx_crc_errors and rx_missed_errors). >> So if the driver returns "&dev->stats" without lock protection (like on line 858), the field data value of this return value can be the changed field data value or unchanged field data value. > > We do not care. > > This function can be called by multiple cpus at the same time. > > As soon as one cpu returns from it, another cpu can happily modify dev->stats.ANYFIELD. > > Your patch fixes nothing at all. > Okay, thanks. I also find that my patch does not work... Best wishes, Jia-Ju Bai