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 12D55A04DB; Sat, 17 Oct 2020 15:13:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5EBCCAC56; Sat, 17 Oct 2020 15:13:42 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id EA479A95C for ; Sat, 17 Oct 2020 15:13:41 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201017131330euoutp027db654ebcae7852da9b18c907bed4fc1~_yc9yNveC1118511185euoutp02g for ; Sat, 17 Oct 2020 13:13:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201017131330euoutp027db654ebcae7852da9b18c907bed4fc1~_yc9yNveC1118511185euoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602940410; bh=C1eRCIm3RniJOQ2CQ6j3ptbr4B8GAaUkJgRyVN6TEbY=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=rkQJvnTcVvTHNcY6gU4RKHkJiJIdMuS7tMX3EagsuXVlqIF/fSUOIi9IWU3IVFDBf OQW4F1tcNT+U3JVYNJ50lDMhhK4Id6o6eLCwad82d5zcPh68SOaLKY0o6eyU0KED40 OpfUalUuD9AA2JFshRG8nMt+D61sLPruB2AmQjqU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201017131324eucas1p19a8fa62d835545b2c84aa070370f1e3c~_yc4rGgm21895618956eucas1p1Z; Sat, 17 Oct 2020 13:13:24 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 9B.D1.06318.4FDEA8F5; Sat, 17 Oct 2020 14:13:24 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201017131324eucas1p2e32e4a549a07be3de6bcbe3f05fb63e5~_yc4E7gyP3126031260eucas1p2A; Sat, 17 Oct 2020 13:13:24 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201017131324eusmtrp1beba5fed9872f16c3c400a880da13100~_yc4EPdZK2532125321eusmtrp1Z; Sat, 17 Oct 2020 13:13:24 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-7e-5f8aedf40bc6 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DE.15.06017.3FDEA8F5; Sat, 17 Oct 2020 14:13:24 +0100 (BST) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201017131323eusmtip1a3b8b18b0fac9d60c2640f7350404b01~_yc3NWQcW1184911849eusmtip1d; Sat, 17 Oct 2020 13:13:23 +0000 (GMT) To: Akhil Goyal , dev@dpdk.org Cc: thomas@monjalon.net, mdr@ashroe.eu, anoobj@marvell.com, hemant.agrawal@nxp.com, konstantin.ananyev@intel.com, declan.doherty@intel.com, radu.nicolau@intel.com, david.coyle@intel.com, "\"'Lukasz Wojciechowski'\"," From: Lukasz Wojciechowski Message-ID: <7412297a-c289-3da9-3f15-7dfc5a818a88@partner.samsung.com> Date: Sat, 17 Oct 2020 15:13:21 +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: <20201017115010.17477-1-akhil.goyal@nxp.com> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0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XRcbWa0ePOgicXi3aftTBYrH29ks3j/ZxGLxbOedYwW/VuPsli0dQlYfHpwgsWB22P5uX5W j18LlrJ6LN7zkslj8sKLzB7Hbk5j99j4bgeTx8F3e5gC2KP0bIryS0tSFTLyi0tslaINLYz0 DC0t9IxMLPUMjc1jrYxMlfTtbFJSczLLUov07RL0MnYc+85UsEKg4vy2DpYGxiu8XYycHBIC JhJX33QydTFycQgJLGWU+HPzCGMXIwdQQkbiwyUBiBphiT/XuthAbCGB14wSG98GgdjCAtYS S2dfYwWxRQSMJTbsmskKModZoJFJovHQUUaIobsZJTY0fGQGqWITsJU4MvMrWAevgJvE7Mcn WEBsFgFViddfusHiogJxEj8m9rJB1AhKnJz5BKyGU8BSonnOGXYQm1nATGLe5ofMELa8xPa3 c6BscYlbT+YzTWAUmoWkfRaSlllIWmYhaVnAyLKKUSS1tDg3PbfYSK84Mbe4NC9dLzk/dxMj MGK3Hfu5ZQdj17vgQ4wCHIxKPLwbFnXGC7EmlhVX5h5ilOBgVhLhdTp7Ok6INyWxsiq1KD++ qDQntfgQoynQcxOZpUST84HJJK8k3tDU0NzC0tDc2NzYzEJJnLdD4GCMkEB6YklqdmpqQWoR TB8TB6dUA+OJ52nPeN2O77kc7CbLnaYQUnV465s4SV0tj/02igu2HPjpLPXC+geXPN/cLM7y R7MelLJ/2/Nl0a2bmTkaOq5bmG6G/1zm/fkS98sriXLbd/ftlljR8OnkyXNBjjKLrFnPzVtk qXlrhtDObc7Xpt+YMGnCnQa1ZIMvrO8WaZkHWUzyz/HocL6vxFKckWioxVxUnAgAKEW/bu4C AAA= X-CMS-MailID: 20201017131324eucas1p2e32e4a549a07be3de6bcbe3f05fb63e5 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> 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, 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 > + 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_exp, device); > MOCK_TEST_ASSERT_POINTER_PARAMETER(mock_session_destroy_exp, 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_destroy, > 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); > TEST_ASSERT_SESSION_COUNT(1); > > return TEST_SUCCESS; > } > -- Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 l.wojciechow@partner.samsung.com