datapath: Remove skb->mark compat code.
authorPravin B Shelar <pshelar@nicira.com>
Mon, 26 Aug 2013 20:27:02 +0000 (13:27 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Fri, 6 Sep 2013 16:51:31 +0000 (09:51 -0700)
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/actions.c
datapath/compat.h
datapath/datapath.c
datapath/flow.c
datapath/vport-gre.c
datapath/vport-lisp.c
datapath/vport-vxlan.c

index fa4b904..33633df 100644 (file)
@@ -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:
index 8457dbf..c786b97 100644 (file)
@@ -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)))
index b6410c4..1f7560a 100644 (file)
@@ -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);
index 34e4443..449e645 100644 (file)
@@ -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);
        }
index 5af6dbe..b9fff8a 100644 (file)
@@ -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;
index 3c6e784..818a471 100644 (file)
@@ -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;
index d7dd6b8..007e4ac 100644 (file)
@@ -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;