netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: netdev@vger.kernel.org,
	Aleksander Morgado <aleksander@aleksander.es>,
	Marcel Holtmann <marcel@holtmann.org>,
	Dan Williams <dcbw@redhat.com>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 3/6] usbnet: allow mini-drivers to consume L2 headers
Date: Thu, 03 Dec 2015 21:03:54 +0100	[thread overview]
Message-ID: <1449173034.4355.0.camel@suse.com> (raw)
In-Reply-To: <1449167063-22703-4-git-send-email-bjorn@mork.no>

On Thu, 2015-12-03 at 19:24 +0100, Bjørn Mork wrote:
> Assume the minidriver has taken care of all L2 header parsing
> if it sets skb->protocol.  This allows the minidriver to
> support non-ethernet L2 headers, and even operate without
> any L2 header at all.
> 
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Oliver Neukum <oneukum@suse.com>
> ---
>  drivers/net/usb/usbnet.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 0744bf2ef2d6..0b0ba7ef14e4 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -324,7 +324,10 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb)
>  		return;
>  	}
>  
> -	skb->protocol = eth_type_trans (skb, dev->net);
> +	/* only update if unset to allow minidriver rx_fixup override */
> +	if (skb->protocol == 0)
> +		skb->protocol = eth_type_trans (skb, dev->net);
> +
>  	dev->net->stats.rx_packets++;
>  	dev->net->stats.rx_bytes += skb->len;
>  

  reply	other threads:[~2015-12-03 20:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 18:24 [PATCH 0/6] net: qmi_wwan: MDM9x30 support Bjørn Mork
2015-12-03 18:24 ` [PATCH 1/6] net: qmi_wwan: MDM9x30 specific power management Bjørn Mork
2015-12-03 18:24 ` [PATCH 2/6] net: qmi_wwan: remove 1199:9070 device id Bjørn Mork
2015-12-03 18:24 ` [PATCH 3/6] usbnet: allow mini-drivers to consume L2 headers Bjørn Mork
2015-12-03 20:03   ` Oliver Neukum [this message]
2015-12-03 18:24 ` [PATCH 4/6] net: qmi_wwan: support "raw IP" mode Bjørn Mork
2015-12-03 18:24 ` [PATCH 6/6] MAINTAINERS: add qmi_wwan driver entry Bjørn Mork
2015-12-03 19:36 ` [PATCH 0/6] net: qmi_wwan: MDM9x30 support Dan Williams
2015-12-04  9:56 ` Aleksander Morgado
     [not found] ` <1449167063-22703-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2015-12-03 18:24   ` [PATCH 5/6] net: qmi_wwan: document the qmi/raw_ip sysfs file Bjørn Mork
2015-12-04 21:56   ` [PATCH 0/6] net: qmi_wwan: MDM9x30 support 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=1449173034.4355.0.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=aleksander@aleksander.es \
    --cc=bjorn@mork.no \
    --cc=dcbw@redhat.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    /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).