lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Control priority processing of the packages


From: address@hidden
Subject: Re: [lwip-users] Control priority processing of the packages
Date: Fri, 18 Sep 2020 21:32:48 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

Am 18.09.2020 um 14:41 schrieb Mário Luzeiro:
> Hello all,
>
> Not sure if my question makes sense but is possible that I can control the 
> priority processing of the packages?
>
> I would like that large packages are delayed or do some OS delay to switch to 
> other tasks.
>
> My propose is that if there are multiple packages arriving the smaller are 
> processed first.
> I would like to assume (to my case scenario) that a large package (TCP_MSS I 
> set it to maximum) is related to "data transfer of application" and that 
> small packages are related to "networking management"

I see what you're getting at, but it's not as simple as that. You cannot
just postpone packets by looking at the size. You have to ensure packets
are processed in the order they arrive, or some protocols (including
TCP) may get confused (or worse). You may change the order of processing
different data streams, but you should not change the order of packets
in a single data stream.

What you *could* do is to have more than one thread processing input
packets and have a check very early in rx processing that pushes some
low-priority ports or protocols into a low-prio rx queue that is handled
by a lower-prio input thread.

>
> Where should I look in LWIP to add this control?

To do what I suggested, change the netif->input callback to something
anlysing the input packet and calling diffferent input handlers in turn.
Of course, you need to set up different input threads and queues before.

Regards,
Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]