From patchwork Tue Nov 3 02:17:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?UTF-8?B?6YKj5aicKOaBkuaciCk=?= X-Patchwork-Id: 8563 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 638E78E9D; Tue, 3 Nov 2015 03:17:54 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 95CA38E98 for ; Tue, 3 Nov 2015 03:17:52 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 02 Nov 2015 18:17:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,236,1444719600"; d="scan'208";a="592892918" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 02 Nov 2015 18:17:50 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tA32HoW6006536; Tue, 3 Nov 2015 10:17:50 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tA32Hll0019310; Tue, 3 Nov 2015 10:17:49 +0800 Received: (from jijiangl@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tA32HlJb019306; Tue, 3 Nov 2015 10:17:47 +0800 From: Na Na To: dev@dpdk.org Date: Tue, 3 Nov 2015 10:17:41 +0800 Message-Id: <1446517061-19261-3-git-send-email-nana.nn@alibaba-inc.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1446517061-19261-1-git-send-email-nana.nn@alibaba-inc.com> References: <1446517061-19261-1-git-send-email-nana.nn@alibaba-inc.com> Subject: [dpdk-dev] [PATCH v3 2/2] lib/lpm:fix incorrect reuse of already allocated tbl8 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes an initialization issue of 'valid_group' in the delete_depth_small(). When adding an entry to a tbl8, the .valid_group field should always be set, so that future adds do not accidently find and use this table, thinking it is currently invalid, i.e. unused, and thereby overwrite existing entries. Signed-off-by: Na Na --- lib/librte_lpm/rte_lpm.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index 57ec2f0..3981452 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -769,6 +769,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t ip_masked, struct rte_lpm_tbl8_entry new_tbl8_entry = { .valid = VALID, + .valid_group = VALID, .depth = sub_rule_depth, .next_hop = lpm->rules_tbl [sub_rule_index].next_hop,