# HG changeset patch # User Jose Renato Santos # Date 1234495286 28800 # Node ID ef3f0e30f1b2b36b5088f222f75e940b18825cd3 # Parent e28f1bf386e71c5525c035d7e5de1c29f9696fe1 Use new flag on packet message to reduce number of events due to message finish packets. Request event notification only after a fixed number of fragments have been sent. diff -r e28f1bf386e7 -r ef3f0e30f1b2 drivers/xen/netchannel2/netchannel2_core.h --- a/drivers/xen/netchannel2/netchannel2_core.h Thu Feb 12 19:14:52 2009 -0800 +++ b/drivers/xen/netchannel2/netchannel2_core.h Thu Feb 12 19:21:26 2009 -0800 @@ -28,6 +28,11 @@ static inline void DEBUGMSG(const char * #define ENTER() DEBUGMSG("===>") #define EXIT() DEBUGMSG("<===") #define RETURN(x) do { EXIT(); return (x); } while (0) + +/* After we send this number of frags, we request the + * other end to notify us when sending the corresponding + * finish packet message */ +#define MAX_COUNT_FRAGS_NO_EVENT 192 /* Very small packets (e.g. TCP pure acks) are sent inline in the * ring, to avoid the hypercall overhead. This is the largest packet @@ -319,6 +324,11 @@ struct netchannel2_ring_pair { to keep outstanding at one time. Valid whenever is_attached is set. */ unsigned max_tx_packets_outstanding; + + /* Count number of frags that we have sent to the other side + When we reach a max value we request that the other end + send an event when sending the corresponding finish message */ + unsigned count_frags_no_event; /* Set if we need to send a SET_MAX_PACKETS message. Protected by the lock. */ diff -r e28f1bf386e7 -r ef3f0e30f1b2 drivers/xen/netchannel2/rscb.c --- a/drivers/xen/netchannel2/rscb.c Thu Feb 12 19:14:52 2009 -0800 +++ b/drivers/xen/netchannel2/rscb.c Thu Feb 12 19:21:26 2009 -0800 @@ -437,7 +437,11 @@ void prepare_xmit_grant(struct netchanne else tp->msg.type = NC2_PACKET_TYPE_receiver_map; - tp->msg.flags |= NC2_PACKET_FLAG_need_event; + ncrp->count_frags_no_event += tp->nr_fragments; + if (ncrp->count_frags_no_event >= MAX_COUNT_FRAGS_NO_EVENT) { + tp->msg.flags |= NC2_PACKET_FLAG_need_event; + ncrp->count_frags_no_event = 0; + } for (cur_skb = tp->skb; cur_skb != NULL;