hyperv: set receive buffer size according to NVSP protocol version
If the NVSP protocol version is not greater than NVSP_PROTOCOL_VERSION_2, then the recv buffer size is 15MB, otherwise the buffer size is 16MB. Submitted by: Hongjiang Zhang <honzhan microsoft com> Reviewed by: royger, Dexuan Cui <decui microsoft com>, adrian Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4814
This commit is contained in:
parent
1952924333
commit
dd7a7dd6af
@ -642,6 +642,12 @@ hv_nv_connect_to_vsp(struct hv_device *device)
|
|||||||
/* sema_wait(&NetVscChannel->channel_init_sema); */
|
/* sema_wait(&NetVscChannel->channel_init_sema); */
|
||||||
|
|
||||||
/* Post the big receive buffer to NetVSP */
|
/* 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);
|
ret = hv_nv_init_rx_buffer_with_net_vsp(device);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = hv_nv_init_send_buffer_with_net_vsp(device);
|
ret = hv_nv_init_send_buffer_with_net_vsp(device);
|
||||||
@ -676,9 +682,6 @@ hv_nv_on_device_add(struct hv_device *device, void *additional_info)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Initialize the NetVSC channel extension */
|
/* 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");
|
sema_init(&net_dev->channel_init_sema, 0, "netdev_sema");
|
||||||
|
|
||||||
|
@ -857,7 +857,7 @@ typedef struct nvsp_msg_ {
|
|||||||
#define NETVSC_SEND_BUFFER_SIZE (1024*1024*15) /* 15M */
|
#define NETVSC_SEND_BUFFER_SIZE (1024*1024*15) /* 15M */
|
||||||
#define NETVSC_SEND_BUFFER_ID 0xface
|
#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_SIZE (1024*1024*16) /* 16MB */
|
||||||
|
|
||||||
#define NETVSC_RECEIVE_BUFFER_ID 0xcafe
|
#define NETVSC_RECEIVE_BUFFER_ID 0xcafe
|
||||||
|
Loading…
Reference in New Issue
Block a user