summaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/rndis_filter.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2014-03-141-1/+20
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/usb/r8152.c drivers/net/xen-netback/netback.c Both the r8152 and netback conflicts were simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
| * hyperv: Move state setting for link queryHaiyang Zhang2014-03-051-1/+20
| | | | | | | | | | | | | | | | | | It moves the state setting for query into rndis_filter_receive_response(). All callbacks including query-complete and status-callback are synchronized by channel->inbound_lock. This prevents pentential race between them. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Drivers: net: hyperv: Enable receive side IP checksum offloadKY Srinivasan2014-03-101-1/+3
| | | | | | | | | | | | | | | | Enable receive side checksum offload. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Drivers: net: hyperv: Enable offloads on the hostKY Srinivasan2014-03-101-0/+80
| | | | | | | | | | | | | | | | Prior to enabling guest side offloads, enable the offloads on the host. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Drivers: net: hyperv: Cleanup the send pathKY Srinivasan2014-03-101-66/+0
| | | | | | | | | | | | | | | | In preparation for enabling offloads, cleanup the send path. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Drivers: net: hyperv: Get rid of the rndis_filter_packet structureKY Srinivasan2014-02-171-38/+3
|/ | | | | | | | | This structure is redundant; get rid of it make the code little more efficient - get rid of the unnecessary indirection. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/*: Fix FSF address in file headersJeff Kirsher2013-12-061-2/+1
| | | | | | | | | | | | | | | | | | | | | Several files refer to an old address for the Free Software Foundation in the file header comment. Resolve by replacing the address with the URL <http://www.gnu.org/licenses/> so that we do not have to keep updating the header comments anytime the address changes. CC: Jay Vosburgh <fubar@us.ibm.com> CC: Veaceslav Falico <vfalico@redhat.com> CC: Andy Gospodarek <andy@greyhouse.net> CC: Haiyang Zhang <haiyangz@microsoft.com> CC: "K. Y. Srinivasan" <kys@microsoft.com> CC: Paul Mackerras <paulus@samba.org> CC: Ian Campbell <ian.campbell@citrix.com> CC: Wei Liu <wei.liu2@citrix.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hyperv: Fix RNDIS send_completion code pathHaiyang Zhang2013-04-081-13/+1
| | | | | | | | | | | | | | | In some cases, the VM_PKT_COMP message can arrive later than RNDIS completion message, which will free the packet memory. This may cause panic due to access to freed memory in netvsc_send_completion(). This patch fixes this problem by removing rndis_filter_send_request_completion() from the code path. The function was a no-op. Reported-by: Long Li <longli@microsoft.com> Tested-by: Long Li <longli@microsoft.com> 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>
* hyperv: Add an error message to rndis_filter_set_device_mac()Haiyang Zhang2012-11-301-1/+4
| | | | | | | | | This message indicates an error returned from the host when changing MAC address. Reported-by: Michal Kubecek <mkubecek@suse.com> 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>
* hyperv: Remove unnecessary comments in rndis_filter_receive_data()Haiyang Zhang2012-10-211-5/+0
| | | | | | | | | Checked with Windows networking team, there is only one RNDIS message in each netvsc packet. 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>
* hyperv: Add buffer for extended info after the RNDIS response message.Haiyang Zhang2012-10-021-10/+12
| | | | | | | | | In some response messages, there may be some extended info after the message. 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>
* hyperv: Report actual status in receive completion packetHaiyang Zhang2012-10-021-5/+14
| | | | | | | | | The existing code always reports NVSP_STAT_SUCCESS. This patch adds the mechanism to report failure when it happens. 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>
* hyperv: Fix page buffer handling in rndis_filter_send_request()Haiyang Zhang2012-10-021-1/+14
| | | | | | | | | To prevent possible data corruption in RNDIS requests, add another page buffer if the request message crossed page boundary. 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>
* hyperv: Fix the missing return value in rndis_filter_set_packet_filter()Haiyang Zhang2012-10-021-0/+1
| | | | | | | | Return ETIMEDOUT when the reply message is not received in time. 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>
* hyperv: Fix the max_xfer_size in RNDIS initializationHaiyang Zhang2012-10-021-2/+1
| | | | | | | | | According to RNDIS specs, Windows sets this size to 0x4000. I use the same value here. 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>
* hyperv: Add comments for the extended buffer after RNDIS messageHaiyang Zhang2012-08-091-1/+7
| | | | | | Reported-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hyperv: Move wait completion msg code into rndis_filter_halt_device()Haiyang Zhang2012-08-031-0/+11
| | | | | | | | | | | We need to wait for send_completion msg before put_rndis_request() at the end of rndis_filter_halt_device(). Otherwise, netvsc_send_completion() may reference freed memory which is overwritten, and cause panic. Reported-by: Long Li <longli@microsoft.com> Reported-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hyperv: Add error handling to rndis_filter_device_add()Haiyang Zhang2012-07-251-7/+4
| | | | | | | Reported-by: Jason Wang <jasowang@redhat.com> 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>
* hyperv: Add support for setting MAC from within guestsHaiyang Zhang2012-07-161-0/+79
| | | | | | | | | | | | | | | | | This adds support for setting synthetic NIC MAC address from within Linux guests. Before using this feature, the option "spoofing of MAC address" should be enabled at the Hyper-V manager / Settings of the synthetic NIC. Thanks to Kin Cho <kcho@infoblox.com> for the initial implementation and tests. And, thanks to Long Li <longli@microsoft.com> for the debugging works. Reported-and-tested-by: Kin Cho <kcho@infoblox.com> Reported-by: Long Li <longli@microsoft.com> 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>
* usb/net: rndis: merge command codesLinus Walleij2012-05-121-21/+21
| | | | | | | | | Switch the hyperv filter and rndis gadget driver to use the same command enumerators as the other drivers and delete the surplus command codes. Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* usb/net: rndis: remove ambigous status codesLinus Walleij2012-05-121-2/+2
| | | | | | | | | | | | | The RNDIS status codes are redefined with much stranged ifdeffery and only one of these codes was used in the hyperv driver, and there it is very clearly referring to the RNDIS variant, not some other status. So clarify this by explictly using the RNDIS_* prefixed status code in the hyperv drivera and delete the duplicate defines. Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: Add support for vlan trunking from guestsHaiyang Zhang2012-03-121-0/+60
| | | | | | | | | 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>
* net/hyperv: Fix data corruption in rndis_filter_receive()Haiyang Zhang2012-03-121-24/+9
| | | | | | | | | | | | | | Limiting the memcpy to be the sizeof(struct rndis_message) can truncate the message if there are Per-Packet-Info or Out-of-Band data. In my earlier patch (commit 45326342), the unnecessary kmap_atomic and kunmap_atomic surrounding this memcpy have been removed because the memory in the receive buffer is always mapped. This memcpy is not necessary either. To fix the bug, I removed the memcpy. 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: Remove the unnecessary memset in rndis_filter_send()Haiyang Zhang2012-02-051-2/+0
| | | | | | | | | The memory has been allocated by kzalloc, so it's unnecessary to memset again. 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: Convert camel cased variables in rndis_filter.c to lower casesHaiyang Zhang2012-02-051-30/+30
| | | | | | | Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Jesper Juhl <jj@chaosbits.net> 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-0/+13
| | | | | | | | | 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: fix the issue that large packets be dropped under bridgeWei Yongjun2012-02-021-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | The packets with size larger than 1452 will be dropped by bridge which with two hyperv netdevice ports. This cause by hyperv netvsc driver always copy the trailer padding to the data packet, and then the skb received from netdevice may include wrong skb->len (20 bytes larger than the real size normally). The captured packet may like this: Ethernet II, Src: Microsof_00:00:07 (00:15:5d:00:00:07), Dst: HewlettP_00:00:4e (00:1f:29:00:00:4e) Destination: HewlettP_e6:00:4e (00:1f:29:00:00:4e) Source: Microsof_f6:6d:07 (00:15:5d:f6:6d:07) Type: IP (0x0800) Trailer: 1415161718191A1B1C1D1E1F20212223 Frame check sequence: 0x24252627 [incorrect, should be 0x7c2e5a5e] The following command help to reproduction it, and the ping ICMP packets will be dropped by bridge. $ ping ip -s 1453 This patch fixed it by removing the trailer padding from the data packet. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/hyperv: Remove unnecessary kmap_atomic in netvsc driverHaiyang Zhang2012-01-041-19/+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: Add support for promiscuous mode settingHaiyang Zhang2011-12-011-22/+1
| | | | | | | | | 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/+855
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