Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754123AbdFNBc3 (ORCPT ); Tue, 13 Jun 2017 21:32:29 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:48616 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753311AbdFNBc2 (ORCPT ); Tue, 13 Jun 2017 21:32:28 -0400 Date: Wed, 14 Jun 2017 03:32:23 +0200 From: Andrew Lunn To: Salil Mehta Cc: davem@davemloft.net, yisen.zhuang@huawei.com, huangdaode@hisilicon.com, lipeng321@huawei.com, mehta.salil.lnk@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com Subject: Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3 framework Message-ID: <20170614013223.GF23384@lunn.ch> References: <20170613231035.494020-1-salil.mehta@huawei.com> <20170613231035.494020-3-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170613231035.494020-3-salil.mehta@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2545 Lines: 74 On Wed, Jun 14, 2017 at 12:10:29AM +0100, Salil Mehta wrote: > This patch adds the support of the HNAE3 (Hisilicon Network > Acceleration Engine 3) framework support to the HNS3 driver. > > Framework facilitates clients like ENET(HNS3 Ethernet Driver), RoCE > and user-space Ethernet drivers (like ODP etc.) to register with HNAE3 > devices and their associated operations. > > Signed-off-by: Daode Huang > Signed-off-by: lipeng > Signed-off-by: Salil Mehta > Signed-off-by: Yisen Zhuang > --- > drivers/net/ethernet/hisilicon/hns3/hnae3.c | 305 +++++++++++++++++++ > drivers/net/ethernet/hisilicon/hns3/hnae3.h | 449 ++++++++++++++++++++++++++++ > 2 files changed, 754 insertions(+) > create mode 100644 drivers/net/ethernet/hisilicon/hns3/hnae3.c > create mode 100644 drivers/net/ethernet/hisilicon/hns3/hnae3.h > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c > new file mode 100644 > index 0000000..f133e1d > --- /dev/null > +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c > @@ -0,0 +1,305 @@ > +/* > + * Copyright (c) 2016-2017 Hisilicon Limited. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + */ > + > +#include > +#include > +#include > + > +#include "hnae3.h" > + > +static LIST_HEAD(hnae3_ae_algo_list); > +static LIST_HEAD(hnae3_client_list); > +static LIST_HEAD(hnae3_ae_dev_list); > + > +static DEFINE_SPINLOCK(hnae3_list_ae_algo_lock); > +static DEFINE_SPINLOCK(hnae3_list_client_lock); > +static DEFINE_SPINLOCK(hnae3_list_ae_dev_lock); > + > +static void hnae3_list_add(spinlock_t *lock, struct list_head *node, > + struct list_head *head) > +{ > + unsigned long flags; > + > + spin_lock_irqsave(lock, flags); > + list_add_tail_rcu(node, head); > + spin_unlock_irqrestore(lock, flags); > +} > + > +static void hnae3_list_del(spinlock_t *lock, struct list_head *node) > +{ > + unsigned long flags; > + > + spin_lock_irqsave(lock, flags); > + list_del_rcu(node); > + spin_unlock_irqrestore(lock, flags); > +} You have these two _rcu operations here, and no others. I don't see any rcu_read_lock(), or call_rcu(), etc. I'm not an RCU expert, but this looks odd to me. Andrew