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 03B7DA04F1;
	Mon,  9 Dec 2019 09:02:19 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id DE8B41B13C;
	Mon,  9 Dec 2019 09:02:18 +0100 (CET)
Received: from mail-io1-f68.google.com (mail-io1-f68.google.com
 [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 70C595B3C
 for <dev@dpdk.org>; Mon,  9 Dec 2019 09:02:17 +0100 (CET)
Received: by mail-io1-f68.google.com with SMTP id z23so13688714iog.11
 for <dev@dpdk.org>; Mon, 09 Dec 2019 00:02:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=W1PjavuV8YssJ4mpF9co6bWcQuCmRyJmx2cfGkpY2zk=;
 b=AOBmoSpODcESBQcseW2KwpD4TaVTjKOla1VTaPiSsbXj1UR5JzhClR45AhpdFHkJ1g
 wf4U4T2eFODmeQz3VBwAj7uYI+rgq+GFjir5iYFztLhB7KenOxM1zxexViVKFutxBJNX
 N9MUXJVwdjmyvKeLAXCQZ/U4DnH+Ei4B8xJ5YPM+BGqxhwU8T2BOspM2uEBALp2SsYLo
 03LxXopmsUs6wIxUbj9SHl48G8HH0t/T3fZZRYWcpPBamebV74zmYEW3y92jjwjAJfFW
 FMxDYlGR9Of4K7LUPLAYNihWA9rRPX734LiGAJefCAO76sxb8UFh5OLKzA+ZEaC+k2q4
 jG9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=W1PjavuV8YssJ4mpF9co6bWcQuCmRyJmx2cfGkpY2zk=;
 b=KRONgHTqgGvClP9JTUua6Yizx2XN7BL54jcmHG8bEwrderejObtqFRTrJKB8hPuveF
 yFS1BIjojZ5ocWACacQf9igtAa3C08rNcZfBpGsGzr7m+xdlt21d8YrQnVlkXrR5lyDL
 fJSaRnAhh2MEIvg9i0FR1cJjorQ+Zfcj8EpQSOje3xN9q7h+6v7dej2JBpT55OiZVBn2
 Vpxyw0PJsO9OGaF5xzts9G5F68KShLWrY4usCip8JzSTfzhdH5dRednphhSSsHQ4WX1E
 HmMP8bbagqsIMUY0K2smdOWQz3P33XbGWMlg3BLxQtFSVJdlojb8VIFrQt4iJ6EFgK89
 xtmA==
X-Gm-Message-State: APjAAAW5JdN4t8Ud5sMqmOzxaX2JiRRscOit+0fEhUwofcWF29nldDpB
 pV1ik/Vzt/hVmygMXvV4i5rM22VEWlBoMQZ1Un8=
X-Google-Smtp-Source: APXvYqwiMcpnkK0WfFldq+geL3UUNBRN6qB+0TH5YYi0MF5yekF1PQq0pf1KGPsz90OIasi4pdUq+Wixt5Ll6nttKFI=
X-Received: by 2002:a5d:8056:: with SMTP id b22mr18919482ior.60.1575878536592; 
 Mon, 09 Dec 2019 00:02:16 -0800 (PST)
MIME-Version: 1.0
References: <1575806094-28391-1-git-send-email-anoobj@marvell.com>
 <1575806094-28391-11-git-send-email-anoobj@marvell.com>
In-Reply-To: <1575806094-28391-11-git-send-email-anoobj@marvell.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Mon, 9 Dec 2019 13:32:00 +0530
Message-ID: <CALBAE1OqQ1OR5YpshRy4rKbmjHhZ5OUoKvq4=OqaR1CFAk6ABg@mail.gmail.com>
To: Anoob Joseph <anoobj@marvell.com>
Cc: Akhil Goyal <akhil.goyal@nxp.com>,
 Declan Doherty <declan.doherty@intel.com>, 
 Thomas Monjalon <thomas@monjalon.net>, Archana Muniganti <marchana@marvell.com>,
 Jerin Jacob <jerinj@marvell.com>, Narayana Prasad <pathreya@marvell.com>, 
 Kiran Kumar K <kirankumark@marvell.com>,
 Nithin Dabilpuram <ndabilpuram@marvell.com>, 
 Pavan Nikhilesh <pbhagavatula@marvell.com>,
 Ankur Dwivedi <adwivedi@marvell.com>, 
 Tejasree Kondoj <ktejasree@marvell.com>, Vamsi Attunuru <vattunuru@marvell.com>,
 Lukasz Bartosik <lbartosik@marvell.com>, dpdk-dev <dev@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH 10/15] crypto/octeontx2: add lookup mem
 changes to hold sa indices
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 Sun, Dec 8, 2019 at 5:27 PM Anoob Joseph <anoobj@marvell.com> wrote:
>
> From: Archana Muniganti <marchana@marvell.com>
>
> lookup_mem provides fast accessing of data path fields.
> Storing sa indices in lookup_mem which are required in
> inline rx data path.
>
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Signed-off-by: Archana Muniganti <marchana@marvell.com>
> Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
> ---
>  drivers/common/octeontx2/otx2_common.h   | 20 +++++++++++
>  drivers/crypto/octeontx2/otx2_security.c | 59 +++++++++++++++++++++++++++++++-
>  drivers/net/octeontx2/otx2_lookup.c      |  9 +----
>  drivers/net/octeontx2/otx2_rx.h          | 10 ++----
>  4 files changed, 81 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/common/octeontx2/otx2_common.h b/drivers/common/octeontx2/otx2_common.h
> index 9705a8d..6456c4b 100644
> --- a/drivers/common/octeontx2/otx2_common.h
> +++ b/drivers/common/octeontx2/otx2_common.h
> @@ -170,4 +170,24 @@ extern int otx2_logtype_dpi;
>  #include "otx2_io_generic.h"
>  #endif
>
> +/* Fastpath lookup */
> +#define OTX2_NIX_FASTPATH_LOOKUP_MEM "otx2_nix_fastpath_lookup_mem"
> +#define PTYPE_NON_TUNNEL_WIDTH         16
> +#define PTYPE_TUNNEL_WIDTH             12
> +#define PTYPE_NON_TUNNEL_ARRAY_SZ      BIT(PTYPE_NON_TUNNEL_WIDTH)
> +#define PTYPE_TUNNEL_ARRAY_SZ          BIT(PTYPE_TUNNEL_WIDTH)
> +#define PTYPE_ARRAY_SZ                 ((PTYPE_NON_TUNNEL_ARRAY_SZ +\
> +                                        PTYPE_TUNNEL_ARRAY_SZ) *\
> +                                        sizeof(uint16_t))
> +
> +/* NIX_RX_PARSE_S's ERRCODE + ERRLEV (12 bits) */
> +#define ERRCODE_ERRLEN_WIDTH           12
> +#define ERR_ARRAY_SZ                   ((BIT(ERRCODE_ERRLEN_WIDTH)) *\
> +                                       sizeof(uint32_t))
> +
> +#define PORT_ARRAY_SZ                  (RTE_MAX_ETHPORTS * sizeof(uint64_t))
> +
> +#define LOOKUP_ARRAY_SZ                        (PTYPE_ARRAY_SZ + ERR_ARRAY_SZ +\
> +                                       PORT_ARRAY_SZ)
> +

All these defines are not relevant to common code, But I understand
the security code needs
PORT_ARRAY_START

Please rector the logic to the following or similar way to keep the
lookup constants internal.

#define OTX2_PORT_ARRAY_START value

in otx2_nix_fastpath_lookup_mem_get()

RTE_BUILD_BUG_ON(OTX2_PORT_ARRAY_START != PTYPE_ARRAY_SZ + ERR_ARRAY_SZ)