On Wed, Feb 15, 2012 at 12:46:34PM -0800, Ben Pfaff wrote:
> [resending with correct ovs-dev email address]
> 
> On Wed, Feb 15, 2012 at 08:59:49PM +0100, ravi.ke...@telekom.com wrote:
> > Thanks for vlan pointer Ben. Attached diffs for mpls actions code. 
> > 
> > Currently I am debugging with integrated nicira-ext mpls label/tc
> > match and this diffs to fix "no flow match" problem. Problem
> > exists with just the posted diffs as well. Kindly let me know if
> > you find anything suspicious.

Thank you for passing along a preview of what you are working on.
Here are some quick comments.

"git apply" reported the following:

    <stdin>:61: trailing whitespace.
    static void 
    <stdin>:79: trailing whitespace.
    static void 
    <stdin>:108: trailing whitespace.
    static int 
    <stdin>:141: trailing whitespace.
    static int 
    <stdin>:142: trailing whitespace.
    push_mpls (struct sk_buff *skb, 
    warning: squelched 33 whitespace errors
    warning: 38 lines add whitespace errors.

GCC and "sparse" reported the following:

/home/blp/ovs/_build/datapath/linux/actions.c:132:19: warning: incorrect type 
in return expression (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:132:19:    expected unsigned short
/home/blp/ovs/_build/datapath/linux/actions.c:132:19:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:145:22: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:145:22:    expected restricted 
__be16 [usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:145:22:    got unsigned short 
[unsigned] [usertype] eth_type
/home/blp/ovs/_build/datapath/linux/actions.c:149:19: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:149:19:    expected restricted 
__be16 [usertype] protocol
/home/blp/ovs/_build/datapath/linux/actions.c:149:19:    got unsigned short 
[unsigned] [usertype] eth_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:220:37: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:220:37:    expected unsigned int 
[unsigned] [usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:220:37:    got restricted __be32 
[usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:245:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:245:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:245:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:245:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:245:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:245:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:249:36: warning: incorrect type 
in argument 2 (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:249:36:    expected unsigned 
short [unsigned] [usertype] eth_type
/home/blp/ovs/_build/datapath/linux/actions.c:249:36:    got restricted __be16 
const [usertype] ethertype
/home/blp/ovs/_build/datapath/linux/actions.c:269:15: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:269:15:    expected unsigned 
short [unsigned] [usertype] eth_proto
/home/blp/ovs/_build/datapath/linux/actions.c:269:15:    got restricted __be16 
[usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:287:32: warning: incorrect type 
in argument 2 (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:287:32:    expected unsigned 
short [unsigned] [usertype] eth_type
/home/blp/ovs/_build/datapath/linux/actions.c:287:32:    got restricted __be16 
const [usertype] ethertype
/home/blp/ovs/_build/datapath/linux/actions.c:305:15: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:305:15:    expected unsigned 
short [unsigned] [usertype] eth_proto
/home/blp/ovs/_build/datapath/linux/actions.c:305:15:    got restricted __be16 
[usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:311:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:311:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:311:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:311:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:311:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:311:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:326:42: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:326:42:    expected unsigned int 
[unsigned] [usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:326:42:    got restricted __be32 
[usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:339:15: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:339:15:    expected unsigned 
short [unsigned] [usertype] eth_proto
/home/blp/ovs/_build/datapath/linux/actions.c:339:15:    got restricted __be16 
[usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:344:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:344:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:344:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:344:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:344:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:344:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:347:23: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:347:23:    expected unsigned int 
[unsigned] [usertype] value_to_swap
/home/blp/ovs/_build/datapath/linux/actions.c:347:23:    got restricted __be32 
[usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:363:15: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:363:15:    expected unsigned 
short [unsigned] [usertype] eth_proto
/home/blp/ovs/_build/datapath/linux/actions.c:363:15:    got restricted __be16 
[usertype] <noident>
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:170:17:    got restricted __be16 
[usertype] h_vlan_encapsulated_proto
/home/blp/ovs/_build/datapath/linux/actions.c:368:24: warning: cast to 
restricted __be32
/home/blp/ovs/_build/datapath/linux/actions.c:164:17: warning: incorrect type 
in assignment (different base types)
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    expected unsigned 
short [unsigned] [usertype] dl_type
/home/blp/ovs/_build/datapath/linux/actions.c:164:17:    got restricted __be16 
[usertype] h_proto
/home/blp/ovs/_build/datapath/linux/actions.c:167:20: warning: restricted 
__be16 degrades to integer
/home/blp/ovs/_build/datapath/linux/actions.c:170:17: warning: too many warnings
/home/blp/ovs/_build/datapath/linux/actions.c: In function ‘pop_mpls_lse’:
/home/blp/ovs/_build/datapath/linux/actions.c:183: warning: format ‘%x’ expects 
type ‘unsigned int’, but argument 2 has type ‘char *’
/home/blp/ovs/_build/datapath/linux/actions.c:183: warning: format ‘%x’ expects 
type ‘unsigned int’, but argument 3 has type ‘unsigned char *’
/home/blp/ovs/_build/datapath/linux/actions.c: In function ‘push_mpls_lse’:
/home/blp/ovs/_build/datapath/linux/actions.c:202: warning: format ‘%x’ expects 
type ‘unsigned int’, but argument 2 has type ‘char *’
/home/blp/ovs/_build/datapath/linux/actions.c:202: warning: format ‘%x’ expects 
type ‘unsigned int’, but argument 3 has type ‘unsigned char *’
../utilities/ovs-dpctl.c: In function ‘do_normalize_actions’:
../utilities/ovs-dpctl.c:918: error: too few arguments for format
../lib/dpif-netdev.c:1232:36: warning: incorrect type in argument 2 (different 
base types)
../lib/dpif-netdev.c:1232:36:    expected unsigned short [unsigned] [usertype] 
ethtype
../lib/dpif-netdev.c:1232:36:    got restricted __be16 const [usertype] 
ethertype
../lib/dpif-netdev.c:1237:35: warning: incorrect type in argument 2 (different 
base types)
../lib/dpif-netdev.c:1237:35:    expected unsigned short [unsigned] [usertype] 
ethtype
../lib/dpif-netdev.c:1237:35:    got restricted __be16 const [usertype] 
ethertype
../lib/flow.c:383:39: warning: restricted __be16 degrades to integer
../lib/flow.c:384:39: warning: restricted __be16 degrades to integer
../lib/flow.c:398:24: warning: incorrect type in assignment (different base 
types)
../lib/flow.c:398:24:    expected restricted __be32 [usertype] mpls_lse
../lib/flow.c:398:24:    got unsigned int [unsigned] [usertype] <noident>
../lib/flow.c:106: error: ‘parse_mpls’ defined but not used
../lib/packets.c:131:10: warning: invalid assignment: &=
../lib/packets.c:131:10:    left side has type unsigned int
../lib/packets.c:131:10:    right side has type restricted __be32
../lib/packets.c:132:10: warning: invalid assignment: |=
../lib/packets.c:132:10:    left side has type unsigned int
../lib/packets.c:132:10:    right side has type restricted __be32
../lib/packets.c:143:27: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:143:27:    expected unsigned int [usertype] *tag
../lib/packets.c:143:27:    got restricted __be32 *<noident>
../lib/packets.c:156:27: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:156:27:    expected unsigned int [usertype] *tag
../lib/packets.c:156:27:    got restricted __be32 *<noident>
../lib/packets.c:175:54: warning: incorrect type in argument 2 (different base 
types)
../lib/packets.c:175:54:    expected restricted __be16 [usertype] old_u16
../lib/packets.c:175:54:    got unsigned short [unsigned] [usertype] field
../lib/packets.c:175:63: warning: incorrect type in argument 3 (different base 
types)
../lib/packets.c:175:63:    expected restricted __be16 [usertype] new_u16
../lib/packets.c:175:63:    got unsigned short [unsigned] [usertype] <noident>
../lib/packets.c:180:31: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:180:31:    expected unsigned int [usertype] *tag
../lib/packets.c:180:31:    got restricted __be32 *<noident>
../lib/packets.c:198:31: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:198:31:    expected unsigned int [usertype] *tag
../lib/packets.c:198:31:    got restricted __be32 *<noident>
../lib/packets.c:204:31: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:204:31:    expected unsigned int [usertype] *tag
../lib/packets.c:204:31:    got restricted __be32 *<noident>
../lib/packets.c:213:10: warning: invalid assignment: &=
../lib/packets.c:213:10:    left side has type unsigned int
../lib/packets.c:213:10:    right side has type restricted __be32
../lib/packets.c:214:10: warning: invalid assignment: |=
../lib/packets.c:214:10:    left side has type unsigned int
../lib/packets.c:214:10:    right side has type restricted __be32
../lib/packets.c:225:26: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:225:26:    expected unsigned int [usertype] *tag
../lib/packets.c:225:26:    got restricted __be32 *<noident>
../lib/packets.c:233:13: warning: restricted __be32 degrades to integer
../lib/packets.c:234:20: warning: restricted __be32 degrades to integer
../lib/packets.c:234:18: warning: restricted __be32 degrades to integer
../lib/packets.c:244:29: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:244:29:    expected unsigned int [usertype] *tag
../lib/packets.c:244:29:    got restricted __be32 *<noident>
../lib/packets.c:252:13: warning: restricted __be32 degrades to integer
../lib/packets.c:253:18: warning: restricted __be32 degrades to integer
../lib/packets.c:263:29: warning: incorrect type in argument 2 (different base 
types)
../lib/packets.c:263:29:    expected restricted __be32 [usertype] label
../lib/packets.c:263:29:    got unsigned int [unsigned] [usertype] label
../lib/packets.c:284:22: warning: incorrect type in assignment (different base 
types)
../lib/packets.c:284:22:    expected restricted __be16 [usertype] eth_type
../lib/packets.c:284:22:    got unsigned short [unsigned] [usertype] ethtype
../lib/packets.c:285:30: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:285:30:    expected unsigned int [usertype] *tag
../lib/packets.c:285:30:    got restricted __be32 *<noident>
../lib/packets.c:303:40: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:303:40:    expected restricted __be16 [usertype] x
../lib/packets.c:303:40:    got int
../lib/packets.c:305:38: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:305:38:    expected unsigned int [usertype] *tag
../lib/packets.c:305:38:    got restricted __be32 *<noident>
../lib/packets.c:314:33: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:314:33:    expected unsigned int [usertype] *tag
../lib/packets.c:314:33:    got restricted __be32 *<noident>
../lib/packets.c:334:22: warning: incorrect type in assignment (different base 
types)
../lib/packets.c:334:22:    expected restricted __be16 [usertype] eth_type
../lib/packets.c:334:22:    got unsigned short [unsigned] [usertype] ethtype
../lib/packets.c:335:30: warning: incorrect type in argument 1 (different base 
types)
../lib/packets.c:335:30:    expected unsigned int [usertype] *tag
../lib/packets.c:335:30:    got restricted __be32 *<noident>
../lib/packets.c:356:59: warning: incorrect type in initializer (different type 
sizes)
../lib/packets.c:356:59:    expected unsigned short [usertype] *next_ethtype
../lib/packets.c:356:59:    got char *
../lib/packets.c: In function ‘pop_mpls’:
../lib/packets.c:356: error: initialization from incompatible pointer type

A lot of the above warnings are because you didn't use e.g. __be16 for
a 16-bit integer in network byte order.  (Kernel code shouldn't use
uint<N>_t by the way, it should use u<N>.)

It's unusual kernel style to define a typedef for a union.  I wouldn't
do that.  I wouldn't use bit-fields, either; I'm sure that your use of
bit-fields as written can't be right on all architectures, since the
ordering of bit-fields is endian-dependent.

Kernel code shouldn't put a new-line after the return type in a
prototype.  No code in OVS should put a space before the () in a
function prototype.

It looks like you used spaces instead of hard tabs in much of the
kernel code.

The following condition is always false:

+                        if (push_mpls->ethertype != htons(ETH_P_MPLS_UC) ||
+                            push_mpls->ethertype != htons(ETH_P_MPLS_MC))

In openflow.h you can't reasonably add those actions where you did
because OpenFlow 1.0 doesn't define them that way.  It would be better
to define them as Nicira extensions in nicira-ext.h.  When we
implement OpenFlow 1.1 (we're working on it) we will of course use the
standard OpenFlow 1.1 numbers in that protocol.

I couldn't find the OFP_MPLS_* definitions you added anywhere in
OpenFlow 1.1.  Are they part of the standard?

The new enum definitions in ofp-util.h would be easier to use, and to
understand, if you just directly defined them to 1 << 0, 1 << 1, and 1
<< 2.

I see a few functions defined this way:

    void
    set_mpls_ttl (struct ofpbuf *packet, uint8_t ttl) {
        struct mpls_hdr *mh;

Please put the { on a line by itself.

Some of the uses of your shift and mask values look at best very
suspicious.  For example, this:

        if(ntohl(mh->mpls_lse) & (MPLS_STACK_MASK << MPLS_STACK_SHIFT)) {

looks wrong given these definitions (I'd guess the << MPLS_STACK_SHIFT
above should be omitted?):

    #define MPLS_STACK_MASK     0x00000100
    #define MPLS_STACK_SHIFT    8

You have a number of instances of code like this:

    ctx->ofproto->mpls_ttl &= 
        ~(OFP_ACTION_MPLS_TTL << OFPA_DEC_MPLS_TTL_SHIFT);
    ctx->ofproto->mpls_ttl |=
        (OFP_ACTION_MPLS_TTL << OFPA_DEC_MPLS_TTL_SHIFT);

In each case, the first statement may be deleted.

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

Reply via email to