From: Eric Dumazet <eric.dumazet@gmail.com>
To: Daniel Baluta <dbaluta@ixiacom.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
Rohan Chitradurga <rohan@ixiacom.com>
Subject: Re: [PATCH] udp: avoid searching when no ports are available
Date: Fri, 25 Feb 2011 17:55:17 +0100 [thread overview]
Message-ID: <1298652917.2659.95.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTimodVFC8969md-f7iebS_9WvVahV9fPFFLtup73@mail.gmail.com>
Le vendredi 25 février 2011 à 18:45 +0200, Daniel Baluta a écrit :
> I guess now, the correct bitmap size is MAX_UDP_PORTS / (udptable->mask + 1)
> or MAX_UDP_PORTS >> udptable->log, right?
>
Yes, but using bitmap_zero(bitmap, PORTS_PER_CHAIN) is faster.
It generates 4 machine instructions,
movq $0x0,(%r10)
movq $0x0,0x8(%r10)
movq $0x0,0x10(%r10)
movq $0x0,0x18(%r10)
while bitmap_zero(bitmap, some_non_constant_expression) is more
expensive (it calls an out of line function)
> We don't have special needs on a small machine. We just want that when
> when all UDP ports are exhausted, bind calls to fail faster.
>
> I will be back with tests on latest kernel.
Hmm, please always use the latest kernel before sending patches.
Thanks
prev parent reply other threads:[~2011-02-25 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1298633711-11924-1-git-send-email-dbaluta@ixiacom.com>
2011-02-25 12:06 ` [PATCH] udp: avoid searching when no ports are available Eric Dumazet
2011-02-25 16:45 ` Daniel Baluta
2011-02-25 16:55 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1298652917.2659.95.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=dbaluta@ixiacom.com \
--cc=netdev@vger.kernel.org \
--cc=rohan@ixiacom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox