Hello,

 Attached is an updated version of the patch that instead of looping on
all the ring-buffer slots limit this to only "window" slots and makes
also sure that only "window" slots are used for sending. So this way
all the slots used are scanned for unacked messages and the number of
slots inspected is simultaneously limited to the minimum required.

Cheers,

                                Olivier



On Thu, 8 Jul 2010 14:01:46 +0200, Olivier Dormond <[email protected]>
wrote:

> Hi Vincent,
> 
> On Thu, 08 Jul 2010 13:47:47 +0200, Vincent CHAVANIS
> <[email protected]> wrote:
> 
> > So, you will loop 100 times (in most cases for nothing) to find any
> > unacked msg ? This is useless CPU usage don't you think ?
> 
> Sure. But the unacked messages can be in any slot of the ring-buffer.
> 
> The other solution would be to fix the sending logic to take the
> window into account and wrap around the "trn" when it reaches
> "window" instead of EMI2_MAX_TRN. It happens that I didn't look far
> enough to see how much changes this would implies. I'll try to have a
> look at it later today.
> 
> Cheers,
> 
>                               Olivier
> 
> 
> > Le 08/07/2010 10:52, Olivier Dormond a écrit :
> > > Hello,
> > >
> > >   Here is a patch against 1.4.3 to fix the detection of non-acked
> > > messages sent through EMI/UCP. The problem arise when the window
> > > parameter is set to a non-default value. In this case the loop in
> > > emi2_idleprocessing which search for unacked messages only examine
> > > the first "window" messages of the ring-buffer and thus misses any
> > > unacked message with a trn higher then "window".
> > >
> > > Cheers,
> > >
> > >                           Olivier
> > >
> > 
> 
> 
> 



-- 
______________________________________________________________________
MNC Mobile News Channel SA              Direct phone: +41 21 317 50 25
Olivier Dormond                         Central:      +41 21 317 50 20
Av. de la Gare 10                       Fax:          +41 21 317 50 21
1003 Lausanne                           Email:          [email protected]
diff -rubB kannel-1.4.3/gw/smsc/smsc_emi.c kannel-1.4.3-emi-windowing-fix/gw/smsc/smsc_emi.c
--- kannel-1.4.3/gw/smsc/smsc_emi.c	2009-01-12 17:46:50.000000000 +0100
+++ kannel-1.4.3-emi-windowing-fix/gw/smsc/smsc_emi.c	2010-07-08 16:01:42.000000000 +0200
@@ -959,7 +959,7 @@
  */
 static int emi2_next_trn (SMSCConn *conn)
 {
-#define INC_TRN(x) ((x)=((x) + 1) % EMI2_MAX_TRN)
+#define INC_TRN(x) ((x)=((x) + 1) % PRIVDATA(conn)->window)
     int result;
     
     while (SLOTBUSY(conn,PRIVDATA(conn)->priv_nexttrn))

Reply via email to