All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Vlad Yasevich <vyasevic@redhat.com>, netdev@vger.kernel.org
Cc: mst@redhat.com
Subject: Re: [PATCH] macvtap: Do not double-count received packets
Date: Wed, 27 Nov 2013 10:12:45 +0800	[thread overview]
Message-ID: <5295551D.6070509@redhat.com> (raw)
In-Reply-To: <1385487432-17651-1-git-send-email-vyasevic@redhat.com>

On 11/27/2013 01:37 AM, Vlad Yasevich wrote:
> Currently macvlan will count received packets after calling each
> vlans receive handler.   Macvtap attempts to count the packet
> yet again when the user reads the packet from the tap socket.
> This code doesn't do this consistently either.  Remove the
> counting from macvap and let only macvlan count received
> packets.
>
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
> ---
>  drivers/net/macvtap.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> index dc76670..50f8dce 100644
> --- a/drivers/net/macvtap.c
> +++ b/drivers/net/macvtap.c
> @@ -767,7 +767,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
>  				const struct sk_buff *skb,
>  				const struct iovec *iv, int len)
>  {
> -	struct macvlan_dev *vlan;
>  	int ret;
>  	int vnet_hdr_len = 0;
>  	int vlan_offset = 0;
> @@ -821,15 +820,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
>  	copied += len;
>  
>  done:
> -	rcu_read_lock();
> -	vlan = rcu_dereference(q->vlan);
> -	if (vlan) {
> -		preempt_disable();
> -		macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
> -		preempt_enable();
> -	}
> -	rcu_read_unlock();
> -
>  	return ret ? ret : copied;
>  }
>  

Acked-by: Jason Wang <jasowang@redhat.com>

  parent reply	other threads:[~2013-11-27  2:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 17:37 [PATCH] macvtap: Do not double-count received packets Vlad Yasevich
2013-11-26 21:09 ` Michael S. Tsirkin
2013-11-27  2:12 ` Jason Wang [this message]
2013-11-29 21:07 ` David Miller

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=5295551D.6070509@redhat.com \
    --to=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevic@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.