[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A52D2BF3-6A9D-42B5-B52F-0F9FC7A50D61@nsn.com>
Date: Thu, 25 Apr 2013 10:02:49 +0000
From: "Rajahalme, Jarno (NSN - FI/Espoo)" <jarno.rajahalme@....com>
To: ext Simon Horman <horms@...ge.net.au>
CC: "<dev@...nvswitch.org>" <dev@...nvswitch.org>,
"<netdev@...r.kernel.org>" <netdev@...r.kernel.org>,
Ravi K <rkerur@...il.com>,
Isaku Yamahata <yamahata@...inux.co.jp>,
Jesse Gross <jesse@...ira.com>, Ben Pfaff <blp@...ira.com>
Subject: Re: [PATCH] datapath: Add basic MPLS support to kernel
On Apr 25, 2013, at 10:58 , ext Simon Horman wrote:
> @@ -648,6 +650,7 @@ int ovs_flow_extract(struct sk_buff *skb, u16 in_port, struct sw_flow_key *key,
> return -ENOMEM;
>
> skb_reset_network_header(skb);
> + skb_reset_mac_len(skb);
> __skb_push(skb, skb->data - skb_mac_header(skb));
>
> /* Network layer. */
> @@ -730,6 +733,30 @@ int ovs_flow_extract(struct sk_buff *skb, u16 in_port, struct sw_flow_key *key,
> memcpy(key->ipv4.arp.tha, arp->ar_tha, ETH_ALEN);
> key_len = SW_FLOW_KEY_OFFSET(ipv4.arp);
> }
> + } else if (eth_p_mpls(key->eth.type)) {
> + size_t stack_len = MPLS_HLEN;
> +
> + while (1) {
> + __be32 lse;
> +
> + error = check_header(skb, stack_len);
skb->data has been pushed to the mac_header prior to this, so this would not test availability of the MPLS data.
Maybe the following would work:
error = check_header(skb, skb->mac_len + stack_len);
> + if (unlikely(error))
> + goto out;
> +
> + memcpy(&lse, skb_network_header(skb), MPLS_HLEN);
> +
> + if (stack_len == MPLS_HLEN) {
> + key_len = SW_FLOW_KEY_OFFSET(mpls.top_lse);
> + memcpy(&key->mpls.top_lse, &lse, MPLS_HLEN);
> + }
> +
> + /* Advance network_header to bottom of MPLS label
> + * stack. mac_len corresponds to the top of the stack.
> + */
> + skb_set_network_header(skb, skb->mac_len + stack_len);
> + if (lse & htonl(MPLS_BOS_MASK))
> + break;
> + }
I don't see anything advancing the stack_len, so the loop would not end for deeper stacks?
Jarno
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists