From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14155A04B0; Sun, 18 Oct 2020 11:31:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57EE1C8F4; Sun, 18 Oct 2020 11:31:19 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 875CDC8D6 for ; Sun, 18 Oct 2020 11:31:16 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201018093105euoutp02b62c193d1f74603b53afde396c101952~-DEDaQ8vd1954319543euoutp02L for ; Sun, 18 Oct 2020 09:31:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201018093105euoutp02b62c193d1f74603b53afde396c101952~-DEDaQ8vd1954319543euoutp02L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603013465; bh=mRS0JkL8YujTg9D6aaBst0/Gld5wfjC6uR7H4EYLEhA=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=SwnTVKfatZ2BhIRdod3k5jlDOgQuhORI6XZRPao2KMOeXMtRZSuHuDXoSe2gngXjn sIfnb6JppganrPpE/n2NNY2tQV9le5U5ZJKi0eN7ihIdBr4hchQwkZUnXB2rg4QF1j oDR/D8tjO3nyeaVQkBvMvT1SGXHP1xBYC5b9AqrE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201018093059eucas1p2c4957c434a89ef225ebaabbcd6b2c65c~-DD_hqt3K0919509195eucas1p2v; Sun, 18 Oct 2020 09:30:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8D.5F.05997.35B0C8F5; Sun, 18 Oct 2020 10:30:59 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201018093058eucas1p1034c1a8a81b710e31d64ddc1d08b18bf~-DD9oWV1S0554505545eucas1p18; Sun, 18 Oct 2020 09:30:58 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201018093058eusmtrp287b24e7e5b6a76d979f5afd57fd89f3c~-DD9ns7ls1063010630eusmtrp2f; Sun, 18 Oct 2020 09:30:58 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-52-5f8c0b530084 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2F.A9.06314.25B0C8F5; Sun, 18 Oct 2020 10:30:58 +0100 (BST) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201018093057eusmtip2c9b45044e71f6001096e32c99d4d6431~-DD8pTDUA0432804328eusmtip2U; Sun, 18 Oct 2020 09:30:57 +0000 (GMT) To: Akhil Goyal , "dev@dpdk.org" , "thomas@monjalon.net" , "anoobj@marvell.com" , "konstantin.ananyev@intel.com" Cc: "mdr@ashroe.eu" , Hemant Agrawal , "declan.doherty@intel.com" , "radu.nicolau@intel.com" , "david.coyle@intel.com" , "\"'Lukasz Wojciechowski'\"," From: Lukasz Wojciechowski Message-ID: Date: Sun, 18 Oct 2020 11:30:56 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJKsWRmVeSWpSXmKPExsWy7djP87rB3D3xBqeealmsPzOP0WLZlq1M Fh1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ou2LgGLTw9OsDhweyw/18/q 8WvBUlaPxXteMnlMXniR2ePYzWnsHhvf7WDyOPhuD1MAe5SeTVF+aUmqQkZ+cYmtUrShhZGe oaWFnpGJpZ6hsXmslZGpkr6dTUpqTmZZapG+XYJext5HggW3xSsun37A3sB4TbiLkYNDQsBE ouezYhcjF4eQwFJGie0zzzNDxGUkPlwS6GLkBDKFJf5c62KDqHnNKPGj5xYLSEJYwFpi6exr rCAJEYGHjBJbf/5iAXGYBTYySVz6fpkFouU0k8SaE2+ZQFrYBGwljsz8ygpi8wq4SUx8sIwd xGYRUJU4/vgCmC0qECfxY2IvG0SNoMTJmU/A1nEKxEpsbm0Am8MsYCYxb/NDZghbXqJ562wo W1zi1pP5TBMYhWYhaZ+FpGUWkpZZSFoWMLKsYhRJLS3OTc8tNtQrTswtLs1L10vOz93ECIzY bcd+bt7BeGlj8CFGAQ5GJR7eH7zd8UKsiWXFlbmHGCU4mJVEeJ3Ono4T4k1JrKxKLcqPLyrN SS0+xGgK9NxEZinR5HxgMskriTc0NTS3sDQ0NzY3NrNQEuftEDgYIySQnliSmp2aWpBaBNPH xMEp1cDYlZCqofjiStJ/XpkHSvavk6aeyZwu+Xi3VK3ds+NLstcVOpuxX/ryO2yuZPM50SkX PsvbcpqXq0/+cLPTPzhpQnhvzcLnHyurS3X+7+VMWLKo3qQkZ05vc41Ocx1DZ+iapz/rspY5 6Cm23vjmUZ49O6tM20JHszL8We0W6wliDSbbZ/rbRymxFGckGmoxFxUnAgB2KOVX7gIAAA== X-CMS-MailID: 20201018093058eucas1p1034c1a8a81b710e31d64ddc1d08b18bf X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201017115029eucas1p2d6f935c7153c1efa88e4670f11836ed2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201017115029eucas1p2d6f935c7153c1efa88e4670f11836ed2 References: <20201014185651.31924-1-akhil.goyal@nxp.com> <20201017115010.17477-1-akhil.goyal@nxp.com> <7412297a-c289-3da9-3f15-7dfc5a818a88@partner.samsung.com> Subject: Re: [dpdk-dev] [PATCH v4] security: update session create API 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Akhil, If you replace mock_session_create_exp.ret with mock_session_destroy_exp.ret in mock_session_destroy() everything works fine and all test cases pass. W dniu 18.10.2020 o 10:47, Akhil Goyal pisze: > Hi Lukasz, >> Hi Akhil, >> >> just one more thing, rest looks good >> >> >>> diff --git a/app/test/test_security.c b/app/test/test_security.c >>> index 77fd5adc6..62e4991eb 100644 >>> --- a/app/test/test_security.c >>> +++ b/app/test/test_security.c >>> @@ -363,8 +392,13 @@ static struct mock_session_destroy_data { >>> static int >>> mock_session_destroy(void *device, struct rte_security_session *sess) >>> { >>> - mock_session_destroy_exp.called++; >>> + void *sess_priv = get_sec_session_private_data(sess); >>> >>> + mock_session_destroy_exp.called++; >>> + if ((mock_session_create_exp.ret == 0) && (sess_priv != NULL)) { >> mock_session_destroy_exp.ret Here is the place you need to change. Sorry that my comment was not clear enough. >>> + rte_mempool_put(rte_mempool_from_obj(sess_priv), >> sess_priv); >>> + set_sec_session_private_data(sess, NULL); >>> + } >>> >> MOCK_TEST_ASSERT_POINTER_PARAMETER(mock_session_destroy_ex >> p, device); >> MOCK_TEST_ASSERT_POINTER_PARAMETER(mock_session_destroy_ex >> p, sess); >> >>> @@ -1371,6 +1492,7 @@ test_session_destroy_ops_failure(void) >>> mock_session_destroy_exp.ret = -1; >>> >>> TEST_ASSERT_MEMPOOL_USAGE(1); >>> + TEST_ASSERT_PRIV_MP_USAGE(1); >>> TEST_ASSERT_SESSION_COUNT(1); >>> >>> int ret = rte_security_session_destroy(&ut_params->ctx, >>> @@ -1396,6 +1518,7 @@ test_session_destroy_success(void) >>> mock_session_destroy_exp.sess = ut_params->sess; >>> mock_session_destroy_exp.ret = 0; >>> TEST_ASSERT_MEMPOOL_USAGE(1); >>> + TEST_ASSERT_PRIV_MP_USAGE(1); >>> TEST_ASSERT_SESSION_COUNT(1); >>> >>> int ret = rte_security_session_destroy(&ut_params->ctx, >>> ut_params->sess); >>> >> TEST_ASSERT_MOCK_FUNCTION_CALL_RET(rte_security_session_destr >> oy, >>> ret, -1, "%d"); >>> TEST_ASSERT_MOCK_CALLS(mock_session_destroy_exp, 1); >>> TEST_ASSERT_MEMPOOL_USAGE(1); >> nit: you can add and assertion here as well: TEST_ASSERT_PRIV_MP_USAGE(1); > Thanks for the review of the patch. > > This is causing the test to fail. And I cannot spend more time in debugging this right now. > Since we are approaching RC1 deadline and the intent of the patch is to add a new > Parameter in session create API and which is complete. The issue is with the security > Tests which are trying to create mock driver APIs with no real usage. > > Hence, I reckon we can go ahead with this patch in RC1 and fix it later. > > > @thomas@monjalon.net, @anoobj@marvell.com, @Ananyev, Konstantin. > Any thoughts from your side? > > Regards, > Akhil > > -- Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 l.wojciechow@partner.samsung.com