lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87fukzousp.fsf@vitty.brq.redhat.com>
Date:   Wed, 04 Jan 2017 13:48:22 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc:     netdev@...r.kernel.org, devel@...uxdriverproject.org,
        Haiyang Zhang <haiyangz@...rosoft.com>
Subject: Re: [PATCH net-next] net/hyperv: remove use of VLAN_TAG_PRESENT

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

> Signed-off-by: Michał Mirosław <mirq-linux@...e.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ