From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 809F9A059F;
	Fri, 10 Apr 2020 14:52:38 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 799141D554;
	Fri, 10 Apr 2020 14:52:37 +0200 (CEST)
Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com
 [209.85.208.194]) by dpdk.org (Postfix) with ESMTP id D23911D552
 for <dev@dpdk.org>; Fri, 10 Apr 2020 14:52:35 +0200 (CEST)
Received: by mail-lj1-f194.google.com with SMTP id m8so1876370lji.1
 for <dev@dpdk.org>; Fri, 10 Apr 2020 05:52:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=semihalf-com.20150623.gappssmtp.com; s=20150623;
 h=subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=FJA16lMzcxOGkFbJarft3O7cyT3sFc7aDwp6A95+IN8=;
 b=V1JPQoh090R8SNOsVmEFFRIISdih1Huz5gUSz8loIWaq7TFcjhahc1sLnrI8YRMxbq
 wSBXDYQINRfu6773Byel7iYA1eHhq9j3Qs+icQXAwZlWw6TKo33hPte9yiKOXQhHj21P
 luGiHf7QrE4aZWE9zPg1Ql850LZuvCpYHkw5Bui1lyN+hIATXyo75csJwb33P7Fcy3si
 UnIOQm5JOGxTtji50Lf61vAMPhRYguAK0GAUpQSVs6T26UjlfqsPhOw+EC9iYE5D6fBu
 bZfx0aUOcdHw1dpBOzSdy3RyXAxokZcAFQe3atzQd5p8CvKXidqohsUg11cUw+RsB+8N
 eIJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:cc:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=FJA16lMzcxOGkFbJarft3O7cyT3sFc7aDwp6A95+IN8=;
 b=mchYMFG4KsSNKenyuU5u5ldBjw8/QqVYZXBnWsTtmFEDfJHYuVe69AGH2//OtOkZ26
 /SGPqPmYEqGDQNrFbkheM22quSVP4vOFDuam3WzzkyLOL5Kpvuc+1ij12AW+8h48Uy5c
 x9tJGWu/vfuVunFUuxqNj3+f50D9QkNIt4JoPqHxEi1K5YJnkBX1LcXNiRseM6X92AWm
 OYiLiWne094lnieyqeBXsCjHBJZ7gygFku/+7l/uT32IrWMghKmFD1+dXVZ5SBm5yQF+
 PiYF4yAYLOwZvbMd9w+mumYDtGwuK+a6MwSB7A7vXgqu698Rrr/oiHeljAKuQxHWAQTu
 yZuA==
X-Gm-Message-State: AGi0Puacbdc4itMRbT10D9CZAXDViPyldR/1O5GmKvUVqZA1EYGERaS6
 X5Islm3WBeYDYZ7kZ3R0uoh+L3lIjro=
X-Google-Smtp-Source: APiQypJpClEHDR4Ymn8aKKdXXYr9cXceVoe0MF/BUieav2GHZLKrnknjppFTDwmJzGlRihSvu8PXXQ==
X-Received: by 2002:a05:651c:552:: with SMTP id
 q18mr3086502ljp.1.1586523155097; 
 Fri, 10 Apr 2020 05:52:35 -0700 (PDT)
Received: from [192.168.8.100] (user-5-173-33-152.play-internet.pl.
 [5.173.33.152])
 by smtp.gmail.com with ESMTPSA id e1sm1036538ljo.16.2020.04.10.05.52.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Apr 2020 05:52:34 -0700 (PDT)
To: Nithin Dabilpuram <ndabilpuram@marvell.com>
Cc: dev@dpdk.org
References: <20200331192945.2466880-1-jerinj@marvell.com>
 <20200405085613.1336841-1-jerinj@marvell.com>
 <20200405085613.1336841-19-jerinj@marvell.com>
 <b0c60082-37d2-fa26-6920-aad0103386c7@semihalf.com>
 <20200410050944.GA17335@outlook.office365.com>
From: Andrzej Ostruszka <amo@semihalf.com>
Message-ID: <af77b3fc-cb00-5d82-a8a9-9149d6882c7a@semihalf.com>
Date: Fri, 10 Apr 2020 14:52:33 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Firefox/68.0 Thunderbird/68.4.1
MIME-Version: 1.0
In-Reply-To: <20200410050944.GA17335@outlook.office365.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH v4 18/29] node: add ethdev Rx and Tx node
 ctrl API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 4/10/20 7:09 AM, Nithin Dabilpuram wrote:
> On Fri, Apr 10, 2020 at 01:07:17AM +0200, Andrzej Ostruszka wrote:
[...]
>>> +struct rte_node_mbuf_priv2 {
>>> +	union {
>>> +		/* Sym crypto */
>>> +		struct {
>>> +			struct rte_crypto_op op;
>>> +		};
>>> +	};
>>> +} __rte_cache_aligned;
>>
>> Why such definition?

The question was more on "technicalities" - you have struct with anon
union with anon struct with a struct.  Why such deep nesting - I guess
the union is there for the possible future extensions but the next anon
struct - what is it for?

> For communication b/w nodes, we need some per mbuf private space.
> We defined it into two halfs for performance reasons as
> #1 rte_node_mbuf_priv1(8 bytes) mapped to mbuf->udata64
> #2 rte_node_mbuf_priv2(RTE_CACHE_LINE_SIZE bytes) mapped to mbuf private area.
> 
> #1 is smaller area and will not have a cache miss when accessed as mbuf
> is already in cache.
> #2 is larger area and probably good enough for many use cases like ipsec, crypto 
> etc, and there will be an extra cost of cache miss to access it.
> 
> Atleast in OCTEONTX2, we are able to see 27% performance drop, if use single
> private area #2 for everything instead.
> 
> Since pkt_mbuf pool are created by application, we these structures are defined
> here have a check in ctrl api if the pkt_mbuf pool meets the mbuf private area
> size requirement.

Thank you for explanations.

With regards
Andrzej Ostruszka