Make the simple match functions used during lookup non-static to allow
reuse of these functions in the AVX512 DPIF.

Signed-off-by: Cian Ferriter <cian.ferri...@intel.com>
Tested-by: Harry van Haaren <harry.van.haa...@intel.com>

---
v2:
* Make the 3 simple match lookup function definitions non-static rather
  than moving the defitions to the lib/dpif-netdev-private-dpif.c file.
  This allows the compiler continue to inline the functions in the
  scalar DPIF (dp_netdev_input__) if it wants.
---
 lib/dpif-netdev-private-dpif.h | 12 ++++++++++++
 lib/dpif-netdev.c              | 11 +++--------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/lib/dpif-netdev-private-dpif.h b/lib/dpif-netdev-private-dpif.h
index 3e38630f5..cf331cec7 100644
--- a/lib/dpif-netdev-private-dpif.h
+++ b/lib/dpif-netdev-private-dpif.h
@@ -61,6 +61,18 @@ dp_netdev_input_func dp_netdev_impl_get_default(void);
 /* Overrides the default DPIF with the user set DPIF. */
 int32_t dp_netdev_impl_set_default_by_name(const char *name);
 
+bool
+dp_netdev_simple_match_enabled(const struct dp_netdev_pmd_thread *pmd,
+                               odp_port_t in_port);
+
+uint64_t
+dp_netdev_simple_match_mark(odp_port_t in_port, ovs_be16 dl_type,
+                            uint8_t nw_frag, ovs_be16 vlan_tci);
+struct dp_netdev_flow *
+dp_netdev_simple_match_lookup(const struct dp_netdev_pmd_thread *pmd,
+                              odp_port_t in_port, ovs_be16 dl_type,
+                              uint8_t nw_frag, ovs_be16 vlan_tci);
+
 /* Available DPIF implementations below. */
 int32_t
 dp_netdev_input(struct dp_netdev_pmd_thread *pmd,
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index d09138f2c..ad2c89dbf 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -639,11 +639,6 @@ static void dp_netdev_simple_match_remove(struct 
dp_netdev_pmd_thread *pmd,
     OVS_REQUIRES(pmd->flow_mutex);
 
 static bool dp_netdev_flow_is_simple_match(const struct match *);
-static bool dp_netdev_simple_match_enabled(const struct dp_netdev_pmd_thread *,
-                                           odp_port_t in_port);
-static struct dp_netdev_flow *dp_netdev_simple_match_lookup(
-    const struct dp_netdev_pmd_thread *,
-    odp_port_t in_port, ovs_be16 dp_type, uint8_t nw_frag, ovs_be16 vlan_tci);
 
 /* Updates the time in PMD threads context and should be called in three cases:
  *
@@ -3873,7 +3868,7 @@ dp_netdev_get_mega_ufid(const struct match *match, 
ovs_u128 *mega_ufid)
     odp_flow_key_hash(&masked_flow, sizeof masked_flow, mega_ufid);
 }
 
-static uint64_t
+uint64_t
 dp_netdev_simple_match_mark(odp_port_t in_port, ovs_be16 dl_type,
                             uint8_t nw_frag, ovs_be16 vlan_tci)
 {
@@ -3913,7 +3908,7 @@ dp_netdev_simple_match_mark(odp_port_t in_port, ovs_be16 
dl_type,
            | (OVS_FORCE uint16_t) (vlan_tci & htons(VLAN_VID_MASK | VLAN_CFI));
 }
 
-static struct dp_netdev_flow *
+struct dp_netdev_flow *
 dp_netdev_simple_match_lookup(const struct dp_netdev_pmd_thread *pmd,
                               odp_port_t in_port, ovs_be16 dl_type,
                               uint8_t nw_frag, ovs_be16 vlan_tci)
@@ -3934,7 +3929,7 @@ dp_netdev_simple_match_lookup(const struct 
dp_netdev_pmd_thread *pmd,
     return found ? flow : NULL;
 }
 
-static bool
+bool
 dp_netdev_simple_match_enabled(const struct dp_netdev_pmd_thread *pmd,
                                odp_port_t in_port)
 {
-- 
2.25.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to