Commit c4b20c63 authored by KY Srinivasan's avatar KY Srinivasan Committed by David S. Miller

hv_netvsc: Eliminatte the data field from struct hv_netvsc_packet

Eliminatte the data field from struct hv_netvsc_packet.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24476760
...@@ -148,9 +148,6 @@ struct hv_netvsc_packet { ...@@ -148,9 +148,6 @@ struct hv_netvsc_packet {
u64 send_completion_tid; u64 send_completion_tid;
void *send_completion_ctx; void *send_completion_ctx;
void (*send_completion)(void *context); void (*send_completion)(void *context);
/* Points to the send/receive buffer where the ethernet frame is */
void *data;
struct hv_page_buffer *page_buf; struct hv_page_buffer *page_buf;
}; };
...@@ -195,6 +192,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, ...@@ -195,6 +192,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
void netvsc_xmit_completion(void *context); void netvsc_xmit_completion(void *context);
int netvsc_recv_callback(struct hv_device *device_obj, int netvsc_recv_callback(struct hv_device *device_obj,
struct hv_netvsc_packet *packet, struct hv_netvsc_packet *packet,
void **data,
struct ndis_tcp_ip_checksum_info *csum_info, struct ndis_tcp_ip_checksum_info *csum_info,
struct vmbus_channel *channel); struct vmbus_channel *channel);
void netvsc_channel_cb(void *context); void netvsc_channel_cb(void *context);
...@@ -205,6 +203,7 @@ int rndis_filter_device_add(struct hv_device *dev, ...@@ -205,6 +203,7 @@ int rndis_filter_device_add(struct hv_device *dev,
void rndis_filter_device_remove(struct hv_device *dev); void rndis_filter_device_remove(struct hv_device *dev);
int rndis_filter_receive(struct hv_device *dev, int rndis_filter_receive(struct hv_device *dev,
struct hv_netvsc_packet *pkt, struct hv_netvsc_packet *pkt,
void **data,
struct vmbus_channel *channel); struct vmbus_channel *channel);
int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter); int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter);
......
...@@ -1008,6 +1008,7 @@ static void netvsc_receive(struct netvsc_device *net_device, ...@@ -1008,6 +1008,7 @@ static void netvsc_receive(struct netvsc_device *net_device,
int i; int i;
int count = 0; int count = 0;
struct net_device *ndev; struct net_device *ndev;
void *data;
ndev = net_device->ndev; ndev = net_device->ndev;
...@@ -1047,13 +1048,13 @@ static void netvsc_receive(struct netvsc_device *net_device, ...@@ -1047,13 +1048,13 @@ static void netvsc_receive(struct netvsc_device *net_device,
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
/* Initialize the netvsc packet */ /* Initialize the netvsc packet */
netvsc_packet->status = NVSP_STAT_SUCCESS; netvsc_packet->status = NVSP_STAT_SUCCESS;
netvsc_packet->data = (void *)((unsigned long)net_device-> data = (void *)((unsigned long)net_device->
recv_buf + vmxferpage_packet->ranges[i].byte_offset); recv_buf + vmxferpage_packet->ranges[i].byte_offset);
netvsc_packet->total_data_buflen = netvsc_packet->total_data_buflen =
vmxferpage_packet->ranges[i].byte_count; vmxferpage_packet->ranges[i].byte_count;
/* Pass it to the upper layer */ /* Pass it to the upper layer */
rndis_filter_receive(device, netvsc_packet, channel); rndis_filter_receive(device, netvsc_packet, &data, channel);
if (netvsc_packet->status != NVSP_STAT_SUCCESS) if (netvsc_packet->status != NVSP_STAT_SUCCESS)
status = NVSP_STAT_FAIL; status = NVSP_STAT_FAIL;
......
...@@ -682,6 +682,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, ...@@ -682,6 +682,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
*/ */
int netvsc_recv_callback(struct hv_device *device_obj, int netvsc_recv_callback(struct hv_device *device_obj,
struct hv_netvsc_packet *packet, struct hv_netvsc_packet *packet,
void **data,
struct ndis_tcp_ip_checksum_info *csum_info, struct ndis_tcp_ip_checksum_info *csum_info,
struct vmbus_channel *channel) struct vmbus_channel *channel)
{ {
...@@ -710,7 +711,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, ...@@ -710,7 +711,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
* Copy to skb. This copy is needed here since the memory pointed by * Copy to skb. This copy is needed here since the memory pointed by
* hv_netvsc_packet cannot be deallocated * hv_netvsc_packet cannot be deallocated
*/ */
memcpy(skb_put(skb, packet->total_data_buflen), packet->data, memcpy(skb_put(skb, packet->total_data_buflen), *data,
packet->total_data_buflen); packet->total_data_buflen);
skb->protocol = eth_type_trans(skb, net); skb->protocol = eth_type_trans(skb, net);
......
...@@ -351,6 +351,7 @@ static inline void *rndis_get_ppi(struct rndis_packet *rpkt, u32 type) ...@@ -351,6 +351,7 @@ static inline void *rndis_get_ppi(struct rndis_packet *rpkt, u32 type)
static void rndis_filter_receive_data(struct rndis_device *dev, static void rndis_filter_receive_data(struct rndis_device *dev,
struct rndis_message *msg, struct rndis_message *msg,
struct hv_netvsc_packet *pkt, struct hv_netvsc_packet *pkt,
void **data,
struct vmbus_channel *channel) struct vmbus_channel *channel)
{ {
struct rndis_packet *rndis_pkt; struct rndis_packet *rndis_pkt;
...@@ -383,7 +384,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev, ...@@ -383,7 +384,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
* the data packet to the stack, without the rndis trailer padding * the data packet to the stack, without the rndis trailer padding
*/ */
pkt->total_data_buflen = rndis_pkt->data_len; pkt->total_data_buflen = rndis_pkt->data_len;
pkt->data = (void *)((unsigned long)pkt->data + data_offset); *data = (void *)((unsigned long)(*data) + data_offset);
vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO); vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO);
if (vlan) { if (vlan) {
...@@ -394,11 +395,12 @@ static void rndis_filter_receive_data(struct rndis_device *dev, ...@@ -394,11 +395,12 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
} }
csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO); csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO);
netvsc_recv_callback(dev->net_dev->dev, pkt, csum_info, channel); netvsc_recv_callback(dev->net_dev->dev, pkt, data, csum_info, channel);
} }
int rndis_filter_receive(struct hv_device *dev, int rndis_filter_receive(struct hv_device *dev,
struct hv_netvsc_packet *pkt, struct hv_netvsc_packet *pkt,
void **data,
struct vmbus_channel *channel) struct vmbus_channel *channel)
{ {
struct netvsc_device *net_dev = hv_get_drvdata(dev); struct netvsc_device *net_dev = hv_get_drvdata(dev);
...@@ -430,7 +432,7 @@ int rndis_filter_receive(struct hv_device *dev, ...@@ -430,7 +432,7 @@ int rndis_filter_receive(struct hv_device *dev,
goto exit; goto exit;
} }
rndis_msg = pkt->data; rndis_msg = *data;
if (netif_msg_rx_err(net_dev->nd_ctx)) if (netif_msg_rx_err(net_dev->nd_ctx))
dump_rndis_message(dev, rndis_msg); dump_rndis_message(dev, rndis_msg);
...@@ -438,7 +440,8 @@ int rndis_filter_receive(struct hv_device *dev, ...@@ -438,7 +440,8 @@ int rndis_filter_receive(struct hv_device *dev,
switch (rndis_msg->ndis_msg_type) { switch (rndis_msg->ndis_msg_type) {
case RNDIS_MSG_PACKET: case RNDIS_MSG_PACKET:
/* data msg */ /* data msg */
rndis_filter_receive_data(rndis_dev, rndis_msg, pkt, channel); rndis_filter_receive_data(rndis_dev, rndis_msg, pkt,
data, channel);
break; break;
case RNDIS_MSG_INIT_C: case RNDIS_MSG_INIT_C:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment