Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755266AbbLGI7R (ORCPT ); Mon, 7 Dec 2015 03:59:17 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:48817 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754642AbbLGI7A (ORCPT ); Mon, 7 Dec 2015 03:59:00 -0500 Subject: Re: [PATCH net-next] net: hns: optimize XGE capability by reducing cpu usage To: Joe Perches , David Miller References: <1449300749-50275-1-git-send-email-yankejian@huawei.com> <20151206.222929.804694720513782203.davem@davemloft.net> <1449459120.7356.14.camel@perches.com> CC: , , , , , , , , , , From: "Yankejian (Hackim Yim)" Message-ID: <56654A36.6090106@huawei.com> Date: Mon, 7 Dec 2015 16:58:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1449459120.7356.14.camel@perches.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.57.126.191] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56654A47.0074,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4391dc0cb1bd3e3a69c327be5a7f07e1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1300 Lines: 36 On 2015/12/7 11:32, Joe Perches wrote: > On Sun, 2015-12-06 at 22:29 -0500, David Miller wrote: >> > From: yankejian >> > Date: Sat, 5 Dec 2015 15:32:29 +0800 >> > >>> > > +#if (PAGE_SIZE < 8192) >>> > > + if (hnae_buf_size(ring) == HNS_BUFFER_SIZE_2048) { >>> > > + truesize = hnae_buf_size(ring); >>> > > + } else { >>> > > + truesize = ALIGN(size, L1_CACHE_BYTES); >>> > > + last_offset = hnae_page_size(ring) - hnae_buf_size(ring); >>> > > + } >>> > > + >>> > > +#else >>> > > + truesize = ALIGN(size, L1_CACHE_BYTES); >>> > > + last_offset = hnae_page_size(ring) - hnae_buf_size(ring); >>> > > +#endif >> > >> > This is not indented properly, and it looks terrible. > And it makes one curious as to why last_offset isn't set > in the first block. Hi Joe, if hnae_buf_size que equal to HNS_BUFFER_SIZE, last_offset is useless in the routines of this function. so it is ignored in the first block. thanks for your suggestion. Best regards, yankejian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/