Tue, Feb 23, 2016 at 08:02:33PM CET, john.fastab...@gmail.com wrote:
>The offload decision was originally very basic and tied to if the dev
>implemented the appropriate ndo op hook. The next step is to allow
>the user to more flexibly define if any paticular rule should be
>offloaded or not. In order to have this logic in one function lift
>the current check into a helper routine tc_should_offload().
>
>Signed-off-by: John Fastabend <john.r.fastab...@intel.com>
>---
> net/sched/cls_u32.c |   13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
>diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
>index d54bc94..1f31929 100644
>--- a/net/sched/cls_u32.c
>+++ b/net/sched/cls_u32.c
>@@ -425,6 +425,11 @@ static int u32_delete_key(struct tcf_proto *tp, struct 
>tc_u_knode *key)
>       return 0;
> }
> 
>+static bool u32_should_offload(struct net_device *dev)
>+{
>+      return dev->netdev_ops->ndo_setup_tc;
>+}
>+

This should be done in generic "dev_should_offload_tc" helper

Reply via email to