From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 4E293C4B8 for ; Fri, 19 Feb 2016 12:01:03 +0100 (CET) Received: by mail-wm0-f51.google.com with SMTP id a4so65350734wme.1 for ; Fri, 19 Feb 2016 03:01:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C0IUcIJRB7W17Dq/FVGkM9fZaN5Cf6Lk+OmwE1GM3OU=; b=DoJ4h//QfswsCJDKwHQijk+dO+F6Sf2pJnpW1VlMpHMmUNWbMQPfgVKdkmArulZQmR d2u399hvao7VK4sBPmfHp81Iu2CCNphnmjCx/pBcnj/2MkbjxoC4Enh/AQMbEXYmfChz W2701VpPVkDcXVE3U1CZW7sZ/4M44B3bgUTTB2M1Vsdjc3rRXXdWHvz31yByu5dNrYHl rls32J8Nf36sFst0i1/3nP5bMp2AiPu7Xw4kVQZiRKfNORvIQl1mvgpK5nOX/s3Cv07R 04Y8wMD6knNn/yio1pHnGG/lDKAz8yQquaqbBBWk3yHZCAsxX9RYhj8I3D7MyxQLr8Qn bDuA== 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:in-reply-to :references; bh=C0IUcIJRB7W17Dq/FVGkM9fZaN5Cf6Lk+OmwE1GM3OU=; b=Un5mae4z/jh54Aqo3iftMSGpL8vXPtwMIxi8+C4TECJMaJ/A9Bu2CEtybOqaIpDuCO OFqnquriFCZE7JDCzNgvNm4UJQUAeCE2gt2JE8F6a19cJhaoak/lQ1jDVZ26+g9XIIGn 9w0rDXPOzA0Y3LvICcPxsjPAOXokgHbAD58Ub392t83Y9EO2qwRvqi/autYLn3Ontl6H go+hA+n31ecUwGieMJ0G3CFUSIiz95kyGHUf47l/eOu/Y7vZa5+F/sUbN/IT3JkGPlL2 n7vsVkvy8hDkSX7+8hExylGYbrT4NsKkCWQRYmUv7dTkj2jlZCK340ArpJLrtgTbfeNN Uc/A== X-Gm-Message-State: AG10YOR677ltwkIQxulQfctNGJd1Ji//x/CnWzaK13tRq7kwyVGU+YvQ9uKPN/s8KQ5Lx4FB X-Received: by 10.194.184.139 with SMTP id eu11mr14578305wjc.169.1455879663195; Fri, 19 Feb 2016 03:01:03 -0800 (PST) Received: from pala.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id m6sm3406998wje.21.2016.02.19.03.01.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Feb 2016 03:01:02 -0800 (PST) From: Didier Pallard To: dev@dpdk.org Date: Fri, 19 Feb 2016 12:00:30 +0100 Message-Id: <1455879631-18420-2-git-send-email-didier.pallard@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455879631-18420-1-git-send-email-didier.pallard@6wind.com> References: <1455010467-4991-1-git-send-email-didier.pallard@6wind.com> <1455879631-18420-1-git-send-email-didier.pallard@6wind.com> Subject: [dpdk-dev] [PATCH v3 1/2] test: fix CRC hash function autotest 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: Fri, 19 Feb 2016 11:01:03 -0000 Add some small key lengthes (below 4 bytes), and fix odd key lengthes expected returned values for CRC computation to match real CRC values. Signed-off-by: Didier Pallard --- app/test/test_hash_functions.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c index 3ad6d80..f767a48 100644 --- a/app/test/test_hash_functions.c +++ b/app/test/test_hash_functions.c @@ -54,26 +54,30 @@ * e.g.: key size = 4, key = 0x03020100 * key size = 8, key = 0x0706050403020100 */ -static uint32_t hash_values_jhash[2][10] = {{ +static uint32_t hash_values_jhash[2][12] = {{ + 0x8ba9414b, 0xdf0d39c9, 0xe4cf1d42, 0xd4ccb93c, 0x5e84eafc, 0x21362cfe, 0x2f4775ab, 0x9ff036cc, 0xeca51474, 0xbc9d6816, 0x12926a31, 0x1c9fa888 }, { + 0x5c62c303, 0x1b8cf784, 0x8270ac65, 0x05fa6668, 0x762df861, 0xda088f2f, 0x59614cd4, 0x7a94f690, 0xdc1e4993, 0x30825494, 0x91d0e462, 0x768087fc } }; -static uint32_t hash_values_crc[2][10] = {{ +static uint32_t hash_values_crc[2][12] = {{ + 0x00000000, 0xf26b8303, 0x91545164, 0x06040eb1, 0x9bb99201, 0xcc4c4fe4, - 0x14a90993, 0xf8a5dd8c, 0xc62beb31, 0x32bf340e, - 0x72f9d22b, 0x4a11475e + 0x14a90993, 0xf8a5dd8c, 0xcaa1ad0b, 0x7ac1e03e, + 0x43f44466, 0x4a11475e }, { + 0xbdfd3980, 0x70204542, 0x98cd4c70, 0xd52c702f, 0x41fc0e1c, 0x3905f65c, - 0x94bff47f, 0x1bab102d, 0xd2911ed7, 0xe8faa813, - 0x6bea184b, 0x53028d3e + 0x94bff47f, 0x1bab102d, 0xf4a2c645, 0xbf441539, + 0x789c104f, 0x53028d3e } }; @@ -89,6 +93,7 @@ static uint32_t hash_values_crc[2][10] = {{ static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc}; static uint32_t hashtest_initvals[] = {0, 0xdeadbeef}; static uint32_t hashtest_key_lens[] = { + 1, 2, /* Unusual key sizes */ 4, 8, 16, 32, 48, 64, /* standard key sizes */ 9, /* IPv4 SRC + DST + protocol, unpadded */ 13, /* IPv4 5-tuple, unpadded */ -- 2.1.4