summaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc_drv.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * net/hyperv: Adding cancellation to ensure rndis filter is closedWenqi Ma2012-04-211-24/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the network interface is down, the RX packets number which could be observed by ifconfig may keep on increasing. This is because the WORK scheduled in netvsc_set_multicast_list() may be executed after netvsc_close(). That means the rndis filter may be re-enabled by do_set_multicast() even if it was closed by netvsc_close(). By canceling possible WORK before close the rndis filter, the issue could be never happened. Signed-off-by: Wenqi Ma <wenqi_ma@trendmicro.com.cn> Reviewed-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net/hyperv: Add flow control based on hi/low watermarkHaiyang Zhang2012-04-031-1/+5
|/ | | | | | | | | | | | | | In the existing code, we only stop queue when the ringbuffer is full, so the current packet has to be dropped or retried from upper layer. This patch stops the tx queue when available ringbuffer is below the low watermark. So the ringbuffer still has small amount of space available for the current packet. This will reduce the overhead of retries on sending. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: Fix the code handling tx busyHaiyang Zhang2012-03-191-4/+1
| | | | | | | | | | | | | | | | | Instead of dropping the packet, we keep the skb buffer, and return NETDEV_TX_BUSY to let upper layer retry send. This will not cause endless loop, because the host is taking data away from ring buffer, and we have called the stop_queue before returning NETDEV_TX_BUSY. The stop_queue was called in the function netvsc_send() in file netvsc.c, then it returns to rndis_filter_send(), which returns to netvsc_start_xmit() in file netvsc_drv.c. So the NETDEV_TX_BUSY is indeed returned AFTER queue is stopped. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-03-181-2/+2
|\
| * net/hyperv: fix erroneous NETDEV_TX_BUSY useEric Dumazet2012-03-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A driver start_xmit() method cannot free skb and return NETDEV_TX_BUSY, since caller is going to reuse freed skb. This is mostly a revert of commit bf769375c (staging: hv: fix the return status of netvsc_start_xmit()) In fact netif_tx_stop_queue() / netif_stop_queue() is needed before returning NETDEV_TX_BUSY or you can trigger a ksoftirqd fatal loop. In case of memory allocation error, only safe way is to drop the packet and return NETDEV_TX_OK Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net/hyperv: Add support for vlan trunking from guestsHaiyang Zhang2012-03-121-2/+6
| | | | | | | | | | | | | | | | | | With this feature, a Linux guest can now configure multiple vlans through a single synthetic NIC on Win8 Hyper-V host. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-03-091-2/+2
|\ \ | |/
| * net/hyperv: Use the built-in macro KBUILD_MODNAME for this driverHaiyang Zhang2012-03-081-2/+2
| | | | | | | | | | | | | | Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: Olaf Hering <olaf@aepfle.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net/hyperv: Correct the assignment in netvsc_recv_callback()Haiyang Zhang2012-02-051-5/+2
|/ | | | | | | | | The first assignment to variable "net" is wrong, but overridden by the latter assignments. So the bug isn't manifested. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: Fix the page buffer when an RNDIS message goes beyond page boundaryHaiyang Zhang2012-02-021-4/+4
| | | | | | | | | There is a possible data corruption if an RNDIS message goes beyond page boundary in the sending code path. This patch fixes the problem. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: Use netif_tx_disable() instead of netif_stop_queue() when necessaryHaiyang Zhang2012-02-021-4/+4
| | | | | | | | | For code path not on the xmit, use netif_tx_disable() instead of netif_stop_queue() to ensure other CPUs are not doing xmit. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: rx_bytes should account the ether header sizeWei Yongjun2012-02-011-1/+1
| | | | | | | | skb->len after call eth_type_trans() does not include the ether header size, but rx_bytes should account it. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: fix possible memory leak in do_set_multicast()Wei Yongjun2012-01-241-2/+3
| | | | | | | | | | do_set_multicast() may not free the memory malloc in netvsc_set_multicast_list(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: Add support for jumbo frame up to 64KBHaiyang Zhang2012-01-041-9/+61
| | | | | | | | | Allow the user set the MTU up to 65536 for Linux guests running on Hyper-V 2008 R2 or later. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* net/hyperv: Remove unnecessary kmap_atomic in netvsc driverHaiyang Zhang2012-01-041-20/+2
| | | | | | | | | | __get_free_pages() doesn't return HI memory, so the memory is always mapped. kmap_atomic() is not necessary here. This patch removes the kmap_atomic() calls and related code for locking and page manipulation. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* net/hyperv: Fix the stop/wake queue mechanismHaiyang Zhang2011-12-091-23/+1
| | | | | | | | | | | | | | | | | | The ring buffer is only used to pass meta data for outbound packets. The actual payload is accessed by DMA from the host. So the stop/wake queue mechanism based on counting and comparing number of pages sent v.s. number of pages in the ring buffer is wrong. Also, there is a race condition in the stop/wake queue calls, which can stop xmit queue forever. The new stop/wake queue mechanism is based on the actual bytes used by outbound packets in the ring buffer. The check for number of outstanding sends after stop queue prevents the race condition that can cause wake queue happening earlier than stop queue. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reported-by: Long Li <longli@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* net/hyperv: Add support for promiscuous mode settingHaiyang Zhang2011-12-011-3/+43
| | | | | | | | | Add code to accept promiscuous mode setting, and pass it to RNDIS filter. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: hv: move hv_netvsc out of staging areaHaiyang Zhang2011-11-291-0/+456
hv_netvsc has been reviewed on netdev mailing list on 6/09/2011. All recommended changes have been made. We are requesting to move it out of staging area. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: KY Srinivasan <kys@microsoft.com> Signed-off-by: Mike Sterling <Mike.Sterling@microsoft.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud