lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Aug 2021 09:01:45 -0400
From:   Jamal Hadi Salim <jhs@...atatu.com>
To:     Simon Horman <simon.horman@...igine.com>
Cc:     Vlad Buslov <vladbu@...dia.com>,
        David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...lanox.com>, netdev@...r.kernel.org,
        oss-drivers@...igine.com, Baowen Zheng <baowen.zheng@...igine.com>,
        Louis Peens <louis.peens@...igine.com>,
        Ido Schimmel <idosch@...dia.com>,
        Jiri Pirko <jiri@...nulli.us>, Roopa Prabhu <roopa@...dia.com>
Subject: Re: [PATCH net-next 1/3] flow_offload: allow user to offload tc
 action to net device

On 2021-08-03 8:31 a.m., Simon Horman wrote:
> On Tue, Aug 03, 2021 at 07:45:13AM -0400, Jamal Hadi Salim wrote:


> Thanks, I will look into this. But it would make my life slightly easier if
> 
> a) You could be more specific about what portion of cls_api you are
>     referring to.
> b) Constrained comments to a topic to a single sub-thread.
> 

Context, this was on the comment i made on 2/3 here:

-----
-        ret = tcf_del_notify(net, n, actions, portid, attr_size, extack);
+        tcf_action_offload_cmd_pre(actions, FLOW_ACT_DESTROY, extack, 
&fl_act);
+        ret = tcf_del_notify(net, n, actions, portid, attr_size, 
extack, &fallback_num);
+        tcf_action_offload_del_post(fl_act, actions, extack, fallback_num);
           if (ret)
               goto err;
----

where a notification goes to user space to say "success" but hardware
update fails.

If you look at fl_change() which does the offload you'll see that it
returns err on any of sw or hw failure (depending on request).
Notification of success is done in cls_api.c - example for 
creating/replacing with this snippet:

---
         err = tp->ops->change(net, skb, tp, cl, t->tcm_handle, tca, &fh,
                               flags, extack);
         if (err == 0) {
                 tfilter_notify(net, skb, n, tp, block, q, parent, fh,
                                RTM_NEWTFILTER, false, rtnl_held);
                 tfilter_put(tp, fh);
                 /* q pointer is NULL for shared blocks */
                 if (q)
                         q->flags &= ~TCQ_F_CAN_BYPASS;
         }
---

cheers,
jamal

Powered by blists - more mailing lists