aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 14:38:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 14:38:22 -0500
commite30aee9e10bb5168579e047f05c3d13d09e23356 (patch)
tree12371bdcd52d2427cad838201997479e31b6a9c9 /drivers/net/hyperv/netvsc.c
parent8ff546b801e5cca0337c0f0a7234795d0a6309a1 (diff)
parent6cf18e6927c0b224f972e3042fb85770d63cb9f8 (diff)
Merge tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver patchset for 4.11-rc1. Lots of different driver subsystems updated here: rework for the hyperv subsystem to handle new platforms better, mei and w1 and extcon driver updates, as well as a number of other "minor" driver updates. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (169 commits) goldfish: Sanitize the broken interrupt handler x86/platform/goldfish: Prevent unconditional loading vmbus: replace modulus operation with subtraction vmbus: constify parameters where possible vmbus: expose hv_begin/end_read vmbus: remove conditional locking of vmbus_write vmbus: add direct isr callback mode vmbus: change to per channel tasklet vmbus: put related per-cpu variable together vmbus: callback is in softirq not workqueue binder: Add support for file-descriptor arrays binder: Add support for scatter-gather binder: Add extra size to allocator binder: Refactor binder_transact() binder: Support multiple /dev instances binder: Deal with contexts in debugfs binder: Support multiple context managers binder: Split flat_binder_object auxdisplay: ht16k33: remove private workqueue auxdisplay: ht16k33: rework input device initialization ...
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) {