[ovs-dev,1/2] netdev-native-tnl: refactor the tunnel push header.

Message ID 1519868616-82421-1-git-send-email-u9012063@gmail.com
State Superseded
Headers show
Series
  • [ovs-dev,1/2] netdev-native-tnl: refactor the tunnel push header.
Related show

Commit Message

William Tu March 1, 2018, 1:43 a.m.
The patch adds additional 'struct netdev *' to the
native tunnel's push_header() interface.  This is used
for later GRE sequence number support.

Signed-off-by: William Tu <u9012063@gmail.com>
---
 lib/netdev-native-tnl.c | 6 ++++--
 lib/netdev-native-tnl.h | 6 ++++--
 lib/netdev-provider.h   | 3 ++-
 lib/netdev.c            | 2 +-
 4 files changed, 11 insertions(+), 6 deletions(-)

Patch

diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
index fb5eab033758..805b12bf4a16 100644
--- a/lib/netdev-native-tnl.c
+++ b/lib/netdev-native-tnl.c
@@ -215,7 +215,8 @@  udp_extract_tnl_md(struct dp_packet *packet, struct flow_tnl *tnl,
 
 
 void
-netdev_tnl_push_udp_header(struct dp_packet *packet,
+netdev_tnl_push_udp_header(const struct netdev *netdev OVS_UNUSED,
+                           struct dp_packet *packet,
                            const struct ovs_action_push_tnl *data)
 {
     struct udp_header *udp;
@@ -435,7 +436,8 @@  err:
 }
 
 void
-netdev_gre_push_header(struct dp_packet *packet,
+netdev_gre_push_header(const struct netdev *netdev OVS_UNUSED,
+                       struct dp_packet *packet,
                        const struct ovs_action_push_tnl *data)
 {
     struct gre_base_hdr *greh;
diff --git a/lib/netdev-native-tnl.h b/lib/netdev-native-tnl.h
index a912ce916dfc..5012b2dbac9a 100644
--- a/lib/netdev-native-tnl.h
+++ b/lib/netdev-native-tnl.h
@@ -34,13 +34,15 @@  netdev_gre_build_header(const struct netdev *netdev,
                         const struct netdev_tnl_build_header_params *params);
 
 void
-netdev_gre_push_header(struct dp_packet *packet,
+netdev_gre_push_header(const struct netdev *netdev,
+                       struct dp_packet *packet,
                        const struct ovs_action_push_tnl *data);
 struct dp_packet *
 netdev_gre_pop_header(struct dp_packet *packet);
 
 void
-netdev_tnl_push_udp_header(struct dp_packet *packet,
+netdev_tnl_push_udp_header(const struct netdev *netdev,
+                           struct dp_packet *packet,
                            const struct ovs_action_push_tnl *data);
 int
 netdev_geneve_build_header(const struct netdev *netdev,
diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index 25bd671c1382..e63257107ff4 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -314,7 +314,8 @@  struct netdev_class {
      * flow.  Push header is called for packet to build header specific to
      * a packet on actual transmit.  It uses partial header build by
      * build_header() which is passed as data. */
-    void (*push_header)(struct dp_packet *packet,
+    void (*push_header)(const struct netdev *,
+                        struct dp_packet *packet,
                         const struct ovs_action_push_tnl *data);
 
     /* Pop tunnel header from packet, build tunnel metadata and resize packet
diff --git a/lib/netdev.c b/lib/netdev.c
index 5a97ce53eb7a..1a23a170dcd5 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -855,7 +855,7 @@  netdev_push_header(const struct netdev *netdev,
 {
     struct dp_packet *packet;
     DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
-        netdev->netdev_class->push_header(packet, data);
+        netdev->netdev_class->push_header(netdev, packet, data);
         pkt_metadata_init(&packet->md, data->out_port);
     }