Signed-off-by: Pravin B Shelar <pshe...@nicira.com>
---
 datapath/actions.c     |    2 +-
 datapath/compat.h      |   39 ---------------------------------------
 datapath/datapath.c    |   10 ++--------
 datapath/flow.c        |    9 ++-------
 datapath/vport-gre.c   |    2 +-
 datapath/vport-lisp.c  |    2 +-
 datapath/vport-vxlan.c |    2 +-
 7 files changed, 8 insertions(+), 58 deletions(-)

diff --git a/datapath/actions.c b/datapath/actions.c
index fa4b904..33633df 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -478,7 +478,7 @@ static int execute_set_action(struct sk_buff *skb,
                break;
 
        case OVS_KEY_ATTR_SKB_MARK:
-               skb_set_mark(skb, nla_get_u32(nested_attr));
+               skb->mark = nla_get_u32(nested_attr);
                break;
 
        case OVS_KEY_ATTR_IPV4_TUNNEL:
diff --git a/datapath/compat.h b/datapath/compat.h
index 8457dbf..c786b97 100644
--- a/datapath/compat.h
+++ b/datapath/compat.h
@@ -72,40 +72,6 @@ static inline void skb_clear_rxhash(struct sk_buff *skb)
 #define SET_PARALLEL_OPS
 #endif
 
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-#ifdef CONFIG_NETFILTER
-static inline u32 skb_get_mark(struct sk_buff *skb)
-{
-       return skb->nfmark;
-}
-
-static inline void skb_set_mark(struct sk_buff *skb, u32 mark)
-{
-       skb->nfmark = mark;
-}
-#else /* CONFIG_NETFILTER */
-static inline u32 skb_get_mark(struct sk_buff *skb)
-{
-       return 0;
-}
-
-static inline void skb_set_mark(struct sk_buff *skb, u32 mark)
-{
-}
-#endif
-#else /* before 2.6.20 */
-static inline u32 skb_get_mark(struct sk_buff *skb)
-{
-       return skb->mark;
-}
-
-static inline void skb_set_mark(struct sk_buff *skb, u32 mark)
-{
-       skb->mark = mark;
-}
-#endif /* after 2.6.20 */
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
 #define rt_dst(rt) (rt->dst)
 #else
@@ -130,13 +96,8 @@ static inline struct rtable *find_route(struct net *net,
        struct flowi fl = { .nl_u = { .ip4_u = {
                                        .daddr = daddr,
                                        .saddr = *saddr,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-                                       .fwmark = skb_mark,
-#endif
                                        .tos   = RT_TOS(tos) } },
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
                                        .mark = skb_mark,
-#endif
                                        .proto = ipproto };
 
        if (unlikely(ip_route_output_key(net, &rt, &fl)))
diff --git a/datapath/datapath.c b/datapath/datapath.c
index b6410c4..1f7560a 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -657,14 +657,8 @@ static int validate_set(const struct nlattr *a,
        int err;
 
        case OVS_KEY_ATTR_PRIORITY:
-       case OVS_KEY_ATTR_ETHERNET:
-               break;
-
        case OVS_KEY_ATTR_SKB_MARK:
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) && !defined(CONFIG_NETFILTER)
-               if (nla_get_u32(ovs_key) != 0)
-                       return -EINVAL;
-#endif
+       case OVS_KEY_ATTR_ETHERNET:
                break;
 
        case OVS_KEY_ATTR_TUNNEL:
@@ -927,7 +921,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, 
struct genl_info *info)
        OVS_CB(packet)->flow = flow;
        OVS_CB(packet)->pkt_key = &flow->key;
        packet->priority = flow->key.phy.priority;
-       skb_set_mark(packet, flow->key.phy.skb_mark);
+       packet->mark = flow->key.phy.skb_mark;
 
        rcu_read_lock();
        dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
diff --git a/datapath/flow.c b/datapath/flow.c
index 7a697a4..d0b0dcd 100644
--- a/datapath/flow.c
+++ b/datapath/flow.c
@@ -853,7 +853,7 @@ int ovs_flow_extract(struct sk_buff *skb, u16 in_port, 
struct sw_flow_key *key)
        if (OVS_CB(skb)->tun_key)
                memcpy(&key->tun_key, OVS_CB(skb)->tun_key, 
sizeof(key->tun_key));
        key->phy.in_port = in_port;
-       key->phy.skb_mark = skb_get_mark(skb);
+       key->phy.skb_mark = skb->mark;
 
        skb_reset_mac_header(skb);
 
@@ -1377,12 +1377,7 @@ static int metadata_from_nlattrs(struct sw_flow_match 
*match,  u64 *attrs,
 
        if (*attrs & (1ULL << OVS_KEY_ATTR_SKB_MARK)) {
                uint32_t mark = nla_get_u32(a[OVS_KEY_ATTR_SKB_MARK]);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) && !defined(CONFIG_NETFILTER)
-               if (!is_mask && mark != 0) {
-                       OVS_NLERR("skb->mark must be zero on this kernel 
(mark=%d).\n", mark);
-                       return -EINVAL;
-               }
-#endif
+
                SW_FLOW_KEY_PUT(match, phy.skb_mark, mark, is_mask);
                *attrs &= ~(1ULL << OVS_KEY_ATTR_SKB_MARK);
        }
diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
index 5af6dbe..b9fff8a 100644
--- a/datapath/vport-gre.c
+++ b/datapath/vport-gre.c
@@ -138,7 +138,7 @@ static int __send(struct vport *vport, struct sk_buff *skb,
                        OVS_CB(skb)->tun_key->ipv4_dst,
                        IPPROTO_GRE,
                        OVS_CB(skb)->tun_key->ipv4_tos,
-                       skb_get_mark(skb));
+                       skb->mark);
        if (IS_ERR(rt)) {
                err = PTR_ERR(rt);
                goto error;
diff --git a/datapath/vport-lisp.c b/datapath/vport-lisp.c
index 3c6e784..818a471 100644
--- a/datapath/vport-lisp.c
+++ b/datapath/vport-lisp.c
@@ -507,7 +507,7 @@ static int ovs_tnl_send(struct vport *vport, struct sk_buff 
*skb,
                        OVS_CB(skb)->tun_key->ipv4_dst,
                        ipproto,
                        OVS_CB(skb)->tun_key->ipv4_tos,
-                       skb_get_mark(skb));
+                       skb->mark);
        if (IS_ERR(rt)) {
                err = PTR_ERR(rt);
                goto error;
diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c
index d7dd6b8..007e4ac 100644
--- a/datapath/vport-vxlan.c
+++ b/datapath/vport-vxlan.c
@@ -165,7 +165,7 @@ static int vxlan_tnl_send(struct vport *vport, struct 
sk_buff *skb)
                        OVS_CB(skb)->tun_key->ipv4_dst,
                        IPPROTO_UDP,
                        OVS_CB(skb)->tun_key->ipv4_tos,
-                       skb_get_mark(skb));
+                       skb->mark);
        if (IS_ERR(rt)) {
                err = PTR_ERR(rt);
                goto error;
-- 
1.7.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to