aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sched/cls_u32.c23
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;