[ovs-dev] [PATCH v2 3/3] netdev-rte-offloads: Rename netdev_dpdk_* functions

Ophir Munk ophirmu at mellanox.com
Thu Feb 21 12:07:50 UTC 2019


Rename all the netdev_dpdk_* functions names (originated from the file
netdev-dpdk.c) into the netdev_rte_offloads_* functions names.

Signed-off-by: Ophir Munk <ophirmu at mellanox.com>
---
 lib/netdev-rte-offloads.c | 39 ++++++++++++++++++++-------------------
 lib/netdev-rte-offloads.h | 17 +++++++++--------
 2 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/lib/netdev-rte-offloads.c b/lib/netdev-rte-offloads.c
index 0212156..d87a8c4 100644
--- a/lib/netdev-rte-offloads.c
+++ b/lib/netdev-rte-offloads.c
@@ -382,12 +382,12 @@ add_flow_rss_action(struct flow_actions *actions,
 }
 
 static int
-netdev_dpdk_add_rte_flow_offload(struct netdev *netdev,
-                                 const struct match *match,
-                                 struct nlattr *nl_actions OVS_UNUSED,
-                                 size_t actions_len OVS_UNUSED,
-                                 const ovs_u128 *ufid,
-                                 struct offload_info *info) {
+netdev_rte_offloads_add_flow(struct netdev *netdev,
+                             const struct match *match,
+                             struct nlattr *nl_actions OVS_UNUSED,
+                             size_t actions_len OVS_UNUSED,
+                             const ovs_u128 *ufid,
+                             struct offload_info *info) {
     const struct rte_flow_attr flow_attr = {
         .group = 0,
         .priority = 0,
@@ -596,8 +596,9 @@ end_proto_check:
     rss = add_flow_rss_action(&actions, netdev);
     add_flow_action(&actions, RTE_FLOW_ACTION_TYPE_END, NULL);
 
-    flow = netdev_dpdk_rte_flow_create(netdev, &flow_attr,patterns.items,
-                            actions.actions, &error);
+    flow = netdev_dpdk_rte_flow_create(netdev, &flow_attr,
+                                       patterns.items,
+                                       actions.actions, &error);
 
     free(rss);
     if (!flow) {
@@ -634,7 +635,7 @@ is_all_zero(const void *addr, size_t n) {
  * Check if any unsupported flow patterns are specified.
  */
 static int
-netdev_dpdk_validate_flow(const struct match *match) {
+netdev_rte_offloads_validate_flow(const struct match *match) {
     struct match match_zero_wc;
 
     /* Create a wc-zeroed version of flow */
@@ -712,9 +713,9 @@ err:
 }
 
 static int
-netdev_dpdk_destroy_rte_flow(struct netdev *netdev,
-                             const ovs_u128 *ufid,
-                             struct rte_flow *rte_flow) {
+netdev_rte_offloads_destroy_flow(struct netdev *netdev,
+                                 const ovs_u128 *ufid,
+                                 struct rte_flow *rte_flow) {
     struct rte_flow_error error;
     int ret = netdev_dpdk_rte_flow_destroy(netdev, rte_flow, &error);
 
@@ -732,7 +733,7 @@ netdev_dpdk_destroy_rte_flow(struct netdev *netdev,
 }
 
 int
-netdev_dpdk_flow_put(struct netdev *netdev, struct match *match,
+netdev_rte_offloads_flow_put(struct netdev *netdev, struct match *match,
                      struct nlattr *actions, size_t actions_len,
                      const ovs_u128 *ufid, struct offload_info *info,
                      struct dpif_flow_stats *stats OVS_UNUSED) {
@@ -745,23 +746,23 @@ netdev_dpdk_flow_put(struct netdev *netdev, struct match *match,
      */
     rte_flow = ufid_to_rte_flow_find(ufid);
     if (rte_flow) {
-        ret = netdev_dpdk_destroy_rte_flow(netdev, ufid, rte_flow);
+        ret = netdev_rte_offloads_destroy_flow(netdev, ufid, rte_flow);
         if (ret < 0) {
             return ret;
         }
     }
 
-    ret = netdev_dpdk_validate_flow(match);
+    ret = netdev_rte_offloads_validate_flow(match);
     if (ret < 0) {
         return ret;
     }
 
-    return netdev_dpdk_add_rte_flow_offload(netdev, match, actions,
-                                            actions_len, ufid, info);
+    return netdev_rte_offloads_add_flow(netdev, match, actions,
+                                        actions_len, ufid, info);
 }
 
 int
-netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid,
+netdev_rte_offloads_flow_del(struct netdev *netdev, const ovs_u128 *ufid,
                      struct dpif_flow_stats *stats OVS_UNUSED) {
 
     struct rte_flow *rte_flow = ufid_to_rte_flow_find(ufid);
@@ -770,6 +771,6 @@ netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid,
         return -1;
     }
 
-    return netdev_dpdk_destroy_rte_flow(netdev, ufid, rte_flow);
+    return netdev_rte_offloads_destroy_flow(netdev, ufid, rte_flow);
 }
 
diff --git a/lib/netdev-rte-offloads.h b/lib/netdev-rte-offloads.h
index 573e214..1609171 100644
--- a/lib/netdev-rte-offloads.h
+++ b/lib/netdev-rte-offloads.h
@@ -24,15 +24,16 @@ struct nlattr;
 struct offload_info;
 struct dpif_flow_stats;
 
-int netdev_dpdk_flow_put(struct netdev *netdev, struct match *match,
-                     struct nlattr *actions, size_t actions_len,
-                     const ovs_u128 *ufid, struct offload_info *info,
-                     struct dpif_flow_stats *stats OVS_UNUSED);
-int netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid,
-                     struct dpif_flow_stats *stats OVS_UNUSED);
+int netdev_rte_offloads_flow_put(struct netdev *netdev, struct match *match,
+                                 struct nlattr *actions, size_t actions_len,
+                                 const ovs_u128 *ufid,
+                                 struct offload_info *info,
+                                 struct dpif_flow_stats *stats OVS_UNUSED);
+int netdev_rte_offloads_flow_del(struct netdev *netdev, const ovs_u128 *ufid,
+                                 struct dpif_flow_stats *stats OVS_UNUSED);
 
 #define DPDK_FLOW_OFFLOAD_API                   \
-    .flow_put = netdev_dpdk_flow_put,           \
-    .flow_del = netdev_dpdk_flow_del
+    .flow_put = netdev_rte_offloads_flow_put,   \
+    .flow_del = netdev_rte_offloads_flow_del
 
 #endif /* netdev-rte-offloads.h */
-- 
1.8.3.1



More information about the dev mailing list