[PATCH v2 07/22] pdcp: add pre and post process for DL
Akhil Goyal
gakhil at marvell.com
Thu May 18 08:47:29 CEST 2023
> static int
> pdcp_pre_post_func_set(struct rte_pdcp_entity *entity, const struct
> rte_pdcp_entity_conf *conf)
> {
> + struct entity_priv *en_priv = entity_priv_get(entity);
> +
> entity->pre_process = NULL;
> entity->post_process = NULL;
>
> @@ -342,6 +756,13 @@ pdcp_pre_post_func_set(struct rte_pdcp_entity
> *entity, const struct rte_pdcp_ent
> entity->post_process = pdcp_post_process_ul;
> }
>
> + if ((conf->pdcp_xfrm.domain ==
> RTE_SECURITY_PDCP_MODE_CONTROL) &&
> + (conf->pdcp_xfrm.sn_size == RTE_SECURITY_PDCP_SN_SIZE_12) &&
> + (conf->pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_DOWNLINK)) {
> + entity->pre_process = pdcp_pre_process_cplane_sn_12_dl;
> + entity->post_process = pdcp_post_process_cplane_sn_12_dl;
> + }
> +
> if ((conf->pdcp_xfrm.domain == RTE_SECURITY_PDCP_MODE_DATA)
> &&
> (conf->pdcp_xfrm.sn_size == RTE_SECURITY_PDCP_SN_SIZE_12) &&
> (conf->pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_UPLINK)) {
> @@ -356,6 +777,38 @@ pdcp_pre_post_func_set(struct rte_pdcp_entity
> *entity, const struct rte_pdcp_ent
> entity->post_process = pdcp_post_process_ul;
> }
>
> + if ((conf->pdcp_xfrm.domain == RTE_SECURITY_PDCP_MODE_DATA)
> &&
> + (conf->pdcp_xfrm.sn_size == RTE_SECURITY_PDCP_SN_SIZE_12) &&
> + (conf->pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_DOWNLINK) &&
> + (en_priv->flags.is_authenticated)) {
is_authenticated is checked only in case of DL.
For UL, the check is there in the same function.
Can we have it consistent with UL?
> + entity->pre_process = pdcp_pre_process_uplane_sn_12_dl_ip;
> + entity->post_process =
> pdcp_post_process_uplane_sn_12_dl_ip;
> + }
> +
> + if ((conf->pdcp_xfrm.domain == RTE_SECURITY_PDCP_MODE_DATA)
> &&
> + (conf->pdcp_xfrm.sn_size == RTE_SECURITY_PDCP_SN_SIZE_12) &&
> + (conf->pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_DOWNLINK) &&
> + (!en_priv->flags.is_authenticated)) {
> + entity->pre_process = pdcp_pre_process_uplane_sn_12_dl;
> + entity->post_process = pdcp_post_process_uplane_sn_12_dl;
> + }
> +
> + if ((conf->pdcp_xfrm.domain == RTE_SECURITY_PDCP_MODE_DATA)
> &&
> + (conf->pdcp_xfrm.sn_size == RTE_SECURITY_PDCP_SN_SIZE_18) &&
> + (conf->pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_DOWNLINK) &&
> + (en_priv->flags.is_authenticated)) {
> + entity->pre_process = pdcp_pre_process_uplane_sn_18_dl_ip;
> + entity->post_process =
> pdcp_post_process_uplane_sn_18_dl_ip;
> + }
> +
> + if ((conf->pdcp_xfrm.domain == RTE_SECURITY_PDCP_MODE_DATA)
> &&
> + (conf->pdcp_xfrm.sn_size == RTE_SECURITY_PDCP_SN_SIZE_18) &&
> + (conf->pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_DOWNLINK) &&
> + (!en_priv->flags.is_authenticated)) {
> + entity->pre_process = pdcp_pre_process_uplane_sn_18_dl;
> + entity->post_process = pdcp_post_process_uplane_sn_18_dl;
> + }
> +
> if (entity->pre_process == NULL || entity->post_process == NULL)
> return -ENOTSUP;
>
> --
> 2.25.1
More information about the dev
mailing list