Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-29 Thread Leon Romanovsky
On Thu, Jan 26, 2023 at 11:26:15PM -0800, Jakub Kicinski wrote: > On Fri, 27 Jan 2023 07:26:13 +0200 Leon Romanovsky wrote: > > > That'd be my preference too, FWIW. It's only the offload cases which > > > need this sort of fallback. > > > > Of course not, almost any error unwind path which sets

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-27 Thread Vladimir Oltean
On Fri, Jan 27, 2023 at 07:22:26AM +0200, Leon Romanovsky wrote: > It means changing ALL error unwind places where extack was forwarded > before to subfunctions. > > Places like this: > ret = func(..., extack) > if (ret) { >NL_SET_ERR_MSG_MOD... >return ret; > } > > will need to be cha

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Jakub Kicinski
On Fri, 27 Jan 2023 07:26:13 +0200 Leon Romanovsky wrote: > > That'd be my preference too, FWIW. It's only the offload cases which > > need this sort of fallback. > > Of course not, almost any error unwind path which sets extack will need it. I guess we can come up with scenarios where the new

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Leon Romanovsky
On Thu, Jan 26, 2023 at 02:37:23PM -0800, Jakub Kicinski wrote: > On Fri, 27 Jan 2023 00:32:13 +0200 Vladimir Oltean wrote: > > On Thu, Jan 26, 2023 at 09:15:03PM +0200, Leon Romanovsky wrote: > > > From: Leon Romanovsky > > > > > > In netdev common pattern, xxtack pointer is forwarded to the dri

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Leon Romanovsky
On Fri, Jan 27, 2023 at 12:32:13AM +0200, Vladimir Oltean wrote: > On Thu, Jan 26, 2023 at 09:15:03PM +0200, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > In netdev common pattern, xxtack pointer is forwarded to the drivers > ~~ >

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Jakub Kicinski
On Fri, 27 Jan 2023 00:44:57 +0200 Vladimir Oltean wrote: > On Thu, Jan 26, 2023 at 02:37:23PM -0800, Jakub Kicinski wrote: > > > I would somewhat prefer not doing this, and instead introducing a new > > > NL_SET_ERR_MSG_WEAK() of sorts. > > > > That'd be my preference too, FWIW. It's only the o

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Vladimir Oltean
On Thu, Jan 26, 2023 at 02:37:23PM -0800, Jakub Kicinski wrote: > > I would somewhat prefer not doing this, and instead introducing a new > > NL_SET_ERR_MSG_WEAK() of sorts. > > That'd be my preference too, FWIW. It's only the offload cases which > need this sort of fallback. > > BTW Vladimir, I

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Jakub Kicinski
On Fri, 27 Jan 2023 00:32:13 +0200 Vladimir Oltean wrote: > On Thu, Jan 26, 2023 at 09:15:03PM +0200, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > In netdev common pattern, xxtack pointer is forwarded to the drivers > ~~ >

Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Vladimir Oltean
On Thu, Jan 26, 2023 at 09:15:03PM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky > > In netdev common pattern, xxtack pointer is forwarded to the drivers ~~ extack > to be filled with error message. However, the caller can easil

[Bridge] [PATCH net-next] netlink: provide an ability to set default extack message

2023-01-26 Thread Leon Romanovsky
From: Leon Romanovsky In netdev common pattern, xxtack pointer is forwarded to the drivers to be filled with error message. However, the caller can easily overwrite the filled message. Instead of adding multiple "if (!extack->_msg)" checks before any NL_SET_ERR_MSG() call, which appears after ca