linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] tap: comment fix
@ 2018-08-16 13:01 Wang Jian
  2018-08-16 19:30 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Wang Jian @ 2018-08-16 13:01 UTC (permalink / raw)
  To: David S . Miller, Jason, girish.moodalbail, mst,
	Willem de Bruijn, viro, wexu, netdev, linux-kernel

The tap_queue and the "tap_dev" are loosely coupled, not "macvlan_dev".

And I also change one rcu_read_lock's place, seems can reduce rcu
critical section a little.

Signed-off-by: Wang Jian <jianjian.wang1@gmail.com>
---
 drivers/net/tap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index f0f7cd9..e5e5a8e 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -125,7 +125,7 @@ static struct tap_dev *tap_dev_get_rcu(const
struct net_device *dev)

 /*
  * RCU usage:
- * The tap_queue and the macvlan_dev are loosely coupled, the
+ * The tap_queue and the tap_dev are loosely coupled, the
  * pointers from one to the other can only be read while rcu_read_lock
  * or rtnl is held.
  *
@@ -720,8 +720,6 @@ static ssize_t tap_get_user(struct tap_queue *q,
struct msghdr *m,
            __vlan_get_protocol(skb, skb->protocol, &depth) != 0)
                skb_set_network_header(skb, depth);

-       rcu_read_lock();
-       tap = rcu_dereference(q->tap);
        /* copy skb_ubuf_info for callback when skb has no error */
        if (zerocopy) {
                skb_shinfo(skb)->destructor_arg = m->msg_control;
@@ -732,6 +730,8 @@ static ssize_t tap_get_user(struct tap_queue *q,
struct msghdr *m,
                uarg->callback(uarg, false);
        }

+       rcu_read_lock();
+       tap = rcu_dereference(q->tap);
        if (tap) {
                skb->dev = tap->dev;
                dev_queue_xmit(skb);

-- 
Regards,
Wang Jian

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tap: comment fix
  2018-08-16 13:01 [PATCH 1/1] tap: comment fix Wang Jian
@ 2018-08-16 19:30 ` David Miller
  2018-08-17  4:28   ` Jason Wang
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2018-08-16 19:30 UTC (permalink / raw)
  To: jianjian.wang1
  Cc: jasowang, girish.moodalbail, mst, willemb, viro, wexu, netdev,
	linux-kernel

From: Wang Jian <jianjian.wang1@gmail.com>
Date: Thu, 16 Aug 2018 21:01:27 +0800

> The tap_queue and the "tap_dev" are loosely coupled, not "macvlan_dev".
> 
> And I also change one rcu_read_lock's place, seems can reduce rcu
> critical section a little.
> 
> Signed-off-by: Wang Jian <jianjian.wang1@gmail.com>

This patch was corrupted by your email client, for example it turned
TAB characters into sequences of spaces.

Please fix this, email a test patch to yourself, and do not resend the
patch to this mailing list until you can successfully extract and
cleanly apply the test patch you email to yourself.

Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tap: comment fix
  2018-08-16 19:30 ` David Miller
@ 2018-08-17  4:28   ` Jason Wang
  2018-08-17  8:24     ` Wang Jian
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Wang @ 2018-08-17  4:28 UTC (permalink / raw)
  To: David Miller, jianjian.wang1
  Cc: girish.moodalbail, mst, willemb, viro, wexu, netdev, linux-kernel



On 2018年08月17日 03:30, David Miller wrote:
> From: Wang Jian <jianjian.wang1@gmail.com>
> Date: Thu, 16 Aug 2018 21:01:27 +0800
>
>> The tap_queue and the "tap_dev" are loosely coupled, not "macvlan_dev".
>>
>> And I also change one rcu_read_lock's place, seems can reduce rcu
>> critical section a little.
>>
>> Signed-off-by: Wang Jian <jianjian.wang1@gmail.com>
> This patch was corrupted by your email client, for example it turned
> TAB characters into sequences of spaces.
>
> Please fix this, email a test patch to yourself, and do not resend the
> patch to this mailing list until you can successfully extract and
> cleanly apply the test patch you email to yourself.
>
> Thank you.

Besides this, please split it into two patches. The RCU change does not 
belong to "comment fix" for sure.

Thanks


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tap: comment fix
  2018-08-17  4:28   ` Jason Wang
@ 2018-08-17  8:24     ` Wang Jian
  0 siblings, 0 replies; 4+ messages in thread
From: Wang Jian @ 2018-08-17  8:24 UTC (permalink / raw)
  To: Jason
  Cc: David S . Miller, girish.moodalbail, mst, Willem de Bruijn, viro,
	wexu, netdev, linux-kernel

Thanks for the reminder.
Because this change is trivial, I change the subject.
On Fri, Aug 17, 2018 at 12:29 PM Jason Wang <jasowang@redhat.com> wrote:
>
>
>
> On 2018年08月17日 03:30, David Miller wrote:
> > From: Wang Jian <jianjian.wang1@gmail.com>
> > Date: Thu, 16 Aug 2018 21:01:27 +0800
> >
> >> The tap_queue and the "tap_dev" are loosely coupled, not "macvlan_dev".
> >>
> >> And I also change one rcu_read_lock's place, seems can reduce rcu
> >> critical section a little.
> >>
> >> Signed-off-by: Wang Jian <jianjian.wang1@gmail.com>
> > This patch was corrupted by your email client, for example it turned
> > TAB characters into sequences of spaces.
> >
> > Please fix this, email a test patch to yourself, and do not resend the
> > patch to this mailing list until you can successfully extract and
> > cleanly apply the test patch you email to yourself.
> >
> > Thank you.
>
> Besides this, please split it into two patches. The RCU change does not
> belong to "comment fix" for sure.
>
> Thanks
>


-- 
Regards,
Wang Jian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-17  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16 13:01 [PATCH 1/1] tap: comment fix Wang Jian
2018-08-16 19:30 ` David Miller
2018-08-17  4:28   ` Jason Wang
2018-08-17  8:24     ` Wang Jian

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).