From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F394CA0547; Thu, 29 Apr 2021 11:17:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF701412C6; Thu, 29 Apr 2021 11:17:24 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 8BE7B4067E for ; Thu, 29 Apr 2021 11:17:23 +0200 (CEST) IronPort-SDR: zjz3tVwIO8VKLI++APNmwUv9j3RHzfO6f/JWJPeg6SuHFpdCSnm0yzw4m7wXcmnkCtGj0m4/kL P3VJPkXHtFqw== X-IronPort-AV: E=McAfee;i="6200,9189,9968"; a="184096006" X-IronPort-AV: E=Sophos;i="5.82,258,1613462400"; d="scan'208";a="184096006" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2021 02:17:21 -0700 IronPort-SDR: MER6Uxpg4Qnwot5kJWWgVnI9+njhs4H/Ah+1ynl9gefbn/vzdOEtVf6NmTO3VA30eHs0rtFZUK BjsULZJUXQnw== X-IronPort-AV: E=Sophos;i="5.82,258,1613462400"; d="scan'208";a="619657783" Received: from vmedvedk-mobl.ger.corp.intel.com (HELO [10.215.253.209]) ([10.215.253.209]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2021 02:17:11 -0700 To: David Marchand Cc: dev , "Ananyev, Konstantin" , "Chilikin, Andrey" , "Kinsella, Ray" , "Wang, Yipeng1" , "Gobriel, Sameh" , Bruce Richardson References: <1618319973-391016-1-git-send-email-vladimir.medvedkin@intel.com> <1618847995-91229-1-git-send-email-vladimir.medvedkin@intel.com> <1618847995-91229-4-git-send-email-vladimir.medvedkin@intel.com> From: "Medvedkin, Vladimir" Message-ID: <381c0806-877c-fe06-4a69-8f9fc8221b2c@intel.com> Date: Thu, 29 Apr 2021 12:17:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 3/5] test/hash: add additional thash tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello David, Oh, interesting, thanks for the report, I'll take a look! On 29/04/2021 12:13, David Marchand wrote: > Hello Vladimir, > > On Mon, Apr 19, 2021 at 6:00 PM Vladimir Medvedkin > wrote: >> +static int >> +test_adjust_tuple(void) >> +{ >> + struct rte_thash_ctx *ctx; >> + struct rte_thash_subtuple_helper *h; >> + const int key_len = 40; >> + const uint8_t *new_key; >> + uint8_t tuple[TUPLE_SZ]; >> + uint32_t tmp_tuple[TUPLE_SZ / sizeof(uint32_t)]; >> + uint32_t tuple_copy[TUPLE_SZ / sizeof(uint32_t)]; >> + uint32_t hash; >> + int reta_sz = CHAR_BIT; >> + int ret; >> + unsigned int i, desired_value = rte_rand() & HASH_MSK(reta_sz); >> + >> + memset(tuple, 0xab, TUPLE_SZ); >> + >> + ctx = rte_thash_init_ctx("test", key_len, reta_sz, NULL, 0); >> + RTE_TEST_ASSERT(ctx != NULL, "can not create thash ctx\n"); >> + >> + /* >> + * set offset to be in the middle of a byte >> + * set size of the subtuple to be 2 * rets_sz >> + * to have the room for random bits >> + */ >> + ret = rte_thash_add_helper(ctx, "test", reta_sz * 2, >> + (5 * CHAR_BIT) + 4); >> + RTE_TEST_ASSERT(ret == 0, "can not add helper, ret %d\n", ret); >> + >> + new_key = rte_thash_get_key(ctx); >> + >> + h = rte_thash_get_helper(ctx, "test"); >> + RTE_TEST_ASSERT(h != NULL, "can not find helper\n"); >> + >> + ret = rte_thash_adjust_tuple(ctx, h, tuple, TUPLE_SZ, desired_value, >> + 1, NULL, NULL); >> + RTE_TEST_ASSERT(ret == 0, "can not adjust tuple, ret %d\n", ret); >> + >> + for (i = 0; i < (TUPLE_SZ / 4); i++) >> + tmp_tuple[i] = >> + rte_be_to_cpu_32(*(uint32_t *)&tuple[i * 4]); >> + >> + hash = rte_softrss(tmp_tuple, TUPLE_SZ / 4, new_key); >> + RTE_TEST_ASSERT((hash & HASH_MSK(reta_sz)) == >> + desired_value, "bad desired value\n"); >> + >> + >> + /* Pass previously calculated tuple to callback function */ >> + memcpy(tuple_copy, tuple, TUPLE_SZ); >> + >> + memset(tuple, 0xab, TUPLE_SZ); >> + ret = rte_thash_adjust_tuple(ctx, h, tuple, TUPLE_SZ, desired_value, >> + 1, cmp_tuple_eq, tuple_copy); >> + RTE_TEST_ASSERT(ret == -EEXIST, >> + "adjust tuple didn't indicate collision\n"); >> + >> + /* >> + * Make the function to generate random bits into subtuple >> + * after first adjustment attempt. >> + */ >> + memset(tuple, 0xab, TUPLE_SZ); >> + ret = rte_thash_adjust_tuple(ctx, h, tuple, TUPLE_SZ, desired_value, >> + 2, cmp_tuple_eq, tuple_copy); >> + RTE_TEST_ASSERT(ret == 0, "can not adjust tuple, ret %d\n", ret); > > > This check failed at least once in the CI, for no obvious (for me) reason. > https://github.com/ovsrobot/dpdk/actions/runs/794713806 > > 87/96 DPDK:fast-tests / thash_autotest FAIL 0.17 s (exit > status 255 or signal 127 SIGinvalid) > > --- command --- > DPDK_TEST='thash_autotest' > /home/runner/work/dpdk/dpdk/build/app/test/dpdk-test -l 0-1 > --file-prefix=thash_autotest > --- stdout --- > RTE>>thash_autotest > + ------------------------------------------------------- + > + Test Suite : thash autotest > + ------------------------------------------------------- + > + TestCase [ 0] : test_toeplitz_hash_calc succeeded > + TestCase [ 1] : test_create_invalid succeeded > + TestCase [ 2] : test_multiple_create succeeded > + TestCase [ 3] : test_free_null succeeded > + TestCase [ 4] : test_add_invalid_helper succeeded > + TestCase [ 5] : test_find_existing succeeded > + TestCase [ 6] : test_get_helper succeeded > + TestCase [ 7] : test_period_overflow succeeded > + TestCase [ 8] : test_predictable_rss_min_seq succeeded > + TestCase [ 9] : test_predictable_rss_multirange succeeded > + TestCase [10] : test_adjust_tuple failed > + ------------------------------------------------------- + > + Test Suite Summary > + Tests Total : 11 > + Tests Skipped : 0 > + Tests Executed : 11 > + Tests Unsupported: 0 > + Tests Passed : 10 > + Tests Failed : 1 > + ------------------------------------------------------- + > Test Failed > RTE>> > --- stderr --- > EAL: Detected 2 lcore(s) > EAL: Detected 1 NUMA nodes > EAL: Detected shared linkage of DPDK > EAL: Multi-process socket /var/run/dpdk/thash_autotest/mp_socket > EAL: Selected IOVA mode 'PA' > EAL: No available 1048576 kB hugepages reported > EAL: VFIO support initialized > APP: HPET is not enabled, using TSC as default timer > HASH: Can't add helper due to conflict with existing helper second_range > HASH: Can't generate m-sequence due to period overflow > EAL: Test assert test_adjust_tuple line 559 failed: can not adjust > tuple, ret -17 > > ------- > > > >> + >> + for (i = 0; i < (TUPLE_SZ / 4); i++) >> + tmp_tuple[i] = >> + rte_be_to_cpu_32(*(uint32_t *)&tuple[i * 4]); >> + >> + hash = rte_softrss(tmp_tuple, TUPLE_SZ / 4, new_key); >> + RTE_TEST_ASSERT((hash & HASH_MSK(reta_sz)) == >> + desired_value, "bad desired value\n"); >> + >> + rte_thash_free_ctx(ctx); >> + >> + return TEST_SUCCESS; >> +} > > -- Regards, Vladimir