hv_netvsc: Eliminate status from struct hv_netvsc_packet
Eliminate status from struct hv_netvsc_packet. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bde79be529
commit
10082f9887
|
@ -130,7 +130,6 @@ struct ndis_tcp_ip_checksum_info;
|
||||||
*/
|
*/
|
||||||
struct hv_netvsc_packet {
|
struct hv_netvsc_packet {
|
||||||
/* Bookkeeping stuff */
|
/* Bookkeeping stuff */
|
||||||
u8 status;
|
|
||||||
u8 cp_partial; /* partial copy into send buffer */
|
u8 cp_partial; /* partial copy into send buffer */
|
||||||
|
|
||||||
u8 rmsg_size; /* RNDIS header and PPI size */
|
u8 rmsg_size; /* RNDIS header and PPI size */
|
||||||
|
|
|
@ -1045,17 +1045,15 @@ static void netvsc_receive(struct netvsc_device *net_device,
|
||||||
/* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */
|
/* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */
|
||||||
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;
|
|
||||||
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, &data, channel);
|
status = rndis_filter_receive(device, netvsc_packet, &data,
|
||||||
|
channel);
|
||||||
|
|
||||||
if (netvsc_packet->status != NVSP_STAT_SUCCESS)
|
|
||||||
status = NVSP_STAT_FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
netvsc_send_recv_completion(device, channel, net_device,
|
netvsc_send_recv_completion(device, channel, net_device,
|
||||||
|
|
|
@ -471,8 +471,6 @@ check_size:
|
||||||
FIELD_SIZEOF(struct sk_buff, cb));
|
FIELD_SIZEOF(struct sk_buff, cb));
|
||||||
packet = (struct hv_netvsc_packet *)skb->cb;
|
packet = (struct hv_netvsc_packet *)skb->cb;
|
||||||
|
|
||||||
packet->status = 0;
|
|
||||||
|
|
||||||
packet->vlan_tci = skb->vlan_tci;
|
packet->vlan_tci = skb->vlan_tci;
|
||||||
|
|
||||||
packet->q_idx = skb_get_queue_mapping(skb);
|
packet->q_idx = skb_get_queue_mapping(skb);
|
||||||
|
@ -684,8 +682,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
|
||||||
|
|
||||||
net = ((struct netvsc_device *)hv_get_drvdata(device_obj))->ndev;
|
net = ((struct netvsc_device *)hv_get_drvdata(device_obj))->ndev;
|
||||||
if (!net || net->reg_state != NETREG_REGISTERED) {
|
if (!net || net->reg_state != NETREG_REGISTERED) {
|
||||||
packet->status = NVSP_STAT_FAIL;
|
return NVSP_STAT_FAIL;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
net_device_ctx = netdev_priv(net);
|
net_device_ctx = netdev_priv(net);
|
||||||
rx_stats = this_cpu_ptr(net_device_ctx->rx_stats);
|
rx_stats = this_cpu_ptr(net_device_ctx->rx_stats);
|
||||||
|
@ -694,8 +691,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
|
||||||
skb = netdev_alloc_skb_ip_align(net, packet->total_data_buflen);
|
skb = netdev_alloc_skb_ip_align(net, packet->total_data_buflen);
|
||||||
if (unlikely(!skb)) {
|
if (unlikely(!skb)) {
|
||||||
++net->stats.rx_dropped;
|
++net->stats.rx_dropped;
|
||||||
packet->status = NVSP_STAT_FAIL;
|
return NVSP_STAT_FAIL;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -344,7 +344,7 @@ static inline void *rndis_get_ppi(struct rndis_packet *rpkt, u32 type)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rndis_filter_receive_data(struct rndis_device *dev,
|
static int 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,
|
void **data,
|
||||||
|
@ -371,7 +371,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
|
||||||
"overflow detected (got %u, min %u)"
|
"overflow detected (got %u, min %u)"
|
||||||
"...dropping this message!\n",
|
"...dropping this message!\n",
|
||||||
pkt->total_data_buflen, rndis_pkt->data_len);
|
pkt->total_data_buflen, rndis_pkt->data_len);
|
||||||
return;
|
return NVSP_STAT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -391,7 +391,8 @@ 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, data, csum_info, channel);
|
return 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,
|
||||||
|
@ -406,7 +407,7 @@ int rndis_filter_receive(struct hv_device *dev,
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!net_dev) {
|
if (!net_dev) {
|
||||||
ret = -EINVAL;
|
ret = NVSP_STAT_FAIL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,7 +417,7 @@ int rndis_filter_receive(struct hv_device *dev,
|
||||||
if (!net_dev->extension) {
|
if (!net_dev->extension) {
|
||||||
netdev_err(ndev, "got rndis message but no rndis device - "
|
netdev_err(ndev, "got rndis message but no rndis device - "
|
||||||
"dropping this message!\n");
|
"dropping this message!\n");
|
||||||
ret = -ENODEV;
|
ret = NVSP_STAT_FAIL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,7 +425,7 @@ int rndis_filter_receive(struct hv_device *dev,
|
||||||
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
|
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
|
||||||
netdev_err(ndev, "got rndis message but rndis device "
|
netdev_err(ndev, "got rndis message but rndis device "
|
||||||
"uninitialized...dropping this message!\n");
|
"uninitialized...dropping this message!\n");
|
||||||
ret = -ENODEV;
|
ret = NVSP_STAT_FAIL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,7 +437,7 @@ 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,
|
ret = rndis_filter_receive_data(rndis_dev, rndis_msg, pkt,
|
||||||
data, channel);
|
data, channel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -460,9 +461,6 @@ int rndis_filter_receive(struct hv_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (ret != 0)
|
|
||||||
pkt->status = NVSP_STAT_FAIL;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue