Skip to content

Commit

Permalink
MFC [Hyper-V]: r293719-r293722, r293869-r293871, r293873-r293875, r29…
Browse files Browse the repository at this point in the history
…3877

r293719 hyperv/hn: Implement LRO
r293720 hyperv/hn: Implement SIOC[SG]IFMEDIA support
r293721 hyperv/hn: Avoid mbuf cluster allocation, if the packet is small.
r293722 hyperv/hn: Removed unused netvsc_init()
r293869 hyperv/hn: Unbreak LINT-NOIP
r293870 hyperv: use x86 generic code to do the hypervisor detection
r293871 hyperv: remove unused vmbus definitions
r293873 hyperv: implement an event timer
r293874 hyperv: add interrupt counters
r293875 hyperv: set receive buffer size according to NVSP protocol version
r293877 Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870

Approved by:	re (glebius), adrian (mentor)
Sponsored by:	Microsoft OSTC
  • Loading branch information
sephe authored and sephe committed Feb 19, 2016
1 parent bdaba17 commit 427bb5d
Show file tree
Hide file tree
Showing 16 changed files with 603 additions and 189 deletions.
1 change: 1 addition & 0 deletions sys/conf/files.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ dev/hyperv/vmbus/hv_channel.c optional hyperv
dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv
dev/hyperv/vmbus/hv_connection.c optional hyperv
dev/hyperv/vmbus/hv_hv.c optional hyperv
dev/hyperv/vmbus/hv_et.c optional hyperv
dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv
dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv
dev/kbd/kbd.c optional atkbd | sc | ukbd | vt
Expand Down
1 change: 1 addition & 0 deletions sys/conf/files.i386
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ dev/hyperv/vmbus/hv_channel.c optional hyperv
dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv
dev/hyperv/vmbus/hv_connection.c optional hyperv
dev/hyperv/vmbus/hv_hv.c optional hyperv
dev/hyperv/vmbus/hv_et.c optional hyperv
dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv
dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv
dev/ichwd/ichwd.c optional ichwd
Expand Down
5 changes: 0 additions & 5 deletions sys/dev/hyperv/include/hyperv.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,6 @@ typedef enum {
HV_CHANNEL_MESSAGE_INITIATED_CONTACT = 14,
HV_CHANNEL_MESSAGE_VERSION_RESPONSE = 15,
HV_CHANNEL_MESSAGE_UNLOAD = 16,

#ifdef HV_VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
HV_CHANNEL_MESSAGE_VIEW_RANGE_ADD = 17,
HV_CHANNEL_MESSAGE_VIEW_RANGE_REMOVE = 18,
#endif
HV_CHANNEL_MESSAGE_COUNT
} hv_vmbus_channel_msg_type;

Expand Down
10 changes: 7 additions & 3 deletions sys/dev/hyperv/netvsc/hv_net_vsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,12 @@ hv_nv_connect_to_vsp(struct hv_device *device)
/* sema_wait(&NetVscChannel->channel_init_sema); */

/* Post the big receive buffer to NetVSP */
if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_2)
net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY;
else
net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;
net_dev->send_buf_size = NETVSC_SEND_BUFFER_SIZE;

ret = hv_nv_init_rx_buffer_with_net_vsp(device);
if (ret == 0)
ret = hv_nv_init_send_buffer_with_net_vsp(device);
Expand Down Expand Up @@ -675,9 +681,6 @@ hv_nv_on_device_add(struct hv_device *device, void *additional_info)
goto cleanup;

/* Initialize the NetVSC channel extension */
net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;

net_dev->send_buf_size = NETVSC_SEND_BUFFER_SIZE;

sema_init(&net_dev->channel_init_sema, 0, "netdev_sema");

Expand Down Expand Up @@ -918,6 +921,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, struct hv_device *device,
*/
hv_nv_on_receive_completion(device, vm_xfer_page_pkt->d.transaction_id,
status);
hv_rf_receive_rollup(net_dev);
}

/*
Expand Down
21 changes: 20 additions & 1 deletion sys/dev/hyperv/netvsc/hv_net_vsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
#include <sys/malloc.h>
#include <sys/sx.h>

#include <netinet/in.h>
#include <netinet/tcp_lro.h>

#include <net/if.h>
#include <net/if_media.h>

#include <dev/hyperv/include/hyperv.h>

MALLOC_DECLARE(M_NETVSC);
Expand Down Expand Up @@ -851,7 +857,7 @@ typedef struct nvsp_msg_ {
#define NETVSC_SEND_BUFFER_SIZE (1024*1024*15) /* 15M */
#define NETVSC_SEND_BUFFER_ID 0xface


#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY (1024*1024*15) /* 15MB */
#define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16) /* 16MB */

#define NETVSC_RECEIVE_BUFFER_ID 0xcafe
Expand Down Expand Up @@ -984,6 +990,7 @@ typedef struct {
typedef struct hn_softc {
struct ifnet *hn_ifp;
struct arpcom arpcom;
struct ifmedia hn_media;
device_t hn_dev;
uint8_t hn_unit;
int hn_carrier;
Expand All @@ -994,6 +1001,18 @@ typedef struct hn_softc {
int temp_unusable;
struct hv_device *hn_dev_obj;
netvsc_dev *net_dev;

struct lro_ctrl hn_lro;
int hn_lro_hiwat;

/* Trust tcp segments verification on host side */
int hn_trust_hosttcp;

u_long hn_csum_ip;
u_long hn_csum_tcp;
u_long hn_csum_trusted;
u_long hn_lro_tried;
u_long hn_small_pkts;
} hn_softc_t;


Expand Down
Loading

0 comments on commit 427bb5d

Please sign in to comment.