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


Groups > linux.kernel > #1668389

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

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework
Date 2017-06-17 21:50 +0200
Message-ID <tTrTj-3hR-3@gated-at.bofh.it> (permalink)
References <tTpHP-1Qt-1@gated-at.bofh.it> <tTpHQ-1Qt-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> +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(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(node);
> +	spin_unlock_irqrestore(lock, flags);
> +}
> +

> +int hnae3_register_client(struct hnae3_client *client)
> +{
> +	struct hnae3_client *client_tmp;
> +	struct hnae3_ae_dev *ae_dev;
> +	int ret;
> +
> +	/* One system should only have one client for every type */
> +	list_for_each_entry(client_tmp, &hnae3_client_list, node) {
> +		if (client_tmp->type == client->type)
> +			return 0;
> +	}
> +
> +	hnae3_list_add(&hnae3_list_client_lock, &client->node,
> +		       &hnae3_client_list);

Please could you explain your locking scheme. I don't get it.

       Thanks
	Andrew

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


Thread

[PATCH V3 net-next 0/8] Hisilicon Network Subsystem 3 Ethernet Driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
  [PATCH V3 net-next 3/8] net: hns3: Add HNS3 IMP(Integrated Mgmt Proc) Cmd Interface Support Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
  [PATCH V3 net-next 8/8] net: hns3: Add HNS3 driver to kernel build framework & MAINTAINERS Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
  [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
    Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-17 21:50 +0200
    Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3  framework Andrew Lunn <andrew@lunn.ch> - 2017-06-18 17:10 +0200
    Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3  framework Bo Yu <tsu.yubo@gmail.com> - 2017-06-18 18:50 +0200
    Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3  framework Stephen Hemminger <stephen@networkplumber.org> - 2017-06-19 19:00 +0200
  [PATCH V3 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
  [PATCH V3 net-next 6/8] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
    Re: [PATCH V3 net-next 6/8] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-19 06:00 +0200
  [PATCH V3 net-next 5/8] net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
    Re: [PATCH V3 net-next 5/8] net: hns3: Add support of TX Scheduler &  Shaper to HNS3 driver Richard Cochran <richardcochran@gmail.com> - 2017-06-18 18:50 +0200
  Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet  Driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-17 20:00 +0200
  Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet  Driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-17 21:50 +0200
  Re: [PATCH V3 net-next 0/8] Hisilicon Network Subsystem 3 Ethernet  Driver Leon Romanovsky <leon@kernel.org> - 2017-06-18 08:10 +0200
  Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet  Driver for hip08 SoC Bo Yu <tsu.yubo@gmail.com> - 2017-06-18 19:00 +0200

csiph-web