Thread (22 messages) flat view 22 messages, 5 authors, 2018-01-29

Re: [PATCH net-next v2 00/12] net: sched: propagate extack to cls offloads on destroy and only with skip_sw

From: Jiri Pirko <jiri@resnulli.us>
Date: 2018-01-24 21:04:30

Wed, Jan 24, 2018 at 09:54:12PM CET, jakub.kicinski@netronome.com wrote:
Hi!

This series some of Jiri's comments and the fact that today drivers
may produce extack even if there is no skip_sw flag (meaning the
driver failure is not really a problem), and warning messages will
only confuse the users.

First patch propagates extack to destroy as requested by Jiri, extack
is then propagated to the driver callback for each classifier.  I chose
not to provide the extack on error paths.  As a rule of thumb it seems
best to keep the extack of the condition which caused the error.  E.g.

    err = this_will_fail(arg, extack);
    if (err) {
       undo_things(arg, NULL /* don't pass extack */);
return err;
    }

Note that NL_SET_ERR_MSG() will ignore the message if extack is NULL.
I was pondering whether we should make NL_SET_ERR_MSG() refuse to
overwrite the msg, but there seem to be cases in the tree where extack
is set like this:

    err = this_will_fail(arg, extack);
    if (err) {
       undo_things(arg, NULL /* don't pass extack */);
NL_SET_ERR_MSG(extack, "extack is set after undo call :/");
return err;
    }

I think not passing extack to undo calls is reasonable.

v2:
- rename the temporary tc_cls_common_offload_init().

Jakub Kicinski (12):
 net: sched: propagate extack to cls->destroy callbacks
 net: sched: prepare for reimplementation of
   tc_cls_common_offload_init()
 cls_bpf: remove gen_flags from bpf_offload
 cls_bpf: pass offload flags to tc_cls_common_offload_init()
 cls_bpf: propagate extack to offload delete callback
 cls_matchall: pass offload flags to tc_cls_common_offload_init()
 cls_matchall: propagate extack to delete callback
 cls_flower: pass offload flags to tc_cls_common_offload_init()
 cls_flower: propagate extack to delete callback
 cls_u32: pass offload flags to tc_cls_common_offload_init()
 cls_u32: propagate extack to delete callback
 net: sched: remove tc_cls_common_offload_init_deprecated()
For the record, I still think it is odd to have 6 patches just to add
one arg to a function. I wonder where this unnecessary patch splits
would lead to in the future.

Anyway, since apparently no one really cares, and the code result looks
good to me, for whole patchset:
Acked-by: Jiri Pirko <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help