From: Andrew Lunn <andrew@lunn.ch>
To: Salil Mehta <salil.mehta@huawei.com>
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 V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework
Date: Sat, 17 Jun 2017 21:45:38 +0200 [thread overview]
Message-ID: <20170617194538.GD1974@lunn.ch> (raw)
In-Reply-To: <20170617172431.177044-3-salil.mehta@huawei.com>
> +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
next prev parent reply other threads:[~2017-06-17 19:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-17 17:24 [PATCH V3 net-next 0/8] Hisilicon Network Subsystem 3 Ethernet Driver Salil Mehta
2017-06-17 17:24 ` [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Salil Mehta
2017-06-17 17:54 ` Andrew Lunn
2017-07-22 23:17 ` Salil Mehta
2017-06-17 19:41 ` Andrew Lunn
2017-06-19 0:18 ` Bo Yu
2017-07-22 23:34 ` Salil Mehta
2017-06-19 0:57 ` Bo Yu
2017-07-22 23:39 ` Salil Mehta
2017-06-17 17:24 ` [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework Salil Mehta
2017-06-17 19:45 ` Andrew Lunn [this message]
2017-07-22 23:30 ` Salil Mehta
2017-06-18 15:02 ` Andrew Lunn
2017-07-22 23:32 ` Salil Mehta
2017-06-19 0:40 ` Bo Yu
2017-07-22 23:36 ` Salil Mehta
2017-06-19 16:59 ` Stephen Hemminger
2017-07-22 23:58 ` Salil Mehta
2017-06-17 17:24 ` [PATCH V3 net-next 3/8] net: hns3: Add HNS3 IMP(Integrated Mgmt Proc) Cmd Interface Support Salil Mehta
2017-06-17 17:24 ` [PATCH V3 net-next 4/8] net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support Salil Mehta
2017-06-17 17:24 ` [PATCH V3 net-next 5/8] net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver Salil Mehta
2017-06-18 16:45 ` Richard Cochran
2017-07-22 23:38 ` Salil Mehta
2017-07-23 6:13 ` Richard Cochran
2017-06-17 17:24 ` [PATCH V3 net-next 6/8] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Salil Mehta
2017-06-19 3:52 ` Andrew Lunn
2017-07-22 23:53 ` Salil Mehta
2017-06-17 17:24 ` [PATCH V3 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta
2017-06-17 17:24 ` [PATCH V3 net-next 8/8] net: hns3: Add HNS3 driver to kernel build framework & MAINTAINERS Salil Mehta
2017-06-18 6:07 ` [PATCH V3 net-next 0/8] Hisilicon Network Subsystem 3 Ethernet Driver Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170617194538.GD1974@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=huangdaode@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lipeng321@huawei.com \
--cc=mehta.salil.lnk@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).