From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id EB3B142BA9;
	Fri, 26 May 2023 11:30:15 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id C1E6540DDA;
	Fri, 26 May 2023 11:30:15 +0200 (CEST)
Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com
 [209.85.222.54]) by mails.dpdk.org (Postfix) with ESMTP id 1ECCB40A89
 for <dev@dpdk.org>; Fri, 26 May 2023 11:30:15 +0200 (CEST)
Received: by mail-ua1-f54.google.com with SMTP id
 a1e0cc1a2514c-786e37900fbso51507241.1
 for <dev@dpdk.org>; Fri, 26 May 2023 02:30:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1685093414; x=1687685414;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=QwOTpVGt4EtSvxZQ8x/iJGM9g8fO7nd8k5W9N1Py7L0=;
 b=nLzIg7r5ciJaDy6pZxyj3Dar2cLHIXBJy4FPVGMEarqxjr9aQ6g49SILwrkfxDj3rB
 zhedEptnYgIeUsH6i/V9hv8Amx9U3oyTjuHnH1iP5RPf0Hve0fGiVPBWwP87f6XIsvy7
 65UHYKqy5wx6MO7OmM1FeVGq2WWQ66kHho0/8wH62Ihpk3yYCX70/kDhGvOGexxPEchN
 l+IFC2UAq3gOy8edKo+Jo+2xkLLX5OrBGACQ7IyIXpO5PmxlV2K3018tKmeiaIP9ily3
 gFIk670svqA+On/3/Tdv6RzRIPOe9huulY9ipIHkgUux70u1KCxdBBMzTp9eaU5PZSSa
 CRlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1685093414; x=1687685414;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=QwOTpVGt4EtSvxZQ8x/iJGM9g8fO7nd8k5W9N1Py7L0=;
 b=PmdARuiN8IUwcQP72nodEO4FHaBuBhKJ56JmQNRxwmgNXF6RxVnmIWCCINnRkItGWd
 GjRaztx1JFrfQbRHaOXWjAcrI0pYKCuXbCreFQw4MgZqspagHOw8tv5m+EjCPoYSsVxs
 8VQTLazBJf637+Rph6SFZqR8WHN2ODMiuZvzA1NYsm6MnzIDmjqEvO64xyUBM4G4sRcD
 ElhieGAG078sFCaSt+FQ3lDjnnTHD47Zmbn+tkJD1cS5oBrNkQmutyw+RQy7WRbbh8MA
 RQzDa8Etxh7RXds8iETUN+mdJDaa6ClE44MPJxo967txw0QNdV9FesMfz/+/HV/TrQp+
 pJKw==
X-Gm-Message-State: AC+VfDxjL2VMSPhtTsuRCS0SIxtl2J5oTbR/olRyN9P2wA7t9+v3yuWf
 ay2cb3J6ppXmaynYV0I4U3TrMkes9nF1ACsNGWE=
X-Google-Smtp-Source: ACHHUZ7NqO+Tu2bdSSnyRYHOn/s44mw/dPmkbp3h5bjKwhbAfKZKau9uG81fHJ7OI5L+gqw0BcpLjD4VaY73jI4q+DM=
X-Received: by 2002:a05:6102:356f:b0:435:ff1a:8738 with SMTP id
 bh15-20020a056102356f00b00435ff1a8738mr250083vsb.34.1685093414352; Fri, 26
 May 2023 02:30:14 -0700 (PDT)
MIME-Version: 1.0
References: <20220928124516.93050-1-gakhil@marvell.com>
 <20230523200401.1945974-1-gakhil@marvell.com>
 <20230523200401.1945974-2-gakhil@marvell.com>
In-Reply-To: <20230523200401.1945974-2-gakhil@marvell.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Fri, 26 May 2023 14:59:48 +0530
Message-ID: <CALBAE1OcYVHsytAsie3D3=UF=4bdiifNCcq5Nqsd=TBYH=kzhg@mail.gmail.com>
Subject: Re: [PATCH 01/15] common/cnxk: add ROC MACsec initialization
To: Akhil Goyal <gakhil@marvell.com>
Cc: dev@dpdk.org, thomas@monjalon.net, olivier.matz@6wind.com, 
 orika@nvidia.com, david.marchand@redhat.com, vattunuru@marvell.com, 
 ferruh.yigit@amd.com, jerinj@marvell.com, adwivedi@marvell.com, 
 ndabilpuram@marvell.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
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

On Wed, May 24, 2023 at 1:34=E2=80=AFAM Akhil Goyal <gakhil@marvell.com> wr=
ote:
>
> Added ROC init and fini APIs for supporting MACsec.
>
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
> +
> +TAILQ_HEAD(roc_mcs_head, roc_mcs);
> +/* Local mcs tailq list */
> +static struct roc_mcs_head roc_mcs_head =3D TAILQ_HEAD_INITIALIZER(roc_m=
cs_head);

Can we remove this global variable by moving? This is to avoid
breaking multiprocess,


> +struct roc_mcs *
> +roc_mcs_dev_init(uint8_t mcs_idx)
> +{
> +       struct roc_mcs *mcs;
> +       struct npa_lf *npa;
> +
> +       if (roc_model_is_cn10kb()) {


Use roc_feature_nix_has_macsec()

> +               mcs =3D roc_idev_mcs_get();
> +               if (mcs) {
> +                       plt_info("Skipping device, mcs device already pro=
bed");
> +                       mcs->refcount++;
> +                       return mcs;
> +               }
> +       }
> +
> +       mcs =3D plt_zmalloc(sizeof(struct roc_mcs), PLT_CACHE_LINE_SIZE);
> +       if (!mcs)
> +               return NULL;
> +
> +       if (roc_model_is_cnf10kb() || roc_model_is_cn10kb()) {

Use roc_feature_nix_has_macsec()


> +       MCS_ERR_PARAM =3D -900,
> +       MCS_ERR_HW_NOTSUP =3D -901,
> +       MCS_ERR_DEVICE_NOT_FOUND =3D -902,
> +};
> +
> +#define MCS_SUPPORT_CHECK                                               =
                           \
> +       do {                                                             =
                          \
> +               if (!(roc_model_is_cnf10kb() || roc_model_is_cn10kb_a0())=
)                         \

Use roc_feature_nix_has_macsec()