mbox series

[net-next,00/14] net/sched: Better error reporting for offload failures

Message ID 20220407073533.2422896-1-idosch@nvidia.com (mailing list archive)
Headers show
Series net/sched: Better error reporting for offload failures | expand

Message

Ido Schimmel April 7, 2022, 7:35 a.m. UTC
This patchset improves error reporting to user space when offload fails
during the flow action setup phase. That is, when failures occur in the
actions themselves, even before calling device drivers. Requested /
reported in [1].

This is done by passing extack to the offload_act_setup() callback and
making use of it in the various actions.

Patches #1-#2 change matchall and flower to log error messages to user
space in accordance with the verbose flag.

Patch #3 passes extack to the offload_act_setup() callback from the
various call sites, including matchall and flower.

Patches #4-#11 make use of extack in the various actions to report
offload failures.

Patch #12 adds an error message when the action does not support offload
at all.

Patches #13-#14 change matchall and flower to stop overwriting more
specific error messages.

[1] https://lore.kernel.org/netdev/20220317185249.5mff5u2x624pjewv@skbuf/

Ido Schimmel (14):
  net/sched: matchall: Take verbose flag into account when logging error
    messages
  net/sched: flower: Take verbose flag into account when logging error
    messages
  net/sched: act_api: Add extack to offload_act_setup() callback
  net/sched: act_gact: Add extack messages for offload failure
  net/sched: act_mirred: Add extack message for offload failure
  net/sched: act_mpls: Add extack messages for offload failure
  net/sched: act_pedit: Add extack message for offload failure
  net/sched: act_police: Add extack messages for offload failure
  net/sched: act_skbedit: Add extack messages for offload failure
  net/sched: act_tunnel_key: Add extack message for offload failure
  net/sched: act_vlan: Add extack message for offload failure
  net/sched: cls_api: Add extack message for unsupported action offload
  net/sched: matchall: Avoid overwriting error messages
  net/sched: flower: Avoid overwriting error messages

 include/net/act_api.h           |  3 ++-
 include/net/pkt_cls.h           |  6 ++++--
 include/net/tc_act/tc_gact.h    | 15 +++++++++++++++
 include/net/tc_act/tc_skbedit.h | 12 ++++++++++++
 net/sched/act_api.c             |  4 ++--
 net/sched/act_csum.c            |  3 ++-
 net/sched/act_ct.c              |  3 ++-
 net/sched/act_gact.c            | 13 ++++++++++++-
 net/sched/act_gate.c            |  3 ++-
 net/sched/act_mirred.c          |  4 +++-
 net/sched/act_mpls.c            | 10 +++++++++-
 net/sched/act_pedit.c           |  4 +++-
 net/sched/act_police.c          | 20 ++++++++++++++++----
 net/sched/act_sample.c          |  3 ++-
 net/sched/act_skbedit.c         | 10 +++++++++-
 net/sched/act_tunnel_key.c      |  4 +++-
 net/sched/act_vlan.c            |  4 +++-
 net/sched/cls_api.c             | 22 ++++++++++++++--------
 net/sched/cls_flower.c          | 14 ++++++--------
 net/sched/cls_matchall.c        | 19 +++++++------------
 20 files changed, 128 insertions(+), 48 deletions(-)

Comments

Jamal Hadi Salim April 7, 2022, 9:15 p.m. UTC | #1
Excellent work.

Small comment, maybe a better message is:
"Failed to setup offload flow action"?

cheers,
jamal

On 2022-04-07 03:35, Ido Schimmel wrote:
> This patchset improves error reporting to user space when offload fails
> during the flow action setup phase. That is, when failures occur in the
> actions themselves, even before calling device drivers. Requested /
> reported in [1].
> 
> This is done by passing extack to the offload_act_setup() callback and
> making use of it in the various actions.
> 
> Patches #1-#2 change matchall and flower to log error messages to user
> space in accordance with the verbose flag.
> 
> Patch #3 passes extack to the offload_act_setup() callback from the
> various call sites, including matchall and flower.
> 
> Patches #4-#11 make use of extack in the various actions to report
> offload failures.
> 
> Patch #12 adds an error message when the action does not support offload
> at all.
> 
> Patches #13-#14 change matchall and flower to stop overwriting more
> specific error messages.
> 
> [1] https://lore.kernel.org/netdev/20220317185249.5mff5u2x624pjewv@skbuf/
> 
> Ido Schimmel (14):
>    net/sched: matchall: Take verbose flag into account when logging error
>      messages
>    net/sched: flower: Take verbose flag into account when logging error
>      messages
>    net/sched: act_api: Add extack to offload_act_setup() callback
>    net/sched: act_gact: Add extack messages for offload failure
>    net/sched: act_mirred: Add extack message for offload failure
>    net/sched: act_mpls: Add extack messages for offload failure
>    net/sched: act_pedit: Add extack message for offload failure
>    net/sched: act_police: Add extack messages for offload failure
>    net/sched: act_skbedit: Add extack messages for offload failure
>    net/sched: act_tunnel_key: Add extack message for offload failure
>    net/sched: act_vlan: Add extack message for offload failure
>    net/sched: cls_api: Add extack message for unsupported action offload
>    net/sched: matchall: Avoid overwriting error messages
>    net/sched: flower: Avoid overwriting error messages
> 
>   include/net/act_api.h           |  3 ++-
>   include/net/pkt_cls.h           |  6 ++++--
>   include/net/tc_act/tc_gact.h    | 15 +++++++++++++++
>   include/net/tc_act/tc_skbedit.h | 12 ++++++++++++
>   net/sched/act_api.c             |  4 ++--
>   net/sched/act_csum.c            |  3 ++-
>   net/sched/act_ct.c              |  3 ++-
>   net/sched/act_gact.c            | 13 ++++++++++++-
>   net/sched/act_gate.c            |  3 ++-
>   net/sched/act_mirred.c          |  4 +++-
>   net/sched/act_mpls.c            | 10 +++++++++-
>   net/sched/act_pedit.c           |  4 +++-
>   net/sched/act_police.c          | 20 ++++++++++++++++----
>   net/sched/act_sample.c          |  3 ++-
>   net/sched/act_skbedit.c         | 10 +++++++++-
>   net/sched/act_tunnel_key.c      |  4 +++-
>   net/sched/act_vlan.c            |  4 +++-
>   net/sched/cls_api.c             | 22 ++++++++++++++--------
>   net/sched/cls_flower.c          | 14 ++++++--------
>   net/sched/cls_matchall.c        | 19 +++++++------------
>   20 files changed, 128 insertions(+), 48 deletions(-)
>
patchwork-bot+netdevbpf@kernel.org April 8, 2022, 12:50 p.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu,  7 Apr 2022 10:35:19 +0300 you wrote:
> This patchset improves error reporting to user space when offload fails
> during the flow action setup phase. That is, when failures occur in the
> actions themselves, even before calling device drivers. Requested /
> reported in [1].
> 
> This is done by passing extack to the offload_act_setup() callback and
> making use of it in the various actions.
> 
> [...]

Here is the summary with links:
  - [net-next,01/14] net/sched: matchall: Take verbose flag into account when logging error messages
    https://git.kernel.org/netdev/net-next/c/4c096ea2d67c
  - [net-next,02/14] net/sched: flower: Take verbose flag into account when logging error messages
    https://git.kernel.org/netdev/net-next/c/11c95317bc1a
  - [net-next,03/14] net/sched: act_api: Add extack to offload_act_setup() callback
    https://git.kernel.org/netdev/net-next/c/c2ccf84ecb71
  - [net-next,04/14] net/sched: act_gact: Add extack messages for offload failure
    https://git.kernel.org/netdev/net-next/c/69642c2ab2f5
  - [net-next,05/14] net/sched: act_mirred: Add extack message for offload failure
    https://git.kernel.org/netdev/net-next/c/4dcaa50d0292
  - [net-next,06/14] net/sched: act_mpls: Add extack messages for offload failure
    https://git.kernel.org/netdev/net-next/c/bca3821d19d9
  - [net-next,07/14] net/sched: act_pedit: Add extack message for offload failure
    https://git.kernel.org/netdev/net-next/c/bf3b99e4f9ce
  - [net-next,08/14] net/sched: act_police: Add extack messages for offload failure
    https://git.kernel.org/netdev/net-next/c/b50e462bc22d
  - [net-next,09/14] net/sched: act_skbedit: Add extack messages for offload failure
    https://git.kernel.org/netdev/net-next/c/a9c64939b669
  - [net-next,10/14] net/sched: act_tunnel_key: Add extack message for offload failure
    https://git.kernel.org/netdev/net-next/c/ee367d44b936
  - [net-next,11/14] net/sched: act_vlan: Add extack message for offload failure
    https://git.kernel.org/netdev/net-next/c/f8fab3169464
  - [net-next,12/14] net/sched: cls_api: Add extack message for unsupported action offload
    https://git.kernel.org/netdev/net-next/c/c440615ffbcb
  - [net-next,13/14] net/sched: matchall: Avoid overwriting error messages
    https://git.kernel.org/netdev/net-next/c/0cba5c34b8f4
  - [net-next,14/14] net/sched: flower: Avoid overwriting error messages
    https://git.kernel.org/netdev/net-next/c/fd23e0e250c6

You are awesome, thank you!
Marcelo Ricardo Leitner April 8, 2022, 6:51 p.m. UTC | #3
On Thu, Apr 07, 2022 at 10:35:19AM +0300, Ido Schimmel wrote:
> This patchset improves error reporting to user space when offload fails
> during the flow action setup phase. That is, when failures occur in the
> actions themselves, even before calling device drivers. Requested /
> reported in [1].
> 
> This is done by passing extack to the offload_act_setup() callback and
> making use of it in the various actions.
> 
> Patches #1-#2 change matchall and flower to log error messages to user
> space in accordance with the verbose flag.
> 
> Patch #3 passes extack to the offload_act_setup() callback from the
> various call sites, including matchall and flower.
> 
> Patches #4-#11 make use of extack in the various actions to report
> offload failures.
> 
> Patch #12 adds an error message when the action does not support offload
> at all.
> 
> Patches #13-#14 change matchall and flower to stop overwriting more
> specific error messages.
> 
> [1] https://lore.kernel.org/netdev/20220317185249.5mff5u2x624pjewv@skbuf/

Seems like tc is almost becoming user friendly!? :)

post-merge review FWIW,
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>