On Wed, May 24, 2023 at 1:34 AM Akhil Goyal <[email protected]> wrote:
>
> Added ROC init and fini APIs for supporting MACsec.
>
> Signed-off-by: Ankur Dwivedi <[email protected]>
> Signed-off-by: Vamsi Attunuru <[email protected]>
> Signed-off-by: Akhil Goyal <[email protected]>
> ---
> +
> +TAILQ_HEAD(roc_mcs_head, roc_mcs);
> +/* Local mcs tailq list */
> +static struct roc_mcs_head roc_mcs_head =
> TAILQ_HEAD_INITIALIZER(roc_mcs_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 = roc_idev_mcs_get();
> + if (mcs) {
> + plt_info("Skipping device, mcs device already
> probed");
> + mcs->refcount++;
> + return mcs;
> + }
> + }
> +
> + mcs = 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 = -900,
> + MCS_ERR_HW_NOTSUP = -901,
> + MCS_ERR_DEVICE_NOT_FOUND = -902,
> +};
> +
> +#define MCS_SUPPORT_CHECK
> \
> + do {
> \
> + if (!(roc_model_is_cnf10kb() || roc_model_is_cn10kb_a0()))
> \
Use roc_feature_nix_has_macsec()