@@ -191,7 +191,8 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
miniflow_extract_func mfex_func;
atomic_read_relaxed(&pmd->miniflow_extract_opt, &mfex_func);
if (mfex_func) {
- mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd);
+ mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd,
+ md_is_valid);
}
}
@@ -744,6 +744,7 @@ mfex_avx512_process(struct dp_packet_batch *packets,
uint32_t keys_size OVS_UNUSED,
odp_port_t in_port,
void *pmd_handle OVS_UNUSED,
+ bool md_is_valid OVS_UNUSED,
const enum MFEX_PROFILES profile_id,
const uint32_t use_vbmi OVS_UNUSED)
{
@@ -978,10 +979,10 @@ __attribute__((__target__("avx512vbmi"))) \
mfex_avx512_vbmi_##name(struct dp_packet_batch *packets, \
struct netdev_flow_key *keys, uint32_t keys_size,\
odp_port_t in_port, struct dp_netdev_pmd_thread \
- *pmd_handle) \
+ *pmd_handle, bool md_is_valid) \
{ \
return mfex_avx512_process(packets, keys, keys_size, in_port, \
- pmd_handle, profile, 1); \
+ pmd_handle, md_is_valid, profile, 1); \
}
#else
#define VBMI_MFEX_FUNC(name, profile)
@@ -992,10 +993,10 @@ uint32_t \
mfex_avx512_##name(struct dp_packet_batch *packets, \
struct netdev_flow_key *keys, uint32_t keys_size, \
odp_port_t in_port, struct dp_netdev_pmd_thread \
- *pmd_handle) \
+ *pmd_handle, bool md_is_valid) \
{ \
return mfex_avx512_process(packets, keys, keys_size, in_port, \
- pmd_handle, profile, 0); \
+ pmd_handle, md_is_valid, profile, 0); \
}
#define DECLARE_MFEX_FUNC(name, profile) \
@@ -71,7 +71,8 @@ uint32_t
mfex_study_traffic(struct dp_packet_batch *packets,
struct netdev_flow_key *keys,
uint32_t keys_size, odp_port_t in_port,
- struct dp_netdev_pmd_thread *pmd_handle)
+ struct dp_netdev_pmd_thread *pmd_handle,
+ bool md_is_valid)
{
uint32_t hitmask = 0;
uint32_t mask = 0;
@@ -90,7 +91,8 @@ mfex_study_traffic(struct dp_packet_batch *packets,
}
hitmask = miniflow_funcs[i].extract_func(packets, keys, keys_size,
- in_port, pmd_handle);
+ in_port, pmd_handle,
+ md_is_valid);
stats->impl_hitcount[i] += count_1bits(hitmask);
/* If traffic is not classified then we dont overwrite the keys
@@ -342,7 +342,8 @@ uint32_t
dpif_miniflow_extract_autovalidator(struct dp_packet_batch *packets,
struct netdev_flow_key *keys,
uint32_t keys_size, odp_port_t in_port,
- struct dp_netdev_pmd_thread *pmd_handle)
+ struct dp_netdev_pmd_thread *pmd_handle,
+ bool md_is_valid)
{
const size_t cnt = dp_packet_batch_size(packets);
uint16_t good_l2_5_ofs[NETDEV_MAX_BURST];
@@ -387,7 +388,8 @@ dpif_miniflow_extract_autovalidator(struct dp_packet_batch *packets,
/* Call optimized miniflow for each batch of packet. */
uint32_t hit_mask = mfex_impls[j].extract_func(packets, test_keys,
keys_size, in_port,
- pmd_handle);
+ pmd_handle,
+ md_is_valid);
/* Do a miniflow compare for bits, blocks and offsets for all the
* classified packets in the hitmask marked by set bits. */
@@ -36,7 +36,8 @@ typedef uint32_t (*miniflow_extract_func)(struct dp_packet_batch *batch,
uint32_t keys_size,
odp_port_t in_port,
struct dp_netdev_pmd_thread
- *pmd_handle);
+ *pmd_handle,
+ bool md_is_valid);
/* The function pointer miniflow_extract_func depends on batch size. */
@@ -188,7 +189,8 @@ uint32_t
dpif_miniflow_extract_autovalidator(struct dp_packet_batch *batch,
struct netdev_flow_key *keys,
uint32_t keys_size, odp_port_t in_port,
- struct dp_netdev_pmd_thread *pmd_handle);
+ struct dp_netdev_pmd_thread *pmd_handle,
+ bool md_is_valid);
/* Retrieve the number of packets by studying packets using different miniflow
* implementations to choose the best implementation using the maximum hitmask
@@ -200,7 +202,8 @@ uint32_t
mfex_study_traffic(struct dp_packet_batch *packets,
struct netdev_flow_key *keys,
uint32_t keys_size, odp_port_t in_port,
- struct dp_netdev_pmd_thread *pmd_handle);
+ struct dp_netdev_pmd_thread *pmd_handle,
+ bool md_is_valid);
/* Sets the packet count from user to the stats for use in
* study function to match against the classified packets to choose
@@ -219,12 +222,12 @@ mfex_set_study_pkt_cnt(uint32_t pkt_cmp_count, const char *name);
mfex_avx512_vbmi_##name(struct dp_packet_batch *packets, \
struct netdev_flow_key *keys, uint32_t keys_size,\
odp_port_t in_port, struct dp_netdev_pmd_thread \
- *pmd_handle); \
+ *pmd_handle, bool md_is_valid); \
uint32_t \
mfex_avx512_##name(struct dp_packet_batch *packets, \
struct netdev_flow_key *keys, uint32_t keys_size, \
odp_port_t in_port, struct dp_netdev_pmd_thread \
- *pmd_handle); \
+ *pmd_handle, bool md_is_valid); \
DECLARE_AVX512_MFEX_PROTOTYPE(ip_udp);
DECLARE_AVX512_MFEX_PROTOTYPE(ip_tcp);
The md_is_valid parameter is passed from DPIF to MFEX to allow mfex functions to detect the tunneling and decide the processing of Inner packets in static predictable branches. Signed-off-by: Kumar Amber <kumar.amber@intel.com> --- lib/dpif-netdev-avx512.c | 3 ++- lib/dpif-netdev-extract-avx512.c | 9 +++++---- lib/dpif-netdev-extract-study.c | 6 ++++-- lib/dpif-netdev-private-extract.c | 6 ++++-- lib/dpif-netdev-private-extract.h | 13 ++++++++----- 5 files changed, 23 insertions(+), 14 deletions(-)