From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Vlad Yasevich <vyasevic@redhat.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, mst@redhat.com,
jasowang@redhat.com
Subject: Re: [PATCH net-next 2/2] macvtap: Perform GSO on forwarding path.
Date: Wed, 19 Jun 2013 22:09:07 +0400 [thread overview]
Message-ID: <51C1F3C3.4060900@cogentembedded.com> (raw)
In-Reply-To: <1371653272-11703-3-git-send-email-vyasevic@redhat.com>
Hello.
On 06/19/2013 06:47 PM, Vlad Yasevich wrote:
> When macvtap forwards skb to its tap, it needs to check
> if GSO needs to be performed. This is necessary
> when the HW device performed GRO, but the guest reading
> from the tap does not support it (ex: Windows 7).
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
> ---
> drivers/net/macvtap.c | 26 +++++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> index 09f0b1f..698f613 100644
> --- a/drivers/net/macvtap.c
> +++ b/drivers/net/macvtap.c
> @@ -291,13 +291,37 @@ static void macvtap_del_queues(struct net_device *dev)
> static int macvtap_forward(struct net_device *dev, struct sk_buff *skb)
> {
> struct macvtap_queue *q = macvtap_get_queue(dev, skb);
> + netdev_features_t features;
> if (!q)
> goto drop;
>
> if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len)
> goto drop;
>
> - skb_queue_tail(&q->sk.sk_receive_queue, skb);
> + features = netif_skb_features(skb);
> + if (netif_needs_gso(skb, features)) {
> + struct sk_buff *segs = skb_gso_segment(skb, features);
> +
> + if (IS_ERR(segs))
> + goto drop;
> +
> + if (!segs) {
> + skb_queue_tail(&q->sk.sk_receive_queue, skb);
> + goto wake_up;
> + }
> +
> + kfree_skb(skb);
> + while (segs) {
> + struct sk_buff *nskb = segs->next;
> +
> + segs->next = NULL;
> + skb_queue_tail(&q->sk.sk_receive_queue, segs);
> + segs = nskb;
> + }
> + } else
> + skb_queue_tail(&q->sk.sk_receive_queue, skb);
According to Documentation/CodingStyle, *else* branch should have {}
if the other branch has it (and vice versa).
WBR, Sergei
prev parent reply other threads:[~2013-06-19 18:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 14:47 [PATCH net-next 0/2] macvtap: Add support for offload control Vlad Yasevich
2013-06-19 14:47 ` [PATCH net-next 1/2] macvtap: Let TUNSETOFFLOAD actually controll offload features Vlad Yasevich
2013-06-19 15:16 ` Michael S. Tsirkin
2013-06-19 15:47 ` Vlad Yasevich
2013-06-19 15:55 ` Michael S. Tsirkin
2013-06-19 17:05 ` Vlad Yasevich
2013-06-19 18:17 ` Michael S. Tsirkin
2013-06-19 15:17 ` Eric Dumazet
2013-06-19 15:26 ` Vlad Yasevich
2013-06-19 15:46 ` Eric Dumazet
2013-06-19 16:20 ` Vlad Yasevich
2013-06-19 16:34 ` Eric Dumazet
2013-06-19 18:59 ` Vlad Yasevich
2013-06-19 22:38 ` Arnd Bergmann
2013-06-19 14:47 ` [PATCH net-next 2/2] macvtap: Perform GSO on forwarding path Vlad Yasevich
2013-06-19 15:30 ` Michael S. Tsirkin
2013-06-19 16:27 ` Vlad Yasevich
2013-06-19 16:22 ` Vlad Yasevich
2013-06-19 18:09 ` Sergei Shtylyov [this message]
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=51C1F3C3.4060900@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=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.