From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 152D7804B for ; Tue, 16 Dec 2014 18:59:54 +0100 (CET) Received: by mail-wg0-f44.google.com with SMTP id b13so18218745wgh.31 for ; Tue, 16 Dec 2014 09:59:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=gDhWVBpyPBvGvZfpPHZzq+D+qH1T73V6srt+8ITYOU8=; b=UJlzHqzbKArZRCmkPueAIRjR5ovbn0VhdXhDdZeAn3iRJqRYtDmAmC4Cho7pI+FfEM z0JF/kQaK73lOQBRLRTK5DjwCCQwu+ZEnv/2+lb2VbtBAvkdYI/TzlyiWsT/1JRkUtaW 10/4uIctEImknDtoGPbL0a37E15IA+RAmWzTL/x0eLWZT2CCx12wVU/3wGYps7jqOefC KNeA9KKz4l0QWIK1M94pTNooa4X4EF5izZ2IPlbxmqcFn5eBiB6dxtEQZ9gibkSdOpVy 4L2ucpbyc8m9f3kmD+vXC6fFFF0t0xZ2hATYamADRegoEhbxObpeRiO3daUCL6TTCUeB XmKg== X-Gm-Message-State: ALoCoQluWf6WYPtlmFg7eqZ72OJuFureiqFaxqH9ag7HvViYbkXUlDSY5GTSHUi6Y8Fg3Bihakdk X-Received: by 10.180.77.7 with SMTP id o7mr6718196wiw.81.1418752793763; Tue, 16 Dec 2014 09:59:53 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id s9sm2999374wiz.12.2014.12.16.09.59.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 09:59:52 -0800 (PST) From: Thomas Monjalon To: Cristian Dumitrescu Date: Tue, 16 Dec 2014 18:59:27 +0100 Message-ID: <3098312.cgTdNF7W9b@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <20141213010638.28002.63966.stgit@localhost.localdomain> References: <20141213010638.28002.63966.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] lib/librte_table: Fix table array lookup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 17:59:54 -0000 Cristian, this patch is about packet framework. Could you review it please? 2014-12-12 17:06, Mark Wunderlich: > The existing lookup function was returning an unmodified > pkts_mask bitmask into lookup_hit_mask. This effectively > assumes that all packets would index correctly into one > of the array table entries. > > Also, there was no check that the metadata provided index > value was within range of the table max entries. By using > using table index bitmask on the metadata provided index > the resulting entry position may falsely indicate a hit > for index values provided that happen to be greter than > the number of table entries. > > Like other table type lookup functions it would seem that > the possibility exists that some of the packets provided > to the function would not result in a hit. It is assumed > that the metadata provided should be a direct index into > the array table. So, code was added to build and return > a bitmask for only those packets that correctly index > directly into the table array. > > If the original intent for this table type was to accept > any 32-bit value, then by applying the table index bitmask > as a modulo index for distribution across table entries, > then this patch would be invalid and should be rejected. > > Signed-off-by: Mark Wunderlich > --- > lib/librte_table/rte_table_array.c | 25 +++++++++++++++---------- > 1 file changed, 15 insertions(+), 10 deletions(-)