# HG changeset patch # User Jose Renato Santos # Date 1234494892 28800 # Node ID e28f1bf386e71c5525c035d7e5de1c29f9696fe1 # Parent 9681e69b222b2446a03fd03ffb8fc94a39172312 Add a flag on packet message to allow sender to request event notification when the other end sends the corresponding finish packet message. diff -r 9681e69b222b -r e28f1bf386e7 drivers/xen/netchannel2/netchannel2_core.h --- a/drivers/xen/netchannel2/netchannel2_core.h Thu Feb 12 17:38:15 2009 +0000 +++ b/drivers/xen/netchannel2/netchannel2_core.h Thu Feb 12 19:14:52 2009 -0800 @@ -968,8 +968,8 @@ void prepare_xmit_post(struct netchannel void nc2_replenish_rx_buffers(struct netchannel2 *nc); -void queue_finish_packet_message(struct netchannel2_ring_pair *nc, - uint32_t id); +void queue_finish_packet_message(struct netchannel2_ring_pair *ncrp, + uint32_t id, uint8_t flags); void nc2_return_pending_posted_buffers(struct netchannel2 *nc); void nc2_posted_buffer_rx_forget(struct netchannel2 *nc); @@ -1064,8 +1064,6 @@ void drop_pending_tx_packets(struct netc void drop_pending_tx_packets(struct netchannel2_ring_pair *ncrp); void send_finish_packet_messages(struct netchannel2_ring_pair *ncrp); -void queue_finish_packet_message(struct netchannel2_ring_pair *ncrp, - uint32_t id); void nc2_handle_packet_msg(struct netchannel2 *nc, struct netchannel2_ring_pair *ncrp, struct netchannel2_msg_hdr *hdr); diff -r 9681e69b222b -r e28f1bf386e7 drivers/xen/netchannel2/receiver_map.c --- a/drivers/xen/netchannel2/receiver_map.c Thu Feb 12 17:38:15 2009 +0000 +++ b/drivers/xen/netchannel2/receiver_map.c Thu Feb 12 19:14:52 2009 -0800 @@ -53,6 +53,7 @@ struct rx_map_packet { with the packet by this time (in jiffies), or we try to copy it. */ struct netchannel2 *nc; + uint8_t flags; }; struct receive_mapper { @@ -251,7 +252,8 @@ static void gc_tasklet(unsigned long _rm } nr_released_packets++; list_splice_init(&packet->frags, &released_fragments); - queue_finish_packet_message(&locked_nc->rings, packet->id); + queue_finish_packet_message(&locked_nc->rings, packet->id, + packet->flags); } if (locked_nc) { @@ -674,6 +676,7 @@ struct sk_buff *handle_receiver_map_pack skb_reserve(head_skb, NET_IP_ALIGN); rmp->id = msg->id; + rmp->flags = msg->flags; rx_frag = list_entry(rmp->frags.next, struct rx_map_fragment, list); for (x = 0; x < nr_frags; x++) { diff -r 9681e69b222b -r e28f1bf386e7 drivers/xen/netchannel2/recv_packet.c --- a/drivers/xen/netchannel2/recv_packet.c Thu Feb 12 17:38:15 2009 +0000 +++ b/drivers/xen/netchannel2/recv_packet.c Thu Feb 12 19:14:52 2009 -0800 @@ -25,7 +25,6 @@ void send_finish_packet_messages(struct 0, &msg, sizeof(msg)); - ncrp->pending_time_sensitive_messages = 1; } } @@ -33,7 +32,7 @@ void send_finish_packet_messages(struct arrange that send_finish_packet_messages is sent soon to flush the requests out. */ void queue_finish_packet_message(struct netchannel2_ring_pair *ncrp, - uint32_t id) + uint32_t id, uint8_t flags) { struct pending_finish_packets *pfp = &ncrp->pending_finish; RING_IDX prod; @@ -41,6 +40,9 @@ void queue_finish_packet_message(struct prod = pfp->prod; pfp->ids[prod % MAX_PENDING_FINISH_PACKETS] = id; pfp->prod++; + + if (flags & NC2_PACKET_FLAG_need_event) + ncrp->pending_time_sensitive_messages = 1; } /* Handle a packet message from the other end. On success, queues the @@ -111,7 +113,7 @@ void nc2_handle_packet_msg(struct netcha case NC2_PACKET_TYPE_receiver_copy: skb = handle_receiver_copy_packet(nc, ncrp, &msg, hdr, nr_frags, frags_off); - queue_finish_packet_message(ncrp, msg.id); + queue_finish_packet_message(ncrp, msg.id, msg.flags); break; case NC2_PACKET_TYPE_pre_posted: skb = handle_pre_posted_packet(nc, &msg, hdr, nr_frags, @@ -137,7 +139,7 @@ void nc2_handle_packet_msg(struct netcha receiver copy instead. */ skb = handle_receiver_copy_packet(nc, ncrp, &msg, hdr, nr_frags, frags_off); - queue_finish_packet_message(ncrp, msg.id); + queue_finish_packet_message(ncrp, msg.id, msg.flags); } break; default: diff -r 9681e69b222b -r e28f1bf386e7 drivers/xen/netchannel2/rscb.c --- a/drivers/xen/netchannel2/rscb.c Thu Feb 12 17:38:15 2009 +0000 +++ b/drivers/xen/netchannel2/rscb.c Thu Feb 12 19:14:52 2009 -0800 @@ -437,6 +437,8 @@ void prepare_xmit_grant(struct netchanne else tp->msg.type = NC2_PACKET_TYPE_receiver_map; + tp->msg.flags |= NC2_PACKET_FLAG_need_event; + for (cur_skb = tp->skb; cur_skb != NULL; cur_skb = skb_shinfo(cur_skb)->frag_list) { diff -r 9681e69b222b -r e28f1bf386e7 include/xen/interface/io/netchannel2.h --- a/include/xen/interface/io/netchannel2.h Thu Feb 12 17:38:15 2009 +0000 +++ b/include/xen/interface/io/netchannel2.h Thu Feb 12 19:14:52 2009 -0800 @@ -81,6 +81,7 @@ struct netchannel2_msg_packet { #define NC2_PACKET_FLAG_csum_blank 1 #define NC2_PACKET_FLAG_data_validated 2 #define NC2_PACKET_FLAG_bypass_candidate 4 +#define NC2_PACKET_FLAG_need_event 8 /* The mechanism which should be used to receive the data part of * a packet: