Hi, I see this patch is already merged in next-net-intel, but please I would prefer to have below improvements first.
07/11/2019 11:44, Haiyue Wang: > The original design is to use rte_mbuf::udata64 to save the metadata of > protocol extraction which has network protocol data fields and type, a > private API is used to decode this metadata. > > Use the dynamic mbuf field and flags to register the needed fields in > mbuf, to avoid overwriting 'rte_mbuf::udata64' if the application uses > it. It only needs 4B size to save the protocol extraction data, and its Yes using a dynamic field is definitely more correct. > type and validity is indicated by related bit in 'rte_mbuf::ol_flags'. Better to say explicitly it uses a dynamic flag. > --- a/drivers/net/ice/rte_pmd_ice.h > +++ b/drivers/net/ice/rte_pmd_ice.h > +/** > + * @file rte_pmd_ice.h > + * > + * ice PMD specific functions. > + * > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + */ Adding the file in doxygen is good. I think it could be a separate patch for doxygen + cleanups. > +/** > + * The supported network protocol extraction metadata format. > + */ > +union proto_xtr_metadata { > -struct proto_xtr_flds { Please add a prefix rte_ice_ or rte_net_ice_ as you wish. [...] > +/** > + * The mbuf dynamic flag for VLAN protocol extraction metadata, it is valid > + * when dev_args 'proto_xtr' has 'vlan' specified. > + */ > +#define PKT_RX_DYNF_PROTO_XTR_VLAN \ > + (rte_net_ice_dynflag_proto_xtr_vlan_mask) > + > +/** > + * The mbuf dynamic flag for IPv4 protocol extraction metadata, it is valid > + * when dev_args 'proto_xtr' has 'ipv4' specified. > + */ > +#define PKT_RX_DYNF_PROTO_XTR_IPV4 \ > + (rte_net_ice_dynflag_proto_xtr_ipv4_mask) > + > +/** > + * The mbuf dynamic flag for IPv6 protocol extraction metadata, it is valid > + * when dev_args 'proto_xtr' has 'ipv6' specified. > + */ > +#define PKT_RX_DYNF_PROTO_XTR_IPV6 \ > + (rte_net_ice_dynflag_proto_xtr_ipv6_mask) > + > +/** > + * The mbuf dynamic flag for IPv6 with flow protocol extraction metadata, it > is > + * valid when dev_args 'proto_xtr' has 'ipv6_flow' specified. > + */ > +#define PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW \ > + (rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask) > + > +/** > + * The mbuf dynamic flag for TCP protocol extraction metadata, it is valid > + * when dev_args 'proto_xtr' has 'tcp' specified. > + */ > +#define PKT_RX_DYNF_PROTO_XTR_TCP \ > + (rte_net_ice_dynflag_proto_xtr_tcp_mask) Those fields and flags are missing a RTE_ prefix. (Yes I know we are missing such prefix in rte_mbuf.f)