[PATCH 01/15] common/cnxk: add ROC MACsec initialization
Jerin Jacob
jerinjacobk at gmail.com
Fri May 26 11:29:48 CEST 2023
On Wed, May 24, 2023 at 1:34 AM Akhil Goyal <gakhil at marvell.com> wrote:
>
> Added ROC init and fini APIs for supporting MACsec.
>
> Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
> Signed-off-by: Vamsi Attunuru <vattunuru at marvell.com>
> Signed-off-by: Akhil Goyal <gakhil at marvell.com>
> ---
> +
> +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()
More information about the dev
mailing list