/* The packet is laid out thus:
- * 1. hdr: RNDIS header and PPI
+ * 1. hdr
* 2. skb linear data
* 3. skb fragment data
*/
@@ -333,9 +332,6 @@ static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb, offset_in_page(hdr), len, &pb[slots_used]);
@timg-tpi
I reverted it on latest ubuntu-vivid, but there is variable dependency with the other related commits, so I patched like below
it is better, but still dropping is there.
original 100 -> 0.3
below patch 100 -> 15~20
Thanks.
####### ####### ####### ####### ####### ####### ####### ####### ####### #####
diff --git a/drivers/ net/hyperv/ hyperv_ net.h b/drivers/ net/hyperv/ hyperv_ net.h net/hyperv/ hyperv_ net.h net/hyperv/ hyperv_ net.h
index bf2604b..ad73121 100644
--- a/drivers/
+++ b/drivers/
@@ -132,8 +132,6 @@ struct hv_netvsc_packet {
struct hv_device *device;
bool is_data_pkt;
bool xmit_more; /* from skb */
- bool cp_partial; /* partial copy into send buffer */
-
u16 vlan_tci;
u16 q_idx;
@@ -148,9 +146,6 @@ struct hv_netvsc_packet {
/* This points to the memory after page_buf */
struct rndis_message *rndis_msg;
- u32 rmsg_size; /* RNDIS header and PPI size */ net/hyperv/ netvsc. c b/drivers/ net/hyperv/ netvsc. c net/hyperv/ netvsc. c net/hyperv/ netvsc. c copy_to_ send_buf( struct netvsc_device *net_device, >total_ data_buflen % net_device- >pkt_align; >page_buf_ cnt;
- u32 rmsg_pgcnt; /* page count of RNDIS header and PPI */
-
u32 total_data_buflen;
/* Points to the send/receive buffer where the ethernet frame is */
void *data;
diff --git a/drivers/
index b15041b..20102cd 100644
--- a/drivers/
+++ b/drivers/
@@ -703,18 +703,15 @@ static u32 netvsc_
u32 msg_size = 0;
u32 padding = 0;
u32 remain = packet-
- u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt :
- packet-
/* Add padding */ >is_data_ pkt && packet->xmit_more && remain && >cp_partial) { >is_data_ pkt && packet->xmit_more && remain) {
padding = net_device- >pkt_align - remain;
packet- >rndis_ msg->msg_ len += padding;
packet- >total_ data_buflen += padding;
- if (packet-
- !packet-
+ if (packet-
}
- for (i = 0; i < page_count; i++) { >page_buf_ cnt; i++) {
char *src = phys_to_ virt(packet- >page_buf[ i].pfn << PAGE_SHIFT); >page_buf[ i].offset; >page_buf[ i].len; avail_percent( &out_channel- >outbound) ;
+ for (i = 0; i < packet-
u32 offset = packet-
u32 len = packet-
@@ -742,7 +739,6 @@ static inline int netvsc_send_pkt(
struct net_device *ndev = net_device->ndev;
u64 req_id;
int ret;
- struct hv_page_buffer *pgbuf;
u32 ring_avail = hv_ringbuf_
@@ -781,10 +777,8 @@ static inline int netvsc_send_pkt(
if (packet- >page_buf_ cnt) { t_pagebuffer_ ctl(out_ channel,
packet- >page_buf_ cnt,
&nvmsg,
sizeof( struct nvsp_message),
- pgbuf = packet->cp_partial ? packet->page_buf +
- packet->rmsg_pgcnt : packet->page_buf;
ret = vmbus_sendpacke
- pgbuf,
+ packet->page_buf,
@@ -841,7 +835,6 @@ int netvsc_send(struct hv_device *device,
unsigned long flag;
struct multi_send_data *msdp;
struct hv_netvsc_packet *msd_send = NULL, *cur_send = NULL;
- bool try_batch;
net_device = get_outbound_ net_device( device) ;
packet- >channel = out_channel;
packet- >send_buf_ index = NETVSC_ INVALID_ INDEX;
if (!net_device)
@@ -855,7 +848,6 @@ int netvsc_send(struct hv_device *device,
}
- packet->cp_partial = false;
msdp = &net_device- >msd[q_ idx];
msd_len = msdp->pkt- >total_ data_buflen;
@@ -864,18 +856,11 @@ int netvsc_send(struct hv_device *device,
if (msdp->pkt)
- try_batch = packet->is_data_pkt && msd_len > 0 && msdp->count < >max_pkt; >pkt_align < >is_data_ pkt && msd_len > 0 && >pkt_align <
net_ device- >send_section_ size) {
section_ index = msdp->pkt- >send_buf_ index; >send_section_ size) { >send_buf_ index; >is_data_ pkt && pktlen + net_device- >pkt_align <
net_ device- >send_section_ size) {
section_ index = netvsc_ get_next_ send_section( net_device) ;
packet) ;
- net_device-
-
- if (try_batch && msd_len + pktlen + net_device-
+ if (packet-
+ msdp->count < net_device->max_pkt &&
+ msd_len + pktlen + net_device-
-
- } else if (try_batch && msd_len + packet->rmsg_size <
- net_device-
- section_index = msdp->pkt-
- packet->cp_partial = true;
-
} else if (packet-
@@ -893,19 +878,13 @@ int netvsc_send(struct hv_device *device,
-
- if (packet-
- packet-
- packet-
- } else {
- packet-
- packet-
- }
+ packet-
+ packet-
if (msdp->pkt)
netvsc_ xmit_completion (msdp-> pkt);
- if (packet->xmit_more && !packet- >cp_partial) {
msdp- >pkt = packet;
msdp- >count+ +; net/hyperv/ netvsc_ drv.c b/drivers/ net/hyperv/ netvsc_ drv.c net/hyperv/ netvsc_ drv.c net/hyperv/ netvsc_ drv.c
+ if (packet->xmit_more) {
} else {
diff --git a/drivers/
index d06f1bc..1d1649c 100644
--- a/drivers/
+++ b/drivers/
@@ -315,16 +315,15 @@ static u32 fill_pg_buf(struct page *page, u32 offset, u32 len,
}
static u32 init_page_ array(void *hdr, u32 len, struct sk_buff *skb, skb)->nr_ frags;
- struct hv_netvsc_packet *packet)
+ struct hv_page_buffer *pb)
{
- struct hv_page_buffer *pb = packet->page_buf;
u32 slots_used = 0;
char *data = skb->data;
int frags = skb_shinfo(
int i;
/* The packet is laid out thus: array(void *hdr, u32 len, struct sk_buff *skb,
offset_ in_page( hdr),
len, &pb[slots_used]);
- * 1. hdr: RNDIS header and PPI
+ * 1. hdr
* 2. skb linear data
* 3. skb fragment data
*/
@@ -333,9 +332,6 @@ static u32 init_page_
- packet->rmsg_size = len; buf(virt_ to_page( data),
offset_ in_page( data),
skb_ headlen( skb), &pb[slots_used]);
rndis_ msg->msg_ len += rndis_msg_size;
packet- >total_ data_buflen = rndis_msg->msg_len;
packet- >page_buf_ cnt = init_page_ array(rndis_ msg, rndis_msg_size,
- packet->rmsg_pgcnt = slots_used;
-
slots_used += fill_pg_
@@ -609,7 +605,7 @@ do_send:
- skb, packet);
+ skb, &page_buf[0]);
ret = netvsc_ send(net_ device_ ctx->device_ ctx, packet);