DPDK patches and discussions
 help / color / Atom feed
From: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
To: Akhil Goyal <akhil.goyal@nxp.com>, "dev@dpdk.org" <dev@dpdk.org>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"anoobj@marvell.com" <anoobj@marvell.com>,
	"konstantin.ananyev@intel.com" <konstantin.ananyev@intel.com>
Cc: "mdr@ashroe.eu" <mdr@ashroe.eu>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	"declan.doherty@intel.com" <declan.doherty@intel.com>,
	"radu.nicolau@intel.com" <radu.nicolau@intel.com>,
	"david.coyle@intel.com" <david.coyle@intel.com>,
	"\"'Lukasz Wojciechowski'\"," <l.wojciechow@partner.samsung.com>
Subject: Re: [dpdk-dev] [PATCH v4] security: update session create API
Date: Sun, 18 Oct 2020 11:37:09 +0200
Message-ID: <bd3b2d31-8a45-74e9-1434-bfc3bffc470e@partner.samsung.com> (raw)
In-Reply-To: <aa238dc0-f125-fa80-b9e0-5a5f18ebf532@partner.samsung.com>

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
>>>
>>> <snip>
>>>> 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);
>>> <snip>
>>>> @@ -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


  reply index

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200903201022eucas1p19a5154b9fb7063f72b18dea1114eeed3@eucas1p1.samsung.com>
2020-09-03 20:09 ` [dpdk-dev] [PATCH] " akhil.goyal
2020-09-04 16:04   ` Lukasz Wojciechowski
2020-10-10 22:09     ` Akhil Goyal
2020-09-24 16:22   ` Coyle, David
2020-10-10 22:06     ` Akhil Goyal
2020-10-10 22:11   ` [dpdk-dev] [PATCH v2] " Akhil Goyal
2020-10-12 17:46     ` Akhil Goyal
2020-10-13  2:12     ` Lukasz Wojciechowski
2020-10-14 19:00       ` Akhil Goyal
2020-10-15  1:14         ` Lukasz Wojciechowski
2020-10-14 18:56     ` [dpdk-dev] [PATCH v3] " Akhil Goyal
2020-10-15  1:11       ` Lukasz Wojciechowski
2020-10-17 11:50       ` [dpdk-dev] [PATCH v4] " Akhil Goyal
2020-10-17 13:13         ` Lukasz Wojciechowski
2020-10-18  8:47           ` Akhil Goyal
2020-10-18  9:30             ` Lukasz Wojciechowski
2020-10-18  9:37               ` Lukasz Wojciechowski [this message]
2020-10-18  9:42               ` Akhil Goyal
2020-10-18  9:40         ` [dpdk-dev] [PATCH v5] " Akhil Goyal
2020-10-18 11:03           ` Lukasz Wojciechowski
2020-10-19  7:51             ` Thomas Monjalon

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd3b2d31-8a45-74e9-1434-bfc3bffc470e@partner.samsung.com \
    --to=l.wojciechow@partner.samsung.com \
    --cc=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=david.coyle@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=radu.nicolau@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox