From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Date: Sun, 31 Dec 2006 20:37:15 +0000 Subject: Re: [KJ] [PATCH] net/core/flow.c: compare data with memcmp Message-Id: <20061231.123715.115911390.davem@davemloft.net> List-Id: References: <80ec54e90612310837y786fd764oc18bf37c8f0b2b8c@mail.gmail.com> In-Reply-To: <80ec54e90612310837y786fd764oc18bf37c8f0b2b8c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: daniel.marjamaki@gmail.com Cc: netdev@vger.kernel.org, kernel-janitors@lists.osdl.org, linux-kernel@vger.kernel.org From: "Daniel_Marjam=E4ki" Date: Sun, 31 Dec 2006 17:37:05 +0100 > From: Daniel Marjam=E4ki > This has been tested by me. > Signed-off-by: Daniel Marjam=E4ki Please do not do this. memcmp() cannot assume the alignment of the source and destination buffers and thus will run more slowly than that open-coded comparison. That code was done like that on purpose because it is one of the most critical paths in the networking flow cache lookup which runs for every IPSEC packet going throught the system. _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org https://lists.osdl.org/mailman/listinfo/kernel-janitors From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933214AbWLaUhS (ORCPT ); Sun, 31 Dec 2006 15:37:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933213AbWLaUhR (ORCPT ); Sun, 31 Dec 2006 15:37:17 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:50111 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S933211AbWLaUhQ convert rfc822-to-8bit (ORCPT ); Sun, 31 Dec 2006 15:37:16 -0500 Date: Sun, 31 Dec 2006 12:37:15 -0800 (PST) Message-Id: <20061231.123715.115911390.davem@davemloft.net> To: daniel.marjamaki@gmail.com Cc: netdev@vger.kernel.org, kernel-janitors@lists.osdl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/core/flow.c: compare data with memcmp From: David Miller In-Reply-To: <80ec54e90612310837y786fd764oc18bf37c8f0b2b8c@mail.gmail.com> References: <80ec54e90612310837y786fd764oc18bf37c8f0b2b8c@mail.gmail.com> X-Mailer: Mew version 5.1.52 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: "Daniel_Marjamäki" Date: Sun, 31 Dec 2006 17:37:05 +0100 > From: Daniel Marjamäki > This has been tested by me. > Signed-off-by: Daniel Marjamäki Please do not do this. memcmp() cannot assume the alignment of the source and destination buffers and thus will run more slowly than that open-coded comparison. That code was done like that on purpose because it is one of the most critical paths in the networking flow cache lookup which runs for every IPSEC packet going throught the system.