netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: netdev@vger.kernel.org, Haiyang Zhang <haiyangz@microsoft.com>,
	devel@linuxdriverproject.org
Subject: Re: [PATCH net-next] net/hyperv: remove use of VLAN_TAG_PRESENT
Date: Wed, 04 Jan 2017 13:48:22 +0100	[thread overview]
Message-ID: <87fukzousp.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <85c211f16e696607c9f61f96b8234684a2a2385b.1483487888.git.mirq-linux@rere.qmqm.pl> ("Michał Mirosław"'s message of "Wed, 4 Jan 2017 01:07:58 +0100 (CET)")

Michał Mirosław <mirq-linux@rere.qmqm.pl> writes:

> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Can we have a non-empty description please?

> ---
>  drivers/net/hyperv/hyperv_net.h   |  2 +-
>  drivers/net/hyperv/netvsc_drv.c   | 13 ++++++-------
>  drivers/net/hyperv/rndis_filter.c |  4 ++--
>  3 files changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> index 3958adade7eb..b53729e85a79 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -186,7 +186,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
>  			void **data,
>  			struct ndis_tcp_ip_checksum_info *csum_info,
>  			struct vmbus_channel *channel,
> -			u16 vlan_tci);
> +			u16 vlan_tci, bool vlan_present);
>  void netvsc_channel_cb(void *context);
>  int rndis_filter_open(struct netvsc_device *nvdev);
>  int rndis_filter_close(struct netvsc_device *nvdev);
> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index c9414c054852..6597d7901929 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -595,7 +595,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
>  static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
>  				struct hv_netvsc_packet *packet,
>  				struct ndis_tcp_ip_checksum_info *csum_info,
> -				void *data, u16 vlan_tci)
> +				void *data)
>  {
>  	struct sk_buff *skb;
>
> @@ -625,10 +625,6 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
>  			skb->ip_summed = CHECKSUM_UNNECESSARY;
>  	}
>
> -	if (vlan_tci & VLAN_TAG_PRESENT)
> -		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
> -				       vlan_tci);
> -
>  	return skb;
>  }
>
> @@ -641,7 +637,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
>  				void **data,
>  				struct ndis_tcp_ip_checksum_info *csum_info,
>  				struct vmbus_channel *channel,
> -				u16 vlan_tci)
> +				u16 vlan_tci, bool vlan_present)
>  {
>  	struct net_device *net = hv_get_drvdata(device_obj);
>  	struct net_device_context *net_device_ctx = netdev_priv(net);
> @@ -664,12 +660,15 @@ int netvsc_recv_callback(struct hv_device *device_obj,
>  		net = vf_netdev;
>
>  	/* Allocate a skb - TODO direct I/O to pages? */
> -	skb = netvsc_alloc_recv_skb(net, packet, csum_info, *data, vlan_tci);
> +	skb = netvsc_alloc_recv_skb(net, packet, csum_info, *data);
>  	if (unlikely(!skb)) {
>  		++net->stats.rx_dropped;
>  		return NVSP_STAT_FAIL;
>  	}
>
> +	if (vlan_present)
> +		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci);
> +
>  	if (net != vf_netdev)
>  		skb_record_rx_queue(skb,
>  				    channel->offermsg.offer.sub_channel_index);
> diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
> index 8d90904e0e49..7f7b410a41c2 100644
> --- a/drivers/net/hyperv/rndis_filter.c
> +++ b/drivers/net/hyperv/rndis_filter.c
> @@ -381,13 +381,13 @@ static int rndis_filter_receive_data(struct rndis_device *dev,
>
>  	vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO);
>  	if (vlan) {
> -		vlan_tci = VLAN_TAG_PRESENT | vlan->vlanid |
> +		vlan_tci = vlan->vlanid |
>  			(vlan->pri << VLAN_PRIO_SHIFT);
>  	}
>
>  	csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO);
>  	return netvsc_recv_callback(net_device_ctx->device_ctx, pkt, data,
> -				    csum_info, channel, vlan_tci);
> +				    csum_info, channel, vlan_tci, vlan);
>  }
>
>  int rndis_filter_receive(struct hv_device *dev,

-- 
  Vitaly
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2017-01-04 12:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04  0:07 [PATCH net-next] net/hyperv: remove use of VLAN_TAG_PRESENT Michał Mirosław
2017-01-04 12:48 ` Vitaly Kuznetsov [this message]
2017-01-04 18:47 ` Stephen Hemminger

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=87fukzousp.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --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).