Re: nfnetlink_queue -- why linear lookup ?

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

 



On 8/14/21 11:01 PM, Florian Westphal wrote:
alexandre.ferrieux@xxxxxxxxxx <alexandre.ferrieux@xxxxxxxxxx> wrote:
  find_dequeue_entry(struct nfqnl_instance *queue, unsigned int id)
  {
    ...
    list_for_each_entry(i, &queue->queue_list, list) {
      if (i->id == id) {
        entry = i;
        break;
      }
    }
    ...
  }

As a result, in a situation of "highly asynchronous" verdicts, i.e. when we
want some packets to linger in the queue for some time before reinjection,
the mere existence of a large number of such "old packets" may incur a
nonnegligible cost to the system.

So I'm wondering: why is the list implemented as a simple linked list
instead of an array directly indexed by the id (like file descriptors) ?

Because when this was implemented "highly asynchronous" was not on the
radar.  All users of this (that I know of) do in-order verdicts.

So, O(N) instead of O(1) just because "I currently can't imagine N>5" ?

Would a patch to that effect be rejected ?

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux