提交 064d5e6f 编写于 作者: D 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: NDavid S. Miller <davem@davemloft.net>
...@@ -457,20 +457,21 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, ...@@ -457,20 +457,21 @@ 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; offload.cls_u32->hnode.prio = h->prio;
offload.cls_u32->hnode.prio = h->prio;
err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册