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 65E8EA04B0; Sun, 18 Oct 2020 11:37:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C0D83C9E4; Sun, 18 Oct 2020 11:37:32 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 0F6FDC948 for ; Sun, 18 Oct 2020 11:37:30 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201018093718euoutp01aade501549d52e04f73d044d7cb6f2ae~-DJfSp77r1463114631euoutp01j for ; Sun, 18 Oct 2020 09:37:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201018093718euoutp01aade501549d52e04f73d044d7cb6f2ae~-DJfSp77r1463114631euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603013838; bh=4rg8Qj/U4wLQkYbob2NtyQg5cEQlJ9x8Ug7TSC5NpyE=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=I0GVA5/aoQbNYP7P5XLyvE/iHdBwC/gUsExKeyaHZejt+MJVsFoA8HQw1I1SJZZ3f PN8Hsv3DB8UAxzqSmd7MIjfuRnJ7eww2SBhTy6dcDuJ88THcJC8QFNPQbvdaaaCtyN JzJRdGws8+bHMv9vZZqlpXn8+bnv7+gNcz4ZUYx8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201018093712eucas1p213350715da8a9f54f6ead1d73a079a28~-DJZoHs532630826308eucas1p2G; Sun, 18 Oct 2020 09:37:12 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F5.95.06456.8CC0C8F5; Sun, 18 Oct 2020 10:37:12 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201018093711eucas1p1d4798e62686074c88bd2b917aa410d4b~-DJYv2i9d1772817728eucas1p1S; Sun, 18 Oct 2020 09:37:11 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201018093711eusmtrp24cc496047f1db3ea0b02821e4f9edf49~-DJYvMvRH1624516245eusmtrp2n; Sun, 18 Oct 2020 09:37:11 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-87-5f8c0cc885d1 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id FD.C9.06314.7CC0C8F5; Sun, 18 Oct 2020 10:37:11 +0100 (BST) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201018093710eusmtip2b5ccac44d75121836f3e9ec038444101~-DJX3BOsv0605306053eusmtip2Z; Sun, 18 Oct 2020 09:37:10 +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:37:09 +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: H4sIAAAAAAAAA02SeUhUURTGue+9mXkzOXYdNY8LBAMZBm6V8NCMDKkhKMo/IlrUUR9qO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nHaNF/9ajLBZtXQIWnx6cYHHg9lh+rp/V 49eCpawei/e8ZPKYvPAis8exm9PYPTa+28HkcfDdHqYA9ig9m6L80pJUhYz84hJbpWhDCyM9 Q0sLPSMTSz1DY/NYKyNTJX07m5TUnMyy1CJ9uwS9jJNT1rAXNClVHFl2kqmB8Y5MFyMnh4SA icSPlx9Yuxi5OIQEljJK7Ji9hr2LkQMoISPx4ZIARI2wxJ9rXWwQNa8ZJS5sWcYEkhAWsJZY OvsaWLOIwENGia0/f7GAOMwCG5kkLn2/zALR0sEsse3yObAWNgFbiSMzv7KC2LwCbhLH/sxh BLFZBFQlZncsZgaxRQXiJH5M7GWDqBGUODnzCQuIzSngLtHdsgWshlnATGLe5odQtrxE89bZ ULa4xK0n85kmMArNQtI+C0nLLCQts5C0LGBkWcUoklpanJueW2yoV5yYW1yal66XnJ+7iREY tduO/dy8g/HSxuBDjAIcjEo8vD94u+OFWBPLiitzDzFKcDArifA6nT0dJ8SbklhZlVqUH19U mpNafIjRFOi5icxSosn5wISSVxJvaGpobmFpaG5sbmxmoSTO2yFwMEZIID2xJDU7NbUgtQim j4mDU6qBMbp8XbgO5zLNv2e2RMjxXw+ZOP9Z4SbV5cZ3GGWdhS8o2b+XYf4e8fCzysPCypVy +3SZBP58qF2g/tmHe85xnz3zhUKcE//Okjm3mafM+A+jwtzFBy/fUf34OevtCq/VD2Ni+YqS 9zp/FJJay9ku269/tCfA8rXjjPmeMqeUhb/dt3B9Yp41U4mlOCPRUIu5qDgRAKc2fujwAgAA X-CMS-MailID: 20201018093711eucas1p1d4798e62686074c88bd2b917aa410d4b 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" Just to be clear, these are the changes that will fix v4: diff --git a/app/test/test_security.c b/app/test/test_security.c index 62e4991eb..060cf1ffa 100644 --- a/app/test/test_security.c +++ b/app/test/test_security.c @@ -395,7 +395,7 @@ mock_session_destroy(void *device, struct rte_security_session *sess)         void *sess_priv = get_sec_session_private_data(sess);         mock_session_destroy_exp.called++; -       if ((mock_session_create_exp.ret == 0) && (sess_priv != NULL)) { +       if ((mock_session_destroy_exp.ret == 0) && (sess_priv != NULL)) { rte_mempool_put(rte_mempool_from_obj(sess_priv), sess_priv);                 set_sec_session_private_data(sess, NULL);         } @@ -1501,6 +1501,7 @@ test_session_destroy_ops_failure(void)                         ret, -1, "%d");         TEST_ASSERT_MOCK_CALLS(mock_session_destroy_exp, 1);         TEST_ASSERT_MEMPOOL_USAGE(1); +       TEST_ASSERT_PRIV_MP_USAGE(1);         TEST_ASSERT_SESSION_COUNT(1);         return TEST_SUCCESS; Best regards Lukasz W dniu 18.10.2020 o 11:30, Lukasz Wojciechowski pisze: > 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