Commit 064d5e6f authored by David S. Miller's avatar David S. Miller

Merge branch 'u32-hwoffload-fixes'

Jakub Kicinski says:

====================
cls_u32 hardware offload fixes

This set fixes two small issues with error codes I noticed
in cls_u32.  Second patch could be viewed as user space API
change but that portion of API is not part of any release,
yet.

Compile tested only.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7b01b8e8 d47a0f38
...@@ -457,10 +457,12 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, ...@@ -457,10 +457,12 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
struct tc_to_netdev offload; struct tc_to_netdev offload;
int err; int err;
if (!tc_should_offload(dev, flags))
return tc_skip_sw(flags) ? -EINVAL : 0;
offload.type = TC_SETUP_CLSU32; offload.type = TC_SETUP_CLSU32;
offload.cls_u32 = &u32_offload; offload.cls_u32 = &u32_offload;
if (tc_should_offload(dev, flags)) {
offload.cls_u32->command = TC_CLSU32_NEW_HNODE; offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
offload.cls_u32->hnode.divisor = h->divisor; offload.cls_u32->hnode.divisor = h->divisor;
offload.cls_u32->hnode.handle = h->handle; offload.cls_u32->hnode.handle = h->handle;
...@@ -470,7 +472,6 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, ...@@ -470,7 +472,6 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
tp->protocol, &offload); tp->protocol, &offload);
if (tc_skip_sw(flags)) if (tc_skip_sw(flags))
return err; return err;
}
return 0; return 0;
} }
...@@ -863,7 +864,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, ...@@ -863,7 +864,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
if (tb[TCA_U32_FLAGS]) { if (tb[TCA_U32_FLAGS]) {
flags = nla_get_u32(tb[TCA_U32_FLAGS]); flags = nla_get_u32(tb[TCA_U32_FLAGS]);
if (!tc_flags_valid(flags)) if (!tc_flags_valid(flags))
return err; return -EINVAL;
} }
n = (struct tc_u_knode *)*arg; n = (struct tc_u_knode *)*arg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment