> -----Original Message----- > From: Amber, Kumar <kumar.am...@intel.com> > Sent: Friday, May 6, 2022 6:23 AM > To: ovs-dev@openvswitch.org > Cc: echau...@redhat.com; ktray...@redhat.com; i.maxim...@ovn.org; Ferriter, > Cian <cian.ferri...@intel.com>; Stokes, Ian <ian.sto...@intel.com>; > david.march...@redhat.com; f...@sysclose.org; Van Haaren, Harry > <harry.van.haa...@intel.com>; Amber, Kumar <kumar.am...@intel.com> > Subject: [PATCH v7 1/4] mfex_avx512: Calculate pkt offsets at compile time. > > The patch removes magic numbers pkt offsets and > minimum packet lenght and instead calculate it at > compile time. > > Signed-off-by: Kumar Amber <kumar.am...@intel.com> > --- > lib/dpif-netdev-extract-avx512.c | 28 ++++++++++++++++++++-------- > 1 file changed, 20 insertions(+), 8 deletions(-) > > diff --git a/lib/dpif-netdev-extract-avx512.c > b/lib/dpif-netdev-extract-avx512.c > index 6b6fe07db..6ae15a4db 100644 > --- a/lib/dpif-netdev-extract-avx512.c > +++ b/lib/dpif-netdev-extract-avx512.c > @@ -246,6 +246,16 @@ _mm512_maskz_permutexvar_epi8_wrap(__mmask64 > kmask, __m512i idx, __m512i a) > NC, NC, NC, NC, 0xBF, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, \ > NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC, NC > > +#define PKT_OFFSET_L2 (ETH_HEADER_LEN) > +#define PKT_OFFSET_L3_VLAN (ETH_HEADER_LEN + VLAN_HEADER_LEN)
VLAN is part of L2, so the naming convention here gets unclear...? It should be either L2_SIZE or L3_OFFSET. > +#define PKT_OFFSET_L4_IPv4 (ETH_HEADER_LEN + IP_HEADER_LEN) as a result of the above, here it looks like IP is L4? I think PKT_OFFSET_L3_IPV4 would be a clearer name here (as it's the L3 offset). <snip remaining, will review next version> > @@ -345,9 +355,9 @@ static const struct mfex_profile > mfex_profiles[PROFILE_COUNT] = > > .mf_bits = { 0x18a0000000000000, 0x0000000000040401}, > .dp_pkt_offs = { > - 0, UINT16_MAX, 14, 34, > + 0, UINT16_MAX, PKT_OFFSET_L2, PKT_OFFSET_L4_IPv4, Usage here is as follows: l2_pad_size, l2_5_ofs, l3_ofs, l4_ofs so 0, UINT16_MAX, PKT_L3_OFFSET, PKT_L4_OFFSET would be a nice set of defines to use. <snip> _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev