From: "K. Y. Srinivasan" <kys@microsoft.com>
To: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com
Subject: [PATCH net-next V3 17/17] hv_netvsc: Eliminate vlan_tci from struct hv_netvsc_packet
Date: Tue, 1 Dec 2015 16:43:19 -0800 [thread overview]
Message-ID: <1449016999-9796-17-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1449016999-9796-1-git-send-email-kys@microsoft.com>
Eliminate vlan_tci from struct hv_netvsc_packet.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/net/hyperv/hyperv_net.h | 4 ++--
drivers/net/hyperv/netvsc_drv.c | 14 +++++++-------
drivers/net/hyperv/rndis_filter.c | 7 +++----
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 128b296..0c04362 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -136,7 +136,6 @@ struct hv_netvsc_packet {
u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */
u8 page_buf_cnt;
- u16 vlan_tci;
u16 q_idx;
u32 send_buf_index;
@@ -188,7 +187,8 @@ int netvsc_recv_callback(struct hv_device *device_obj,
struct hv_netvsc_packet *packet,
void **data,
struct ndis_tcp_ip_checksum_info *csum_info,
- struct vmbus_channel *channel);
+ struct vmbus_channel *channel,
+ u16 vlan_tci);
void netvsc_channel_cb(void *context);
int rndis_filter_open(struct hv_device *dev);
int rndis_filter_close(struct hv_device *dev);
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 490672e..ba21272 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -470,7 +470,6 @@ check_size:
FIELD_SIZEOF(struct sk_buff, cb));
packet = (struct hv_netvsc_packet *)skb->cb;
- packet->vlan_tci = skb->vlan_tci;
packet->q_idx = skb_get_queue_mapping(skb);
@@ -480,7 +479,7 @@ check_size:
memset(rndis_msg, 0, RNDIS_AND_PPI_SIZE);
- isvlan = packet->vlan_tci & VLAN_TAG_PRESENT;
+ isvlan = skb->vlan_tci & VLAN_TAG_PRESENT;
/* Add the rndis header */
rndis_msg->ndis_msg_type = RNDIS_MSG_PACKET;
@@ -508,8 +507,8 @@ check_size:
IEEE_8021Q_INFO);
vlan = (struct ndis_pkt_8021q_info *)((void *)ppi +
ppi->ppi_offset);
- vlan->vlanid = packet->vlan_tci & VLAN_VID_MASK;
- vlan->pri = (packet->vlan_tci & VLAN_PRIO_MASK) >>
+ vlan->vlanid = skb->vlan_tci & VLAN_VID_MASK;
+ vlan->pri = (skb->vlan_tci & VLAN_PRIO_MASK) >>
VLAN_PRIO_SHIFT;
}
@@ -676,7 +675,8 @@ int netvsc_recv_callback(struct hv_device *device_obj,
struct hv_netvsc_packet *packet,
void **data,
struct ndis_tcp_ip_checksum_info *csum_info,
- struct vmbus_channel *channel)
+ struct vmbus_channel *channel,
+ u16 vlan_tci)
{
struct net_device *net;
struct net_device_context *net_device_ctx;
@@ -716,9 +716,9 @@ int netvsc_recv_callback(struct hv_device *device_obj,
skb->ip_summed = CHECKSUM_NONE;
}
- if (packet->vlan_tci & VLAN_TAG_PRESENT)
+ if (vlan_tci & VLAN_TAG_PRESENT)
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
- packet->vlan_tci);
+ vlan_tci);
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 28adf6a..a37bbda 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -354,6 +354,7 @@ static int rndis_filter_receive_data(struct rndis_device *dev,
u32 data_offset;
struct ndis_pkt_8021q_info *vlan;
struct ndis_tcp_ip_checksum_info *csum_info;
+ u16 vlan_tci = 0;
rndis_pkt = &msg->msg.pkt;
@@ -384,15 +385,13 @@ static int rndis_filter_receive_data(struct rndis_device *dev,
vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO);
if (vlan) {
- pkt->vlan_tci = VLAN_TAG_PRESENT | vlan->vlanid |
+ vlan_tci = VLAN_TAG_PRESENT | vlan->vlanid |
(vlan->pri << VLAN_PRIO_SHIFT);
- } else {
- pkt->vlan_tci = 0;
}
csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO);
return netvsc_recv_callback(dev->net_dev->dev, pkt, data,
- csum_info, channel);
+ csum_info, channel, vlan_tci);
}
int rndis_filter_receive(struct hv_device *dev,
--
1.7.4.1
next prev parent reply other threads:[~2015-12-02 0:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 0:42 [PATCH net-next V3 00/17] hv_netvsc: Eliminate the additional head room K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 01/17] hv_netvsc: Resize some of the variables in hv_netvsc_packet K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 02/17] hv_netvsc: Rearrange the hv_negtvsc_packet to be space efficient K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 03/17] hv_netvsc: Eliminate the channel field in hv_netvsc_packet structure K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 04/17] hv_netvsc: Eliminate rndis_msg pointer from " K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 05/17] hv_netvsc: Eliminatte the data field from struct hv_netvsc_packet K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 06/17] hv_netvsc: Eliminate send_completion " K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 07/17] hv_netvsc: Eliminate send_completion_ctx " K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 08/17] hv_netvsc: Don't ask for additional head room in the skb K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 09/17] hv_netvsc: move subchannel existence check to netvsc_select_queue() K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 10/17] hv_netvsc: remove locking in netvsc_send() K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 11/17] hv_netvsc: Eliminate page_buf from struct hv_netvsc_packet K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH ney-next V3 12/17] hv_netvsc: Eliminate send_completion_tid " K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 13/17] hv_netvsc: Eliminate is_data_pkt " K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 14/17] hv_netvsc: Eliminate completion_func " K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 15/17] hv_netvsc: Eliminate xmit_more " K. Y. Srinivasan
2015-12-02 0:43 ` [PATCH net-next V3 16/17] hv_netvsc: Eliminate status " K. Y. Srinivasan
2015-12-02 0:43 ` K. Y. Srinivasan [this message]
2015-12-02 2:54 ` [PATCH net-next V3 00/17] hv_netvsc: Eliminate the additional head room 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=1449016999-9796-17-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=apw@canonical.com \
--cc=davem@davemloft.net \
--cc=devel@linuxdriverproject.org \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
/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).