datapath: Constify various function arguments
authorThomas Graf <tgraf@noironetworks.com>
Tue, 23 Sep 2014 14:02:35 +0000 (16:02 +0200)
committerPravin B Shelar <pshelar@nicira.com>
Tue, 23 Sep 2014 21:47:58 +0000 (14:47 -0700)
Help produce better optimized code.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
12 files changed:
datapath/actions.c
datapath/datapath.c
datapath/datapath.h
datapath/flow.c
datapath/flow.h
datapath/flow_netlink.c
datapath/flow_table.c
datapath/flow_table.h
datapath/vport-geneve.c
datapath/vport-netdev.c
datapath/vport.c
datapath/vport.h

index c3f9427..b527cb6 100644 (file)
@@ -71,7 +71,7 @@ static void action_fifo_init(struct action_fifo *fifo)
        fifo->tail = 0;
 }
 
        fifo->tail = 0;
 }
 
-static bool action_fifo_is_empty(struct action_fifo *fifo)
+static bool action_fifo_is_empty(const struct action_fifo *fifo)
 {
        return (fifo->head == fifo->tail);
 }
 {
        return (fifo->head == fifo->tail);
 }
@@ -94,7 +94,7 @@ static struct deferred_action *action_fifo_put(struct action_fifo *fifo)
 
 /* Return queue entry if fifo is not full */
 static struct deferred_action *add_deferred_actions(struct sk_buff *skb,
 
 /* Return queue entry if fifo is not full */
 static struct deferred_action *add_deferred_actions(struct sk_buff *skb,
-                                                   struct sw_flow_key *key,
+                                                   const struct sw_flow_key *key,
                                                    const struct nlattr *attr)
 {
        struct action_fifo *fifo;
                                                    const struct nlattr *attr)
 {
        struct action_fifo *fifo;
@@ -116,7 +116,7 @@ static void invalidate_flow_key(struct sw_flow_key *key)
        key->eth.type = htons(0);
 }
 
        key->eth.type = htons(0);
 }
 
-static bool is_flow_key_valid(struct sw_flow_key *key)
+static bool is_flow_key_valid(const struct sw_flow_key *key)
 {
        return !!key->eth.type;
 }
 {
        return !!key->eth.type;
 }
@@ -956,7 +956,8 @@ static void process_deferred_actions(struct datapath *dp)
 
 /* Execute a list of actions against 'skb'. */
 int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
 
 /* Execute a list of actions against 'skb'. */
 int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
-                       struct sw_flow_key *key, struct sw_flow_actions *acts)
+                       struct sw_flow_key *key,
+                       const struct sw_flow_actions *acts)
 {
        int level = this_cpu_read(exec_actions_level);
        int err;
 {
        int level = this_cpu_read(exec_actions_level);
        int err;
index 9a3c052..45e7c56 100644 (file)
@@ -135,9 +135,10 @@ int lockdep_ovsl_is_held(void)
 #endif
 
 static int queue_gso_packets(struct datapath *dp, struct sk_buff *,
 #endif
 
 static int queue_gso_packets(struct datapath *dp, struct sk_buff *,
-                            struct sw_flow_key *, const struct dp_upcall_info *);
+                            const struct sw_flow_key *,
+                            const struct dp_upcall_info *);
 static int queue_userspace_packet(struct datapath *dp, struct sk_buff *,
 static int queue_userspace_packet(struct datapath *dp, struct sk_buff *,
-                                 struct sw_flow_key *key,
+                                 const struct sw_flow_key *key,
                                  const struct dp_upcall_info *);
 
 /* Must be called with rcu_read_lock. */
                                  const struct dp_upcall_info *);
 
 /* Must be called with rcu_read_lock. */
@@ -175,7 +176,7 @@ const char *ovs_dp_name(const struct datapath *dp)
        return vport->ops->get_name(vport);
 }
 
        return vport->ops->get_name(vport);
 }
 
-static int get_dpifindex(struct datapath *dp)
+static int get_dpifindex(const struct datapath *dp)
 {
        struct vport *local;
        int ifindex;
 {
        struct vport *local;
        int ifindex;
@@ -300,7 +301,7 @@ out:
 }
 
 int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
 }
 
 int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
-                 struct sw_flow_key *key,
+                 const struct sw_flow_key *key,
                  const struct dp_upcall_info *upcall_info)
 {
        struct dp_stats_percpu *stats;
                  const struct dp_upcall_info *upcall_info)
 {
        struct dp_stats_percpu *stats;
@@ -331,7 +332,7 @@ err:
 }
 
 static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
 }
 
 static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
-                            struct sw_flow_key *key,
+                            const struct sw_flow_key *key,
                             const struct dp_upcall_info *upcall_info)
 {
        unsigned short gso_type = skb_shinfo(skb)->gso_type;
                             const struct dp_upcall_info *upcall_info)
 {
        unsigned short gso_type = skb_shinfo(skb)->gso_type;
@@ -399,7 +400,7 @@ static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,
 }
 
 static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 }
 
 static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
-                                 struct sw_flow_key *key,
+                                 const struct sw_flow_key *key,
                                  const struct dp_upcall_info *upcall_info)
 {
        struct ovs_header *upcall;
                                  const struct dp_upcall_info *upcall_info)
 {
        struct ovs_header *upcall;
@@ -635,7 +636,7 @@ static struct genl_family dp_packet_genl_family = {
        .n_ops = ARRAY_SIZE(dp_packet_genl_ops),
 };
 
        .n_ops = ARRAY_SIZE(dp_packet_genl_ops),
 };
 
-static void get_dp_stats(struct datapath *dp, struct ovs_dp_stats *stats,
+static void get_dp_stats(const struct datapath *dp, struct ovs_dp_stats *stats,
                         struct ovs_dp_megaflow_stats *mega_stats)
 {
        int i;
                         struct ovs_dp_megaflow_stats *mega_stats)
 {
        int i;
@@ -1356,7 +1357,7 @@ static struct sk_buff *ovs_dp_cmd_alloc_info(struct genl_info *info)
 
 /* Called with rcu_read_lock or ovs_mutex. */
 static struct datapath *lookup_datapath(struct net *net,
 
 /* Called with rcu_read_lock or ovs_mutex. */
 static struct datapath *lookup_datapath(struct net *net,
-                                       struct ovs_header *ovs_header,
+                                       const struct ovs_header *ovs_header,
                                        struct nlattr *a[OVS_DP_ATTR_MAX + 1])
 {
        struct datapath *dp;
                                        struct nlattr *a[OVS_DP_ATTR_MAX + 1])
 {
        struct datapath *dp;
@@ -1384,7 +1385,7 @@ static void ovs_dp_reset_user_features(struct sk_buff *skb, struct genl_info *in
        dp->user_features = 0;
 }
 
        dp->user_features = 0;
 }
 
-static void ovs_dp_change(struct datapath *dp, struct nlattr **a)
+static void ovs_dp_change(struct datapath *dp, struct nlattr *a[])
 {
        if (a[OVS_DP_ATTR_USER_FEATURES])
                dp->user_features = nla_get_u32(a[OVS_DP_ATTR_USER_FEATURES]);
 {
        if (a[OVS_DP_ATTR_USER_FEATURES])
                dp->user_features = nla_get_u32(a[OVS_DP_ATTR_USER_FEATURES]);
@@ -1745,7 +1746,7 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 portid,
 
 /* Called with ovs_mutex or RCU read lock. */
 static struct vport *lookup_vport(struct net *net,
 
 /* Called with ovs_mutex or RCU read lock. */
 static struct vport *lookup_vport(struct net *net,
-                                 struct ovs_header *ovs_header,
+                                 const struct ovs_header *ovs_header,
                                  struct nlattr *a[OVS_VPORT_ATTR_MAX + 1])
 {
        struct datapath *dp;
                                  struct nlattr *a[OVS_VPORT_ATTR_MAX + 1])
 {
        struct datapath *dp;
index b30a9a4..d236cf4 100644 (file)
@@ -152,7 +152,7 @@ int lockdep_ovsl_is_held(void);
 #define rcu_dereference_ovsl(p)                                        \
        rcu_dereference_check(p, lockdep_ovsl_is_held())
 
 #define rcu_dereference_ovsl(p)                                        \
        rcu_dereference_check(p, lockdep_ovsl_is_held())
 
-static inline struct net *ovs_dp_get_net(struct datapath *dp)
+static inline struct net *ovs_dp_get_net(const struct datapath *dp)
 {
        return read_pnet(&dp->net);
 }
 {
        return read_pnet(&dp->net);
 }
@@ -189,14 +189,15 @@ extern struct genl_multicast_group ovs_dp_vport_multicast_group;
 void ovs_dp_process_packet(struct sk_buff *, struct sw_flow_key *key);
 void ovs_dp_detach_port(struct vport *);
 int ovs_dp_upcall(struct datapath *, struct sk_buff *,
 void ovs_dp_process_packet(struct sk_buff *, struct sw_flow_key *key);
 void ovs_dp_detach_port(struct vport *);
 int ovs_dp_upcall(struct datapath *, struct sk_buff *,
-                 struct sw_flow_key *, const struct dp_upcall_info *);
+                 const struct sw_flow_key *, const struct dp_upcall_info *);
 
 const char *ovs_dp_name(const struct datapath *dp);
 struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 portid, u32 seq,
                                         u8 cmd);
 
 int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
 
 const char *ovs_dp_name(const struct datapath *dp);
 struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 portid, u32 seq,
                                         u8 cmd);
 
 int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
-                       struct sw_flow_key *key, struct sw_flow_actions *acts);
+                       struct sw_flow_key *key,
+                       const struct sw_flow_actions *acts);
 void ovs_dp_notify_wq(struct work_struct *work);
 
 int action_fifos_init(void);
 void ovs_dp_notify_wq(struct work_struct *work);
 
 int action_fifos_init(void);
index eb7df13..a69f4e1 100644 (file)
@@ -66,7 +66,7 @@ u64 ovs_flow_used_time(unsigned long flow_jiffies)
 #define TCP_FLAGS_BE16(tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF))
 
 void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
 #define TCP_FLAGS_BE16(tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF))
 
 void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
-                          struct sk_buff *skb)
+                          const struct sk_buff *skb)
 {
        struct flow_stats *stats;
        int node = numa_node_id();
 {
        struct flow_stats *stats;
        int node = numa_node_id();
index 44ed10d..eb9246a 100644 (file)
@@ -55,7 +55,7 @@ struct ovs_key_ipv4_tunnel {
 
 struct ovs_tunnel_info {
        struct ovs_key_ipv4_tunnel tunnel;
 
 struct ovs_tunnel_info {
        struct ovs_key_ipv4_tunnel tunnel;
-       struct geneve_opt *options;
+       const struct geneve_opt *options;
        u8 options_len;
 };
 
        u8 options_len;
 };
 
@@ -75,7 +75,7 @@ static inline void __ovs_flow_tun_info_init(struct ovs_tunnel_info *tun_info,
                                            __be16 tp_dst,
                                            __be64 tun_id,
                                            __be16 tun_flags,
                                            __be16 tp_dst,
                                            __be64 tun_id,
                                            __be16 tun_flags,
-                                           struct geneve_opt *opts,
+                                           const struct geneve_opt *opts,
                                            u8 opts_len)
 {
        tun_info->tunnel.tun_id = tun_id;
                                            u8 opts_len)
 {
        tun_info->tunnel.tun_id = tun_id;
@@ -108,7 +108,7 @@ static inline void ovs_flow_tun_info_init(struct ovs_tunnel_info *tun_info,
                                          __be16 tp_dst,
                                          __be64 tun_id,
                                          __be16 tun_flags,
                                          __be16 tp_dst,
                                          __be64 tun_id,
                                          __be16 tun_flags,
-                                         struct geneve_opt *opts,
+                                         const struct geneve_opt *opts,
                                          u8 opts_len)
 {
        __ovs_flow_tun_info_init(tun_info, iph->saddr, iph->daddr,
                                          u8 opts_len)
 {
        __ovs_flow_tun_info_init(tun_info, iph->saddr, iph->daddr,
@@ -246,7 +246,7 @@ struct arp_eth_header {
 } __packed;
 
 void ovs_flow_stats_update(struct sw_flow *, __be16 tcp_flags,
 } __packed;
 
 void ovs_flow_stats_update(struct sw_flow *, __be16 tcp_flags,
-                          struct sk_buff *);
+                          const struct sk_buff *);
 void ovs_flow_stats_get(const struct sw_flow *, struct ovs_flow_stats *,
                        unsigned long *used, __be16 *tcp_flags);
 void ovs_flow_stats_clear(struct sw_flow *);
 void ovs_flow_stats_get(const struct sw_flow *, struct ovs_flow_stats *,
                        unsigned long *used, __be16 *tcp_flags);
 void ovs_flow_stats_clear(struct sw_flow *);
index 6c74841..a3f34f1 100644 (file)
@@ -1580,9 +1580,9 @@ static int validate_and_copy_set_tun(const struct nlattr *attr,
                 * everything else will go away after flow setup. We can append
                 * it to tun_info and then point there.
                 */
                 * everything else will go away after flow setup. We can append
                 * it to tun_info and then point there.
                 */
-               tun_info->options = (struct geneve_opt *)(tun_info + 1);
-               memcpy(tun_info->options, GENEVE_OPTS(&key, key.tun_opts_len),
+               memcpy((tun_info + 1), GENEVE_OPTS(&key, key.tun_opts_len),
                        key.tun_opts_len);
                        key.tun_opts_len);
+               tun_info->options = (struct geneve_opt *)(tun_info + 1);
        } else {
                tun_info->options = NULL;
        }
        } else {
                tun_info->options = NULL;
        }
index 10bf830..4efef13 100644 (file)
@@ -114,7 +114,7 @@ err:
        return ERR_PTR(-ENOMEM);
 }
 
        return ERR_PTR(-ENOMEM);
 }
 
-int ovs_flow_tbl_count(struct flow_table *table)
+int ovs_flow_tbl_count(const struct flow_table *table)
 {
        return table->count;
 }
 {
        return table->count;
 }
@@ -482,7 +482,7 @@ static bool flow_cmp_masked_key(const struct sw_flow *flow,
 }
 
 bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
 }
 
 bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
-                              struct sw_flow_match *match)
+                              const struct sw_flow_match *match)
 {
        struct sw_flow_key *key = match->key;
        int key_start = flow_key_start(key);
 {
        struct sw_flow_key *key = match->key;
        int key_start = flow_key_start(key);
@@ -493,7 +493,7 @@ bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
 
 static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
                                          const struct sw_flow_key *unmasked,
 
 static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
                                          const struct sw_flow_key *unmasked,
-                                         struct sw_flow_mask *mask,
+                                         const struct sw_flow_mask *mask,
                                          u32 *n_mask_hit)
 {
        struct sw_flow *flow;
                                          u32 *n_mask_hit)
 {
        struct sw_flow *flow;
@@ -521,7 +521,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
  */
 static struct sw_flow *flow_lookup(struct flow_table *tbl,
                                   struct table_instance *ti,
  */
 static struct sw_flow *flow_lookup(struct flow_table *tbl,
                                   struct table_instance *ti,
-                                  struct mask_array *ma,
+                                  const struct mask_array *ma,
                                   const struct sw_flow_key *key,
                                   u32 *n_mask_hit,
                                   u32 *index)
                                   const struct sw_flow_key *key,
                                   u32 *n_mask_hit,
                                   u32 *index)
@@ -627,7 +627,7 @@ struct sw_flow *ovs_flow_tbl_lookup(struct flow_table *tbl,
 }
 
 struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *tbl,
 }
 
 struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *tbl,
-                                         struct sw_flow_match *match)
+                                         const struct sw_flow_match *match)
 {
        struct mask_array *ma = ovsl_dereference(tbl->mask_array);
        int i;
 {
        struct mask_array *ma = ovsl_dereference(tbl->mask_array);
        int i;
@@ -761,7 +761,7 @@ static struct sw_flow_mask *flow_mask_find(const struct flow_table *tbl,
 
 /* Add 'mask' into the mask list, if it is not already there. */
 static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow,
 
 /* Add 'mask' into the mask list, if it is not already there. */
 static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow,
-                           struct sw_flow_mask *new)
+                           const struct sw_flow_mask *new)
 {
        struct sw_flow_mask *mask;
 
 {
        struct sw_flow_mask *mask;
 
@@ -814,7 +814,7 @@ static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow,
 
 /* Must be called with OVS mutex held. */
 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow,
 
 /* Must be called with OVS mutex held. */
 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow,
-                       struct sw_flow_mask *mask)
+                       const struct sw_flow_mask *mask)
 {
        struct table_instance *new_ti = NULL;
        struct table_instance *ti;
 {
        struct table_instance *new_ti = NULL;
        struct table_instance *ti;
index a05d36a..9eb4af9 100644 (file)
@@ -73,12 +73,12 @@ struct sw_flow *ovs_flow_alloc(void);
 void ovs_flow_free(struct sw_flow *, bool deferred);
 
 int ovs_flow_tbl_init(struct flow_table *);
 void ovs_flow_free(struct sw_flow *, bool deferred);
 
 int ovs_flow_tbl_init(struct flow_table *);
-int ovs_flow_tbl_count(struct flow_table *table);
+int ovs_flow_tbl_count(const struct flow_table *table);
 void ovs_flow_tbl_destroy(struct flow_table *table);
 int ovs_flow_tbl_flush(struct flow_table *flow_table);
 
 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow,
 void ovs_flow_tbl_destroy(struct flow_table *table);
 int ovs_flow_tbl_flush(struct flow_table *flow_table);
 
 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow,
-                       struct sw_flow_mask *mask);
+                       const struct sw_flow_mask *mask);
 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow);
 int  ovs_flow_tbl_num_masks(const struct flow_table *table);
 struct sw_flow *ovs_flow_tbl_dump_next(struct table_instance *table,
 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow);
 int  ovs_flow_tbl_num_masks(const struct flow_table *table);
 struct sw_flow *ovs_flow_tbl_dump_next(struct table_instance *table,
@@ -90,10 +90,10 @@ struct sw_flow *ovs_flow_tbl_lookup_stats(struct flow_table *,
 struct sw_flow *ovs_flow_tbl_lookup(struct flow_table *,
                                    const struct sw_flow_key *);
 struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *,
 struct sw_flow *ovs_flow_tbl_lookup(struct flow_table *,
                                    const struct sw_flow_key *);
 struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *,
-                                         struct sw_flow_match *match);
+                                         const struct sw_flow_match *match);
 
 bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
 
 bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
-                              struct sw_flow_match *match);
+                              const struct sw_flow_match *match);
 
 void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src,
                       const struct sw_flow_mask *mask);
 
 void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src,
                       const struct sw_flow_mask *mask);
index 6ed1e1f..d79e27b 100644 (file)
@@ -117,7 +117,7 @@ static void tunnel_id_to_vni(__be64 tun_id, __u8 *vni)
 }
 
 /* Convert 24 bit VNI to 64 bit tunnel ID. */
 }
 
 /* Convert 24 bit VNI to 64 bit tunnel ID. */
-static __be64 vni_to_tunnel_id(__u8 *vni)
+static __be64 vni_to_tunnel_id(const __u8 *vni)
 {
 #ifdef __BIG_ENDIAN
        return (vni[0] << 16) | (vni[1] << 8) | vni[2];
 {
 #ifdef __BIG_ENDIAN
        return (vni[0] << 16) | (vni[1] << 8) | vni[2];
index a00276b..c763491 100644 (file)
@@ -85,7 +85,7 @@ static struct sk_buff *netdev_frame_hook(struct net_bridge_port *p,
 #error
 #endif
 
 #error
 #endif
 
-static struct net_device *get_dpdev(struct datapath *dp)
+static struct net_device *get_dpdev(const struct datapath *dp)
 {
        struct vport *local;
 
 {
        struct vport *local;
 
index de9bc23..bda643e 100644 (file)
@@ -82,7 +82,7 @@ void ovs_vport_exit(void)
        kfree(dev_table);
 }
 
        kfree(dev_table);
 }
 
-static struct hlist_head *hash_bucket(struct net *net, const char *name)
+static struct hlist_head *hash_bucket(const struct net *net, const char *name)
 {
        unsigned int hash = jhash(name, strlen(name), (unsigned long) net);
        return &dev_table[hash & (VPORT_HASH_BUCKETS - 1)];
 {
        unsigned int hash = jhash(name, strlen(name), (unsigned long) net);
        return &dev_table[hash & (VPORT_HASH_BUCKETS - 1)];
@@ -95,7 +95,7 @@ static struct hlist_head *hash_bucket(struct net *net, const char *name)
  *
  * Must be called with ovs or RCU read lock.
  */
  *
  * Must be called with ovs or RCU read lock.
  */
-struct vport *ovs_vport_locate(struct net *net, const char *name)
+struct vport *ovs_vport_locate(const struct net *net, const char *name)
 {
        struct hlist_head *bucket = hash_bucket(net, name);
        struct vport *vport;
 {
        struct hlist_head *bucket = hash_bucket(net, name);
        struct vport *vport;
@@ -352,7 +352,7 @@ static void vport_portids_destroy_rcu_cb(struct rcu_head *rcu)
  *
  * Must be called with ovs_mutex.
  */
  *
  * Must be called with ovs_mutex.
  */
-int ovs_vport_set_upcall_portids(struct vport *vport,  struct nlattr *ids)
+int ovs_vport_set_upcall_portids(struct vport *vport, const struct nlattr *ids)
 {
        struct vport_portids *old, *vport_portids;
 
 {
        struct vport_portids *old, *vport_portids;
 
@@ -443,7 +443,7 @@ u32 ovs_vport_find_upcall_portid(const struct vport *p, struct sk_buff *skb)
  * called compute_ip_summed() to initialize the checksumming fields.
  */
 void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
  * called compute_ip_summed() to initialize the checksumming fields.
  */
 void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
-                      struct ovs_tunnel_info *tun_info)
+                      const struct ovs_tunnel_info *tun_info)
 {
        struct pcpu_sw_netstats *stats;
        struct sw_flow_key key;
 {
        struct pcpu_sw_netstats *stats;
        struct sw_flow_key key;
index a0cf3dd..82d9a78 100644 (file)
@@ -43,14 +43,14 @@ void ovs_vport_exit(void);
 struct vport *ovs_vport_add(const struct vport_parms *);
 void ovs_vport_del(struct vport *);
 
 struct vport *ovs_vport_add(const struct vport_parms *);
 void ovs_vport_del(struct vport *);
 
-struct vport *ovs_vport_locate(struct net *net, const char *name);
+struct vport *ovs_vport_locate(const struct net *net, const char *name);
 
 void ovs_vport_get_stats(struct vport *, struct ovs_vport_stats *);
 
 int ovs_vport_set_options(struct vport *, struct nlattr *options);
 int ovs_vport_get_options(const struct vport *, struct sk_buff *);
 
 
 void ovs_vport_get_stats(struct vport *, struct ovs_vport_stats *);
 
 int ovs_vport_set_options(struct vport *, struct nlattr *options);
 int ovs_vport_get_options(const struct vport *, struct sk_buff *);
 
-int ovs_vport_set_upcall_portids(struct vport *, struct nlattr *pids);
+int ovs_vport_set_upcall_portids(struct vport *, const struct nlattr *pids);
 int ovs_vport_get_upcall_portids(const struct vport *, struct sk_buff *);
 u32 ovs_vport_find_upcall_portid(const struct vport *, struct sk_buff *);
 
 int ovs_vport_get_upcall_portids(const struct vport *, struct sk_buff *);
 u32 ovs_vport_find_upcall_portid(const struct vport *, struct sk_buff *);
 
@@ -218,7 +218,7 @@ static inline struct vport *vport_from_priv(void *priv)
 }
 
 void ovs_vport_receive(struct vport *, struct sk_buff *,
 }
 
 void ovs_vport_receive(struct vport *, struct sk_buff *,
-                      struct ovs_tunnel_info *);
+                      const struct ovs_tunnel_info *);
 
 /* List of statically compiled vport implementations.  Don't forget to also
  * add yours to the list at the top of vport.c. */
 
 /* List of statically compiled vport implementations.  Don't forget to also
  * add yours to the list at the top of vport.c. */