From: John Fastabend <john.fastabend@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Subject: Re: [Patch net-next 1/3] net: introduce helper dev_change_tx_queue_len()
Date: Sat, 20 Jan 2018 20:52:03 -0800 [thread overview]
Message-ID: <ae1a5b4f-42b6-4337-8e46-ec344aef30c1@gmail.com> (raw)
In-Reply-To: <20180119230933.10009-2-xiyou.wangcong@gmail.com>
On 01/19/2018 03:09 PM, Cong Wang wrote:
> This patch promotes the local change_tx_queue_len() to a core
> helper function, dev_change_tx_queue_len(), so that rtnetlink
> and net-sysfs could share the code. This also prepares for the
> following patch.
>
> Note, the -EFAULT in the original code doesn't make sense,
> we should propagate the errno from notifiers.
>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
[...]
> static ssize_t tx_queue_len_store(struct device *dev,
> struct device_attribute *attr,
> const char *buf, size_t len)
> @@ -355,7 +332,7 @@ static ssize_t tx_queue_len_store(struct device *dev,
> if (!capable(CAP_NET_ADMIN))
> return -EPERM;
>
> - return netdev_store(dev, attr, buf, len, change_tx_queue_len);
> + return netdev_store(dev, attr, buf, len, dev_change_tx_queue_len);
> }
Is this protected by RTNL lock? If not what happens if this and do_setlink
both try to change tx queue length at the same time? Seems we could get
a race with multiple dev_deactivate/dev_activate sequences in-flight in
the following 2/3 patch.
Thanks,
John
> NETDEVICE_SHOW_RW(tx_queue_len, fmt_dec);
>
next prev parent reply other threads:[~2018-01-21 4:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 23:09 [Patch net-next 0/3] net_sched: reflect tx_queue_len change for pfifo_fast Cong Wang
2018-01-19 23:09 ` [Patch net-next 1/3] net: introduce helper dev_change_tx_queue_len() Cong Wang
2018-01-21 4:52 ` John Fastabend [this message]
2018-01-21 20:30 ` Cong Wang
2018-01-21 22:09 ` John Fastabend
2018-01-19 23:09 ` [Patch net-next 2/3] net_sched: plug in qdisc ops change_tx_queue_len Cong Wang
2018-01-21 22:12 ` John Fastabend
2018-01-22 22:44 ` Cong Wang
2018-01-23 18:07 ` Cong Wang
2018-01-23 18:17 ` John Fastabend
2018-01-23 18:17 ` John Fastabend
2018-01-19 23:09 ` [Patch net-next 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast Cong Wang
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=ae1a5b4f-42b6-4337-8e46-ec344aef30c1@gmail.com \
--to=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.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).