Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752831AbdFQLNN convert rfc822-to-8bit (ORCPT ); Sat, 17 Jun 2017 07:13:13 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:8309 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752727AbdFQLNL (ORCPT ); Sat, 17 Jun 2017 07:13:11 -0400 From: Salil Mehta To: Andrew Lunn CC: "davem@davemloft.net" , "Zhuangyuzeng (Yisen)" , huangdaode , "lipeng (Y)" , "mehta.salil.lnk@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linuxarm Subject: RE: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3 framework Thread-Topic: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3 framework Thread-Index: AQHS5Jpnk4bbWRJFP0mlSPEY7mqpF6IjcWiAgAV6MtA= Date: Sat, 17 Jun 2017 11:12:53 +0000 Message-ID: References: <20170613231035.494020-1-salil.mehta@huawei.com> <20170613231035.494020-3-salil.mehta@huawei.com> <20170614013223.GF23384@lunn.ch> In-Reply-To: <20170614013223.GF23384@lunn.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.203.181.160] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.59450EC3.00EC,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.2.25, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 513fd0f2ad9248bac8c7dff33f7edbdd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3221 Lines: 97 Hi Andrew, > -----Original Message----- > From: Andrew Lunn [mailto:andrew@lunn.ch] > Sent: Wednesday, June 14, 2017 2:32 AM > To: Salil Mehta > Cc: davem@davemloft.net; Zhuangyuzeng (Yisen); huangdaode; lipeng (Y); > mehta.salil.lnk@gmail.com; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; Linuxarm > Subject: Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the > HNAE3 framework > > 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 Thanks for identifying this. I think we would be okay here even without rcu version. Will change this. Thanks Salil