All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: netdev@vger.kernel.org
Cc: devel@linuxdriverproject.org, Haiyang Zhang <haiyangz@microsoft.com>
Subject: [PATCH net-next v2 08/27] net/hyperv: remove use of VLAN_TAG_PRESENT
Date: Tue,  3 Jan 2017 21:52:35 +0100 (CET)	[thread overview]
Message-ID: <5d2e51e5eae9a64406ba6ca23edc048acb4f1075.1483475202.git.mirq-linux@rere.qmqm.pl> (raw)
In-Reply-To: <cover.1483475202.git.mirq-linux@rere.qmqm.pl>

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 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,
-- 
2.11.0

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

  parent reply	other threads:[~2017-01-03 20:52 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03  9:22 [PATCH net-next] net: remove abuse of VLAN DEI/CFI bit Michał Mirosław
2016-12-03  9:22 ` [Bridge] " Michał Mirosław
2016-12-03 23:27 ` [ovs-dev] " Ben Pfaff
2016-12-03 23:27   ` [Bridge] " Ben Pfaff
2016-12-05 17:24   ` Michał Mirosław
2016-12-05 17:24     ` [Bridge] " Michał Mirosław
2016-12-05 18:55     ` Ben Pfaff
2016-12-05 18:55       ` [Bridge] " Ben Pfaff
     [not found]       ` <20161205185545.GB3129-LZ6Gd1LRuIk@public.gmane.org>
2016-12-05 22:52         ` Michał Mirosław
2016-12-05 22:52           ` [Bridge] [ovs-dev] " Michał Mirosław
     [not found]           ` <20161205225247.e3dd6dcw3ryjjlp2-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2016-12-06  0:59             ` Ben Pfaff
2016-12-06  0:59               ` [Bridge] [ovs-dev] " Ben Pfaff
2016-12-13  0:12 ` [PATCH net-next 00/27] Remove VLAN CFI bit abuse Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 02/27] net/vlan: introduce __vlan_hwaccel_copy_tag() helper Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 03/27] ibmvnic: fix accelerated VLAN handling Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 01/27] net/vlan: introduce __vlan_hwaccel_clear_tag() helper Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 04/27] qlcnic: remove assumption that vlan_tci != 0 Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 05/27] i40iw: remove use of VLAN_TAG_PRESENT Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 08/27] net/hyperv: " Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 07/27] gianfar: " Michał Mirosław
2016-12-13 12:09     ` Claudiu Manoil
2016-12-13  0:12   ` [PATCH net-next 06/27] cnic: " Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 11/27] sky2: use __vlan_hwaccel helpers Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 09/27] cxgb4: " Michał Mirosław
2016-12-13  1:40     ` Steve Wise
2016-12-13  0:12   ` [PATCH net-next 13/27] bridge: " Michał Mirosław
2016-12-13  0:12     ` [Bridge] " Michał Mirosław
2016-12-13 12:59     ` Sergei Shtylyov
2016-12-13 12:59       ` [Bridge] " Sergei Shtylyov
2016-12-13 15:11       ` Michał Mirosław
2016-12-13 15:11         ` [Bridge] " Michał Mirosław
2016-12-14  0:40         ` Toshiaki Makita
2016-12-14  0:40           ` [Bridge] " Toshiaki Makita
2016-12-13  0:12   ` [PATCH net-next 14/27] 8021q: " Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 18/27] net/skbuff: add macros for VLAN_PRESENT bit Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 16/27] nfnetlink/queue: use __vlan_hwaccel helpers Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 15/27] ipv4/tunnel: " Michał Mirosław
     [not found]   ` <cover.1481586602.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2016-12-13  0:12     ` [PATCH net-next 17/27] OVS: remove assumptions about VLAN_TAG_PRESENT bit Michał Mirosław
     [not found]       ` <e44219bc56d3e44aa0711c83c626adabf4c4ecd8.1481586602.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2016-12-13 10:40         ` Jiri Benc
2016-12-13 15:14           ` Michał Mirosław
2016-12-13 15:31         ` [PATCH/replace net-next 17/27] OVS: remove use of VLAN_TAG_PRESENT Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 19/27] net/bpf_jit: ARM: split VLAN_PRESENT bit handling from VLAN_TCI Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 21/27] net/bpf_jit: PPC: " Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 20/27] net/bpf_jit: MIPS: " Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  1:22     ` Ralf Baechle
2016-12-13  0:12   ` [PATCH net-next 23/27] net/bpf: " Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 22/27] net/bpf_jit: SPARC: " Michał Mirosław
2016-12-13  0:12     ` Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 24/27] bpf_test: prepare for VLAN_TAG_PRESENT removal Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 25/27] net: remove VLAN_TAG_PRESENT Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 26/27] net/hyperv: enable passing of VLAN.CFI bit Michał Mirosław
2016-12-13  0:12   ` [PATCH net-next 27/27] net/vlan: remove unused #define HAVE_VLAN_GET_TAG Michał Mirosław
2016-12-13  5:18   ` [PATCH net-next 00/27] Remove VLAN CFI bit abuse Michał Mirosław
2016-12-14  1:16   ` Stephen Hemminger
2016-12-14  2:00     ` Michał Mirosław
2017-01-03 20:52   ` [PATCH net-next v2 00/27] Allow passing of VLAN CFI bit through network stack Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 02/27] net/vlan: introduce __vlan_hwaccel_copy_tag() helper Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 03/27] ibmvnic: fix accelerated VLAN handling Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 01/27] net/vlan: introduce __vlan_hwaccel_clear_tag() helper Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 05/27] i40iw: remove use of VLAN_TAG_PRESENT Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 04/27] qlcnic: remove assumption that vlan_tci != 0 Michał Mirosław
2017-01-04 11:29       ` Chopra, Manish
2017-01-03 20:52     ` [PATCH net-next v2 06/27] cnic: remove use of VLAN_TAG_PRESENT Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 07/27] gianfar: " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 09/27] cxgb4: use __vlan_hwaccel helpers Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 11/27] sky2: " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 12/27] net/core: " Michał Mirosław
2017-01-03 20:52     ` Michał Mirosław [this message]
2017-01-03 20:52     ` [PATCH net-next v2 10/27] benet: " Michał Mirosław
     [not found]       ` <CACZ4nhsUxWYvM5HoASHb7-m2uZtnk3DN6cQigp+cObyLqPJXdA@mail.gmail.com>
2017-01-03 23:11         ` [PATCH net-next v3 " Michał Mirosław
2017-01-11  5:29           ` Somnath Kotur
2017-01-03 20:52     ` [PATCH net-next v2 13/27] bridge: " Michał Mirosław
2017-01-03 20:52       ` [Bridge] " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 14/27] 8021q: " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 15/27] ipv4/tunnel: " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 16/27] nfnetlink/queue: " Michał Mirosław
     [not found]     ` <cover.1483475202.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-01-03 20:52       ` [PATCH net-next v2 17/27] OVS: remove use of VLAN_TAG_PRESENT Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 19/27] net/bpf_jit: ARM: split VLAN_PRESENT bit handling from VLAN_TCI Michał Mirosław
2017-01-03 20:52       ` Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 18/27] net/skbuff: add macros for VLAN_PRESENT bit Michał Mirosław
2017-01-03 20:52       ` Michał Mirosław
2017-01-03 20:52       ` Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 20/27] net/bpf_jit: MIPS: split VLAN_PRESENT bit handling from VLAN_TCI Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 22/27] net/bpf_jit: SPARC: " Michał Mirosław
2017-01-03 20:52       ` Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 21/27] net/bpf_jit: PPC: " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 23/27] net/bpf: " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 24/27] bpf_test: prepare for VLAN_TAG_PRESENT removal Michał Mirosław
2017-01-03 21:16       ` Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 25/27] net: remove VLAN_TAG_PRESENT Michał Mirosław
     [not found]       ` <cover.1483477925.git.mirq-linux@rere.qmqm.pl>
2017-01-03 21:15         ` [PATCH net-next v3 " Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 26/27] net/hyperv: enable passing of VLAN.CFI bit Michał Mirosław
2017-01-03 20:52     ` [PATCH net-next v2 27/27] net/vlan: remove unused #define HAVE_VLAN_GET_TAG Michał Mirosław
2017-01-03 21:32     ` [PATCH net-next v2 00/27] Allow passing of VLAN CFI bit through network stack David Miller
2017-01-03 23:21       ` Michał Mirosław
2017-01-03 23:36         ` Michał Mirosław
2017-01-04  0:13       ` Michał Mirosław
2016-12-14  1:21 ` [PATCH net-next] net: remove abuse of VLAN DEI/CFI bit Stephen Hemminger
2016-12-14  1:21   ` [Bridge] " Stephen Hemminger
2016-12-14  2:03   ` Michał Mirosław
2016-12-14  2:03     ` [Bridge] " Michał Mirosław
     [not found]     ` <20161214020305.qck2bpxmfh6ltrw7-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2016-12-14  2:21       ` Alexei Starovoitov
2016-12-14  2:21         ` [Bridge] " Alexei Starovoitov
2016-12-14 14:28   ` Michał Mirosław
2016-12-14 14:28     ` [Bridge] " Michał Mirosław

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=5d2e51e5eae9a64406ba6ca23edc048acb4f1075.1483475202.git.mirq-linux@rere.qmqm.pl \
    --to=mirq-linux@rere.qmqm.pl \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --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 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.