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 232E6A0547; Thu, 29 Apr 2021 11:13:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1B6C41125; Thu, 29 Apr 2021 11:13:37 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id C2E534067E for ; Thu, 29 Apr 2021 11:13:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619687616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zv9mohxOKPQD/wicxTpK05ZSAWvUPNmzaG7PrQzCR/o=; b=XGreHwwQOFzW42avfmZGJwoti2PdxRFRHFfaiwnZNzKnbrpOLKOzt3VF7gQqob4H9COIt7 dSeFtC994DdfK0j/lxWfRqGxl1N2oXoGVYvSpQ43gF+jp0Fq22bklYXFB9uiafXpf38//g K3y5y7rXwU7Vd5oB6etjXv+RilmZJ9I= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-11-4m2ldOG1PfGlmcrOVLeDCw-1; Thu, 29 Apr 2021 05:13:33 -0400 X-MC-Unique: 4m2ldOG1PfGlmcrOVLeDCw-1 Received: by mail-vs1-f69.google.com with SMTP id z7-20020a67ca070000b0290220c083d3acso12882235vsk.21 for ; Thu, 29 Apr 2021 02:13:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Zv9mohxOKPQD/wicxTpK05ZSAWvUPNmzaG7PrQzCR/o=; b=eGe478Q7mY2ucJiexkyEB7ffKF99gV46AfTv1+qxzIxP9iH5ks8D+5NYqJetBcv2Tr R+iBv7HstWULJDTc5ylf084NEaha6MIYhCFvlwnaFNSA+1GD0WHw4uhVMFrx6i6d/IIY H1yaY6xIwb1jWquQPNmYi5JhS96H//whuEbm2RLTCy1NPwm9GDklsnC6RZJ6rYD1LS8B 6yxyWUaNNL3VTAjfQnC12v1FqBHAcLSk93MeISgmnc8RDAz2he+LNdCbx4cptXc8qsJP Gybe9vjbf/yr7N2hUvwSkAjaJvaEuZSGdL/kzNsjbQxLEvMxYVTIxAuqOJ+r14SOtY3C hsRw== X-Gm-Message-State: AOAM533ZQk6kvcAIgGNXBLnzuyGVsdZOcChf0BPXbCLgOGnKOfClTJA0 2+RMRY/Q0DtBMzzA4TnLP48qnnNwo0wOVq8aVcnyW/4U3gzm+lYboC1Dnn/5SSM9+Jc2xjCN+5s vXPuN+QuJKsdWHmnCOww= X-Received: by 2002:a67:fdd8:: with SMTP id l24mr19451032vsq.18.1619687612650; Thu, 29 Apr 2021 02:13:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI5o5fS/W2zuzuAYSnFkeDt5xUxLnBaOty3iGCqYKLK4vpwDL4/uq0knGAvYKai23dhh99XLh8NNdNPaPFsCE= X-Received: by 2002:a67:fdd8:: with SMTP id l24mr19451018vsq.18.1619687612396; Thu, 29 Apr 2021 02:13:32 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <1618847995-91229-4-git-send-email-vladimir.medvedkin@intel.com> From: David Marchand Date: Thu, 29 Apr 2021 11:13:20 +0200 Message-ID: To: Vladimir Medvedkin Cc: dev , "Ananyev, Konstantin" , "Chilikin, Andrey" , "Kinsella, Ray" , "Wang, Yipeng1" , "Gobriel, Sameh" , Bruce Richardson Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 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; > +} -- David Marchand