提交 42519ede 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net-gro: use ffs() to speedup napi_gro_flush()

We very often have few flows/chains to look at, and we
might increase GRO_HASH_BUCKETS to 32 or 64 in the future.
Signed-off-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d72ff4b4
......@@ -5364,11 +5364,13 @@ static void __napi_gro_flush_chain(struct napi_struct *napi, u32 index,
*/
void napi_gro_flush(struct napi_struct *napi, bool flush_old)
{
u32 i;
unsigned long bitmask = napi->gro_bitmask;
unsigned int i, base = ~0U;
for (i = 0; i < GRO_HASH_BUCKETS; i++) {
if (test_bit(i, &napi->gro_bitmask))
__napi_gro_flush_chain(napi, i, flush_old);
while ((i = ffs(bitmask)) != 0) {
bitmask >>= i;
base += i;
__napi_gro_flush_chain(napi, base, flush_old);
}
}
EXPORT_SYMBOL(napi_gro_flush);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册