All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v1] flow_offload: improve extack msg for user when adding invalid filter
@ 2022-02-28 10:44 Baowen Zheng
  2022-02-28 13:27 ` Roi Dayan
  2022-03-02  1:55 ` Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Baowen Zheng @ 2022-02-28 10:44 UTC (permalink / raw)
  To: davem, kuba; +Cc: xiyou.wangcong, jhs, netdev, roid, oss-drivers, simon.horman

Add extack message to return exact message to user when adding invalid
filter with conflict flags for TC action.

In previous implement we just return EINVAL which is confusing for user.

Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
---
 net/sched/act_api.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index ca03e72..eb0d7bd 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -1446,6 +1446,8 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
 				continue;
 			if (skip_sw != tc_act_skip_sw(act->tcfa_flags) ||
 			    skip_hw != tc_act_skip_hw(act->tcfa_flags)) {
+				NL_SET_ERR_MSG(extack,
+					       "Conflict occurs for TC action and filter flags");
 				err = -EINVAL;
 				goto err;
 			}
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v1] flow_offload: improve extack msg for user when adding invalid filter
  2022-02-28 10:44 [PATCH net-next v1] flow_offload: improve extack msg for user when adding invalid filter Baowen Zheng
@ 2022-02-28 13:27 ` Roi Dayan
  2022-03-02  1:55 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Roi Dayan @ 2022-02-28 13:27 UTC (permalink / raw)
  To: Baowen Zheng, davem, kuba
  Cc: xiyou.wangcong, jhs, netdev, oss-drivers, simon.horman



On 2022-02-28 12:44 PM, Baowen Zheng wrote:
> Add extack message to return exact message to user when adding invalid
> filter with conflict flags for TC action.
> 
> In previous implement we just return EINVAL which is confusing for user.
> 
> Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
> ---
>   net/sched/act_api.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index ca03e72..eb0d7bd 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -1446,6 +1446,8 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
>   				continue;
>   			if (skip_sw != tc_act_skip_sw(act->tcfa_flags) ||
>   			    skip_hw != tc_act_skip_hw(act->tcfa_flags)) {
> +				NL_SET_ERR_MSG(extack,
> +					       "Conflict occurs for TC action and filter flags");
>   				err = -EINVAL;
>   				goto err;
>   			}

Reviewed-by: Roi Dayan <roid@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v1] flow_offload: improve extack msg for user when adding invalid filter
  2022-02-28 10:44 [PATCH net-next v1] flow_offload: improve extack msg for user when adding invalid filter Baowen Zheng
  2022-02-28 13:27 ` Roi Dayan
@ 2022-03-02  1:55 ` Jakub Kicinski
  2022-03-02  2:08   ` Baowen Zheng
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2022-03-02  1:55 UTC (permalink / raw)
  To: Baowen Zheng
  Cc: davem, xiyou.wangcong, jhs, netdev, roid, oss-drivers, simon.horman

On Mon, 28 Feb 2022 18:44:15 +0800 Baowen Zheng wrote:
> Add extack message to return exact message to user when adding invalid
> filter with conflict flags for TC action.
> 
> In previous implement we just return EINVAL which is confusing for user.
> 
> Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
> ---
>  net/sched/act_api.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index ca03e72..eb0d7bd 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -1446,6 +1446,8 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
>  				continue;
>  			if (skip_sw != tc_act_skip_sw(act->tcfa_flags) ||
>  			    skip_hw != tc_act_skip_hw(act->tcfa_flags)) {
> +				NL_SET_ERR_MSG(extack,
> +					       "Conflict occurs for TC action and filter flags");

Good improvement but I think we can reword a little, how about:

"Mismatch between action and filter offload flags" ?

>  				err = -EINVAL;
>  				goto err;
>  			}


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net-next v1] flow_offload: improve extack msg for user when adding invalid filter
  2022-03-02  1:55 ` Jakub Kicinski
@ 2022-03-02  2:08   ` Baowen Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Baowen Zheng @ 2022-03-02  2:08 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, xiyou.wangcong, jhs, netdev, roid, oss-drivers, Simon Horman

On Wednesday, March 2, 2022 9:56 AM, Jakub wrote:
>On Mon, 28 Feb 2022 18:44:15 +0800 Baowen Zheng wrote:
>> Add extack message to return exact message to user when adding invalid
>> filter with conflict flags for TC action.
>>
>> In previous implement we just return EINVAL which is confusing for user.
>>
>> Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
>> ---
>>  net/sched/act_api.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/net/sched/act_api.c b/net/sched/act_api.c index
>> ca03e72..eb0d7bd 100644
>> --- a/net/sched/act_api.c
>> +++ b/net/sched/act_api.c
>> @@ -1446,6 +1446,8 @@ int tcf_action_init(struct net *net, struct tcf_proto
>*tp, struct nlattr *nla,
>>  				continue;
>>  			if (skip_sw != tc_act_skip_sw(act->tcfa_flags) ||
>>  			    skip_hw != tc_act_skip_hw(act->tcfa_flags)) {
>> +				NL_SET_ERR_MSG(extack,
>> +					       "Conflict occurs for TC action and
>filter flags");
>
>Good improvement but I think we can reword a little, how about:
>
>"Mismatch between action and filter offload flags" ?
Thanks Jakub for your suggestion, to be honest I did not find a best way to make the msg more understandable. 
I think your description is more clear than mine. I will change as your advice.
>
>>  				err = -EINVAL;
>>  				goto err;
>>  			}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-02  2:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 10:44 [PATCH net-next v1] flow_offload: improve extack msg for user when adding invalid filter Baowen Zheng
2022-02-28 13:27 ` Roi Dayan
2022-03-02  1:55 ` Jakub Kicinski
2022-03-02  2:08   ` Baowen Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.