Source-Changes-D archive

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

Re: CVS commit: src/sys/net



On Fri, Feb 19, 2016 at 12:16 PM, Roy Marples <roy%marples.name@localhost> wrote:
> On 18/02/2016 11:29, Ryota Ozaki wrote:
>> Okay, I've changed my mind. Let's commit your patch anyway and
>> keep an eye on the lossage messages to know how often and how
>> many lossage happens. If there are issues, we can improve then.
>> It's not too late.
>
> The irony is that overnight I changed my mind also!
> The challenge was to achieve a longer queue in the same size or less.
> According to size(1), the end result of this patch is exactly the same
> size as my previous one :)
>
> This has been achieved with bitmask array macros to densely pack a 2 bit
> integer into a larger integer as a backing store.
> I decided to use a uint16_t which allows for 8 events in the queue.
> Simply changing the integral type will magically expand the queue, so it
> could be changed to a uint64_t to allow 32 events in the queue but this
> is probably overkill.
> For really size challenged systems, this could be changed to a uint8_t
> to allow 4 events in the queue ....... which should still be big enough
> normally, but you wanted 10 so the closest match was 8.
>
> I've managed to keep the assignment of the link state to the interface
> within the initial if_link_state_change() call which my prior patch
> moved out.
>
> Also, only one queued event is processed at a time, subsequent ones have
> to wait for another softint(9) to occur.
> After all, the host may have >1 interface and we don't want to hog the
> network processing a larger queue.
>
>> I'm sorry for disturbing you.
>
> No, no. Thankyou for challenging me :)
>
> Maybe the macros here could be put to a more generic use (or there are
> already generic macros for this which I missed?) but unsure how right now.
>
> All being said, I learned a lot about bit shifting doing this and I
> might have made a mistake, but sample test cases for my macros appear to
> work fine. I would appreciate an OK from someone before I commit this.

Wow, I must be convinced by the new design :) I don't understand the macros
very much though, coverity would warn us if there are issues.

Thank you for your effort!
  ozaki-r


Home | Main Index | Thread Index | Old Index