From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id 25B181396 for ; Sat, 11 Mar 2017 08:41:42 +0100 (CET) Received: by mail-lf0-f65.google.com with SMTP id v2so8275400lfi.2 for ; Fri, 10 Mar 2017 23:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=rbxVhKydmumWt2hmZXbCkvUfBSWQZ08HmoaGtaoFxPo=; b=fRzU2oFRdkatul1wyckZQ37hcWXUNb/a8OYXF4K6VsEdVVcaquF/WVEu2RThjDNTlP 5ncDeOHQgpeuH9eUDfTVrdLVL+Pw39S0VJ8R6rH0+lVomNh0yIOxNjWNFcunRTqnFzKs EHAervhdCJBJeD9cugP6pac9UVpSgGbPe0zE6Hni8+P/i2G6/dlggrYldkiX4tZ75Ygp osS2UnWX7xBLsmfrY2O9VUptBA54T7Zsvn8ybkkn+HGylTRrOANnc0uGv8HbNjixe6zJ EYf2h3731gNICe4W0OYcz6zt7OFNLei45tvO2s3xSrj2kr4RakCRyC76UO9kL5Jd4Aa7 bRSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rbxVhKydmumWt2hmZXbCkvUfBSWQZ08HmoaGtaoFxPo=; b=L9krTbsikpT1jnSacntYSWDXwrltR93zGFacZmasiY8DygRc1XbXUJmVV92ygP27OK GJ/UW4gLDF0gQL+d0KLnFMIq80YIFyn0mQ/Z3dEpmLTd4sDASBaBw//gS84CTsI20fkL 8GWtCyxT26g9ky3LEq3N4wZz3Zm3w8qiOJLb4uN2KAMdx5XFBwZmFB4Np3K4wqDOVdK2 2adBLf2ocWLCzU4X0WdhFneknVkjPdMRw0HV6Y/4rfHbbidZRqqpoPsNr0AejhWz4Luu rrQJsA52sM7Tso7IXYpryzoBcBqDkYF5b/Cw7KdkAoa01j6Nowgcs1N5GnpA6uInH2ij t/pQ== X-Gm-Message-State: AMke39lOnVRk+hczSmLeiFm3zEz0e4xZEVFwEmpNjneB5cZwF/oisNc9RL/fjYwWwGqNhw== X-Received: by 10.25.228.66 with SMTP id b63mr6128316lfh.177.1489218102651; Fri, 10 Mar 2017 23:41:42 -0800 (PST) Received: from debian.is74.ru (pool-77-222-97-254.is74.ru. [77.222.97.254]) by smtp.gmail.com with ESMTPSA id e102sm2298732lfi.0.2017.03.10.23.41.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Mar 2017 23:41:42 -0800 (PST) From: Aleksey Katargin To: cristian.dumitrescu@intel.com Cc: dev@dpdk.org Date: Sat, 11 Mar 2017 12:41:26 +0500 Message-Id: <1489218086-4250-1-git-send-email-gureedo@gmail.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] table: fix hash_ext stats update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Mar 2017 07:41:43 -0000 Fixed stats double update. Signed-off-by: Aleksey Katargin --- lib/librte_table/rte_table_hash_ext.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/librte_table/rte_table_hash_ext.c b/lib/librte_table/rte_table_hash_ext.c index e283a3d..353f930 100644 --- a/lib/librte_table/rte_table_hash_ext.c +++ b/lib/librte_table/rte_table_hash_ext.c @@ -444,7 +444,6 @@ static int rte_table_hash_ext_lookup_unoptimized( uint64_t pkts_mask_out = 0; __rte_unused uint32_t n_pkts_in = __builtin_popcountll(pkts_mask); - RTE_TABLE_HASH_EXT_STATS_PKTS_IN_ADD(t, n_pkts_in); for ( ; pkts_mask; ) { struct bucket *bkt0, *bkt; @@ -490,7 +489,6 @@ static int rte_table_hash_ext_lookup_unoptimized( } *lookup_hit_mask = pkts_mask_out; - RTE_TABLE_HASH_EXT_STATS_PKTS_LOOKUP_MISS(t, n_pkts_in - __builtin_popcountll(pkts_mask_out)); return 0; } @@ -874,9 +872,12 @@ static int rte_table_hash_ext_lookup( RTE_TABLE_HASH_EXT_STATS_PKTS_IN_ADD(t, n_pkts_in); /* Cannot run the pipeline with less than 7 packets */ - if (__builtin_popcountll(pkts_mask) < 7) - return rte_table_hash_ext_lookup_unoptimized(table, pkts, + if (__builtin_popcountll(pkts_mask) < 7) { + status = rte_table_hash_ext_lookup_unoptimized(table, pkts, pkts_mask, lookup_hit_mask, entries, 0); + RTE_TABLE_HASH_EXT_STATS_PKTS_LOOKUP_MISS(t, n_pkts_in - __builtin_popcountll(*lookup_hit_mask)); + return status; + } /* Pipeline stage 0 */ lookup2_stage0(t, g, pkts, pkts_mask, pkt00_index, pkt01_index); @@ -1007,9 +1008,12 @@ static int rte_table_hash_ext_lookup_dosig( RTE_TABLE_HASH_EXT_STATS_PKTS_IN_ADD(t, n_pkts_in); /* Cannot run the pipeline with less than 7 packets */ - if (__builtin_popcountll(pkts_mask) < 7) - return rte_table_hash_ext_lookup_unoptimized(table, pkts, + if (__builtin_popcountll(pkts_mask) < 7) { + status = rte_table_hash_ext_lookup_unoptimized(table, pkts, pkts_mask, lookup_hit_mask, entries, 1); + RTE_TABLE_HASH_EXT_STATS_PKTS_LOOKUP_MISS(t, n_pkts_in - __builtin_popcountll(*lookup_hit_mask)); + return status; + } /* Pipeline stage 0 */ lookup2_stage0(t, g, pkts, pkts_mask, pkt00_index, pkt01_index); -- 2.1.4