HI Akhil,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Akhil Goyal <gak...@marvell.com>
> Sent: Thursday, May 18, 2023 12:17 PM
> To: Anoob Joseph <ano...@marvell.com>; Thomas Monjalon
> <tho...@monjalon.net>; Jerin Jacob Kollanukkaran <jer...@marvell.com>;
> Konstantin Ananyev <konstantin.v.anan...@yandex.ru>; Bernard
> Iremonger <bernard.iremon...@intel.com>
> Cc: Hemant Agrawal <hemant.agra...@nxp.com>; Mattias Rönnblom
> <mattias.ronnb...@ericsson.com>; Kiran Kumar Kokkilagadda
> <kirankum...@marvell.com>; Volodymyr Fialko <vfia...@marvell.com>;
> dev@dpdk.org; Olivier Matz <olivier.m...@6wind.com>
> Subject: RE: [PATCH v2 07/22] pdcp: add pre and post process for DL
> 
> >  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?

[Anoob] The check here allows registering different function pointers so that 
datapath checks are avoided. The level of optimization vs level of code 
complexity is the reason for delta. For DL, most of the code is the same and so 
we added const flags & allowed different functions to call with flags. For UL, 
the code had significant changes in both paths. Hence an extra top level check 
was okay.

> 
> > +           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

Reply via email to