diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2015-03-26 17:03:37 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-29 21:49:55 +0200 |
commit | 7c3877f275ee6b479fa828947811c76d431501ca (patch) | |
tree | c4eb557ff31ea579d0a52aa5e4623b8fabf4a688 /drivers/net/hyperv/hyperv_net.h | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next (diff) | |
download | linux-7c3877f275ee6b479fa828947811c76d431501ca.tar.xz linux-7c3877f275ee6b479fa828947811c76d431501ca.zip |
hv_netvsc: Implement batching in send buffer
With this patch, we can send out multiple RNDIS data packets in one send buffer
slot and one VMBus message. It reduces the overhead associated with VMBus messages.
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>
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 4815843a6019..384f057d6570 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -131,6 +131,7 @@ struct hv_netvsc_packet { struct hv_device *device; bool is_data_pkt; + bool xmit_more; /* from skb */ u16 vlan_tci; u16 q_idx; @@ -596,7 +597,16 @@ struct nvsp_message { #define VRSS_SEND_TAB_SIZE 16 -/* Per netvsc channel-specific */ +#define RNDIS_MAX_PKT_DEFAULT 8 +#define RNDIS_PKT_ALIGN_DEFAULT 8 + +struct multi_send_data { + spinlock_t lock; /* protect struct multi_send_data */ + struct hv_netvsc_packet *pkt; /* netvsc pkt pending */ + u32 count; /* counter of batched packets */ +}; + +/* Per netvsc device */ struct netvsc_device { struct hv_device *dev; @@ -647,6 +657,10 @@ struct netvsc_device { unsigned char *cb_buffer; /* The sub channel callback buffer */ unsigned char *sub_cb_buf; + + struct multi_send_data msd[NR_CPUS]; + u32 max_pkt; /* max number of pkt in one send, e.g. 8 */ + u32 pkt_align; /* alignment bytes, e.g. 8 */ }; /* NdisInitialize message */ |