diff options
author | David S. Miller <davem@davemloft.net> | 2016-06-07 19:27:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-07 19:27:15 -0400 |
commit | 064d5e6f8eedb071b81b72186f986fa390f7b164 (patch) | |
tree | 83500f19d807c4ae4eb94650c86e7bdef22b8dc7 /net | |
parent | 7b01b8e847d00cf9cf0c2c3aa8fdfc4126dca024 (diff) | |
parent | d47a0f387fe907bdb0430a398850c1cb80eb7def (diff) |
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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/cls_u32.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 079b43b3c5d2..fe05449537a3 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -457,20 +457,21 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, | |||
457 | struct tc_to_netdev offload; | 457 | struct tc_to_netdev offload; |
458 | int err; | 458 | int err; |
459 | 459 | ||
460 | if (!tc_should_offload(dev, flags)) | ||
461 | return tc_skip_sw(flags) ? -EINVAL : 0; | ||
462 | |||
460 | offload.type = TC_SETUP_CLSU32; | 463 | offload.type = TC_SETUP_CLSU32; |
461 | offload.cls_u32 = &u32_offload; | 464 | offload.cls_u32 = &u32_offload; |
462 | 465 | ||
463 | if (tc_should_offload(dev, flags)) { | 466 | offload.cls_u32->command = TC_CLSU32_NEW_HNODE; |
464 | offload.cls_u32->command = TC_CLSU32_NEW_HNODE; | 467 | offload.cls_u32->hnode.divisor = h->divisor; |
465 | offload.cls_u32->hnode.divisor = h->divisor; | 468 | offload.cls_u32->hnode.handle = h->handle; |
466 | offload.cls_u32->hnode.handle = h->handle; | 469 | offload.cls_u32->hnode.prio = h->prio; |
467 | offload.cls_u32->hnode.prio = h->prio; | ||
468 | 470 | ||
469 | err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, | 471 | err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, |
470 | tp->protocol, &offload); | 472 | tp->protocol, &offload); |
471 | if (tc_skip_sw(flags)) | 473 | if (tc_skip_sw(flags)) |
472 | return err; | 474 | return err; |
473 | } | ||
474 | 475 | ||
475 | return 0; | 476 | return 0; |
476 | } | 477 | } |
@@ -863,7 +864,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, | |||
863 | if (tb[TCA_U32_FLAGS]) { | 864 | if (tb[TCA_U32_FLAGS]) { |
864 | flags = nla_get_u32(tb[TCA_U32_FLAGS]); | 865 | flags = nla_get_u32(tb[TCA_U32_FLAGS]); |
865 | if (!tc_flags_valid(flags)) | 866 | if (!tc_flags_valid(flags)) |
866 | return err; | 867 | return -EINVAL; |
867 | } | 868 | } |
868 | 869 | ||
869 | n = (struct tc_u_knode *)*arg; | 870 | n = (struct tc_u_knode *)*arg; |