Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1665357

Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3 framework

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3 framework
Date 2017-06-14 03:40 +0200
Message-ID <tS5rP-757-1@gated-at.bofh.it> (permalink)
References <tS3gl-5Od-5@gated-at.bofh.it> <tS3gn-5Od-43@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <huangdaode@hisilicon.com>
> Signed-off-by: lipeng <lipeng321@huawei.com>
> Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
> ---
>  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 <linux/slab.h>
> +#include <linux/list.h>
> +#include <linux/spinlock.h>
> +
> +#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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3 framework Salil Mehta <salil.mehta@huawei.com> - 2017-06-14 01:20 +0200
  Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-14 03:40 +0200
    RE: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3  framework Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 13:20 +0200
  Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-14 03:40 +0200
    RE: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3  framework Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 13:20 +0200
      Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-17 14:20 +0200
  Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-18 17:00 +0200

csiph-web