Skip to content

Commit

Permalink
Merge branch 'u32-hwoffload-fixes'
Browse files Browse the repository at this point in the history
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: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 7, 2016
2 parents 7b01b8e + d47a0f3 commit 064d5e6
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions net/sched/cls_u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,20 +457,21 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
struct tc_to_netdev offload;
int err;

if (!tc_should_offload(dev, flags))
return tc_skip_sw(flags) ? -EINVAL : 0;

offload.type = TC_SETUP_CLSU32;
offload.cls_u32 = &u32_offload;

if (tc_should_offload(dev, flags)) {
offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
offload.cls_u32->hnode.divisor = h->divisor;
offload.cls_u32->hnode.handle = h->handle;
offload.cls_u32->hnode.prio = h->prio;
offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
offload.cls_u32->hnode.divisor = h->divisor;
offload.cls_u32->hnode.handle = h->handle;
offload.cls_u32->hnode.prio = h->prio;

err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
tp->protocol, &offload);
if (tc_skip_sw(flags))
return err;
}
err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
tp->protocol, &offload);
if (tc_skip_sw(flags))
return err;

return 0;
}
Expand Down Expand Up @@ -863,7 +864,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
if (tb[TCA_U32_FLAGS]) {
flags = nla_get_u32(tb[TCA_U32_FLAGS]);
if (!tc_flags_valid(flags))
return err;
return -EINVAL;
}

n = (struct tc_u_knode *)*arg;
Expand Down

0 comments on commit 064d5e6

Please sign in to comment.