hyperv: Remove recv_pkt_list and lock

Removed recv_pkt_list and lock, and updated related code, so that
the locking overhead is reduced especially when multiple channels
are in use.

The recv_pkt_list isn't actually necessary because the packets are
processed sequentially in each channel. It has been replaced by a
local variable, and the related lock for this list is also removed.
The is_data_pkt field is not used in receive path, so its assignment
is cleaned up.

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>
This commit is contained in:
Haiyang Zhang
2014-04-21 14:54:43 -07:00
committed by David S. Miller
parent fd0d192be6
commit 4baab26129
4 changed files with 13 additions and 198 deletions

View File

@ -119,27 +119,14 @@ struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
};
/* Fwd declaration */
struct hv_netvsc_packet;
struct ndis_tcp_ip_checksum_info;
/* Represent the xfer page packet which contains 1 or more netvsc packet */
struct xferpage_packet {
struct list_head list_ent;
u32 status;
/* # of netvsc packets this xfer packet contains */
u32 count;
struct vmbus_channel *channel;
};
/*
* Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
* within the RNDIS
*/
struct hv_netvsc_packet {
/* Bookkeeping stuff */
struct list_head list_ent;
u32 status;
struct hv_device *device;
@ -149,18 +136,7 @@ struct hv_netvsc_packet {
u16 q_idx;
struct vmbus_channel *channel;
/*
* Valid only for receives when we break a xfer page packet
* into multiple netvsc packets
*/
struct xferpage_packet *xfer_page_pkt;
union {
struct {
u64 recv_completion_tid;
void *recv_completion_ctx;
void (*recv_completion)(void *context);
} recv;
struct {
u64 send_completion_tid;
void *send_completion_ctx;
@ -613,9 +589,6 @@ struct nvsp_message {
#define NETVSC_RECEIVE_BUFFER_ID 0xcafe
/* Preallocated receive packets */
#define NETVSC_RECEIVE_PACKETLIST_COUNT 256
#define NETVSC_PACKET_SIZE 2048
#define VRSS_SEND_TAB_SIZE 16
@ -630,12 +603,6 @@ struct netvsc_device {
wait_queue_head_t wait_drain;
bool start_remove;
bool destroy;
/*
* List of free preallocated hv_netvsc_packet to represent receive
* packet
*/
struct list_head recv_pkt_list;
spinlock_t recv_pkt_list_lock;
/* Receive buffer allocated by us but manages by NetVSP */
void *recv_buf;