Thread (42 messages) read the whole thread 42 messages, 6 authors, 2021-08-03

Re: [PATCH net-next 2/3] flow_offload: add process to delete offloaded actions from net device

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2021-08-03 10:59:19

On 2021-07-22 5:19 a.m., Simon Horman wrote:

[..]

quoted hunk ↗ jump to hunk
  tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
  	      u32 portid, int event, struct netlink_ext_ack *extack)
  {
-	int i, ret;
  	struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
  	struct tc_action *act;
  	size_t attr_size = 0;
  	struct tc_action *actions[TCA_ACT_MAX_PRIO] = {};
+	struct flow_offload_action *fl_act;
+	int i, ret, fallback_num;
  
  	ret = nla_parse_nested_deprecated(tb, TCA_ACT_MAX_PRIO, nla, NULL,
  					  extack);
@@ -1492,7 +1568,9 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
  	if (event == RTM_GETACTION)
  		ret = tcf_get_notify(net, portid, n, actions, event, extack);
  	else { /* delete */
-		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;
It is hard to read from a patch context, but iiuc:
if the hardware update fails in tcf_action_offload_del_post() then
user space would still have been notified that it succeeded via
tcf_del_notify()... and there is no remediation after the fact.


cheers,
jamal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help