aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r--drivers/net/hyperv/netvsc.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index fd6ebbefd919..d35ebd993b38 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -703,8 +703,6 @@ static u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device,
703 char *dest = start + (section_index * net_device->send_section_size) 703 char *dest = start + (section_index * net_device->send_section_size)
704 + pend_size; 704 + pend_size;
705 int i; 705 int i;
706 bool is_data_pkt = (skb != NULL) ? true : false;
707 bool xmit_more = (skb != NULL) ? skb->xmit_more : false;
708 u32 msg_size = 0; 706 u32 msg_size = 0;
709 u32 padding = 0; 707 u32 padding = 0;
710 u32 remain = packet->total_data_buflen % net_device->pkt_align; 708 u32 remain = packet->total_data_buflen % net_device->pkt_align;
@@ -712,7 +710,7 @@ static u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device,
712 packet->page_buf_cnt; 710 packet->page_buf_cnt;
713 711
714 /* Add padding */ 712 /* Add padding */
715 if (is_data_pkt && xmit_more && remain && 713 if (skb && skb->xmit_more && remain &&
716 !packet->cp_partial) { 714 !packet->cp_partial) {
717 padding = net_device->pkt_align - remain; 715 padding = net_device->pkt_align - remain;
718 rndis_msg->msg_len += padding; 716 rndis_msg->msg_len += padding;
@@ -754,7 +752,6 @@ static inline int netvsc_send_pkt(
754 int ret; 752 int ret;
755 struct hv_page_buffer *pgbuf; 753 struct hv_page_buffer *pgbuf;
756 u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound); 754 u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound);
757 bool xmit_more = (skb != NULL) ? skb->xmit_more : false;
758 755
759 nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT; 756 nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
760 if (skb != NULL) { 757 if (skb != NULL) {
@@ -778,16 +775,6 @@ static inline int netvsc_send_pkt(
778 if (out_channel->rescind) 775 if (out_channel->rescind)
779 return -ENODEV; 776 return -ENODEV;
780 777
781 /*
782 * It is possible that once we successfully place this packet
783 * on the ringbuffer, we may stop the queue. In that case, we want
784 * to notify the host independent of the xmit_more flag. We don't
785 * need to be precise here; in the worst case we may signal the host
786 * unnecessarily.
787 */
788 if (ring_avail < (RING_AVAIL_PERCENT_LOWATER + 1))
789 xmit_more = false;
790
791 if (packet->page_buf_cnt) { 778 if (packet->page_buf_cnt) {
792 pgbuf = packet->cp_partial ? (*pb) + 779 pgbuf = packet->cp_partial ? (*pb) +
793 packet->rmsg_pgcnt : (*pb); 780 packet->rmsg_pgcnt : (*pb);
@@ -797,15 +784,13 @@ static inline int netvsc_send_pkt(
797 &nvmsg, 784 &nvmsg,
798 sizeof(struct nvsp_message), 785 sizeof(struct nvsp_message),
799 req_id, 786 req_id,
800 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED, 787 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
801 !xmit_more);
802 } else { 788 } else {
803 ret = vmbus_sendpacket_ctl(out_channel, &nvmsg, 789 ret = vmbus_sendpacket_ctl(out_channel, &nvmsg,
804 sizeof(struct nvsp_message), 790 sizeof(struct nvsp_message),
805 req_id, 791 req_id,
806 VM_PKT_DATA_INBAND, 792 VM_PKT_DATA_INBAND,
807 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED, 793 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
808 !xmit_more);
809 } 794 }
810 795
811 if (ret == 0) { 796 if (ret == 0) {