From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8BF9CA034C for ; Fri, 8 Jul 2022 16:30:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80587427EA; Fri, 8 Jul 2022 16:30:27 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id B31AF4021E; Fri, 8 Jul 2022 16:30:25 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH 2/2] net: have checksum routines accept unaligned data Date: Fri, 8 Jul 2022 16:30:24 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D871B7@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 2/2] net: have checksum routines accept unaligned data Thread-Index: AdiS1IA/l9x+klyRQYGvk9cmUEb7BwAAV2DA References: <98CBD80474FA8B44BF855DF32C47DC35D87189@smartserver.smartshare.dk> <20220707183450.3203361-1-hofors@lysator.liu.se> <20220707183450.3203361-2-hofors@lysator.liu.se> <98CBD80474FA8B44BF855DF32C47DC35D871B1@smartserver.smartshare.dk> <6839721a-8050-0e11-0c66-0f735ec8c56d@ericsson.com> <98CBD80474FA8B44BF855DF32C47DC35D871B4@smartserver.smartshare.dk> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" , =?iso-8859-1?Q?Mattias_R=F6nnblom?= Cc: =?iso-8859-1?Q?Mattias_R=F6nnblom?= , , "Emil Berg" , , , , , "Onar Olsen" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > Sent: Friday, 8 July 2022 16.10 >=20 > On Fri, Jul 08, 2022 at 01:52:12PM +0000, Mattias R=F6nnblom wrote: > > On 2022-07-08 15:02, Morten Br=F8rup wrote: > > >> From: Mattias R=F6nnblom [mailto:mattias.ronnblom@ericsson.com] > > >> Sent: Friday, 8 July 2022 14.44 > > >> > > >> On 2022-07-07 23:44, Morten Br=F8rup wrote: > > >>>> From: Mattias R=F6nnblom [mailto:hofors@lysator.liu.se] > > >>>> Sent: Thursday, 7 July 2022 20.35 > > >>>> [...] > > >>>> static inline uint32_t > > >>>> __rte_raw_cksum(const void *buf, size_t len, uint32_t sum) > > >>>> { > > >>>> - /* extend strict-aliasing rules */ > > >>>> - typedef uint16_t __attribute__((__may_alias__)) u16_p; > > >>>> - const u16_p *u16_buf =3D (const u16_p *)buf; > > >>>> - const u16_p *end =3D u16_buf + len / sizeof(*u16_buf); > > >>>> + const void *end; > > >>> > > >>> I would set "end" here instead, possibly making the pointer = const > > >> too. And add spaces around '/'. > > >>> const void * const end =3D RTE_PTR_ADD(buf, (len / > sizeof(uint16_t)) * > > >> sizeof(uint16_t)); > > >>> > > >> > > >> I don't think that makes the code more readable. > > > > > > It's only a matter of taste... Your code, your decision. :-) > > > > > > I think the spaces are required by the coding standard; not sure, > though. > > > > > > > If it isn't in the coding standard, it should be. But if you add > spaces, > > you have to break the line, to fit into 80 characters. A net loss, > IMO. > > >=20 > Just FYI, lines up to 100 chars are ok now. Automated checkpatch = checks > as > shown in patchwork only flag lines longer than that. >=20 > /Bruce The coding style [1] recommends max 80 characters, with an (easy to = miss) note below, saying that up to 100 characters are acceptable. I = think it should be simplified, replacing the 80 characters = recommendation by a 100 characters limit, so the additional note can be = removed. Why still recommend 80, when we really mean 100? [1] https://doc.dpdk.org/guides/contributing/coding_style.html