From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio Subject: Re: [PATCH] net: convert gro_count to bitmask Date: Thu, 12 Jul 2018 11:48:11 +0200 Message-ID: <20180712114811.04e6f2e0@epycfail> References: <1531300553-21413-1-git-send-email-lirongqing@baidu.com> <20180711125133.60528540@epycfail> <2AD939572F25A448A3AE3CAEA61328C23784EC2E@BC-MAIL-M28.internal.baidu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Cc: "netdev@vger.kernel.org" , Eric Dumazet To: "Li,Rongqing" Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52998 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725886AbeGLJ5F (ORCPT ); Thu, 12 Jul 2018 05:57:05 -0400 In-Reply-To: <2AD939572F25A448A3AE3CAEA61328C23784EC2E@BC-MAIL-M28.internal.baidu.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 12 Jul 2018 02:31:10 +0000 "Li,Rongqing" wrote: > > -----邮件原件----- > > 发件人: Stefano Brivio [mailto:sbrivio@redhat.com] > > 发送时间: 2018年7月11日 18:52 > > 收件人: Li,Rongqing > > 抄送: netdev@vger.kernel.org; Eric Dumazet > > 主题: Re: [PATCH] net: convert gro_count to bitmask > > > > On Wed, 11 Jul 2018 17:15:53 +0800 > > Li RongQing wrote: > > > > > @@ -5380,6 +5382,12 @@ static enum gro_result dev_gro_receive(struct > > napi_struct *napi, struct sk_buff > > > if (grow > 0) > > > gro_pull_from_frag0(skb, grow); > > > ok: > > > + if (napi->gro_hash[hash].count) > > > + if (!test_bit(hash, &napi->gro_bitmask)) > > > + set_bit(hash, &napi->gro_bitmask); > > > + else if (test_bit(hash, &napi->gro_bitmask)) > > > + clear_bit(hash, &napi->gro_bitmask); > > > > This might not do what you want. > > > > -- > > could you show detail ? $ cat if1.c; gcc -o if1 if1.c #include int main() { if (1) if (0) ; else if (2) printf("whoops\n"); return 0; } $ ./if1 whoops $ cat if2.c; gcc -o if2 if2.c #include int main() { if (1) { if (0) ; } else if (2) { printf("whoops\n"); } return 0; } $ ./if2 -- Stefano