netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net 0/2] net: sched: couple of small fixes
@ 2018-08-27 18:58 Jiri Pirko
  2018-08-27 18:58 ` [patch net 1/2] net: sched: fix extack error message when chain is failed to be created Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jiri Pirko @ 2018-08-27 18:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, xiyou.wangcong, mrv, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

Jiri Pirko (2):
  net: sched: fix extack error message when chain is failed to be
    created
  net: sched: return -ENOENT when trying to remove filter from
    non-existent chain

 net/sched/cls_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.14.4

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

* [patch net 1/2] net: sched: fix extack error message when chain is failed to be created
  2018-08-27 18:58 [patch net 0/2] net: sched: couple of small fixes Jiri Pirko
@ 2018-08-27 18:58 ` Jiri Pirko
  2018-08-27 18:58 ` [patch net 2/2] net: sched: return -ENOENT when trying to remove filter from non-existent chain Jiri Pirko
  2018-08-27 20:44 ` [patch net 0/2] net: sched: couple of small fixes Cong Wang
  2 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2018-08-27 18:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, xiyou.wangcong, mrv, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

Instead "Cannot find" say "Cannot create".

Fixes: c35a4acc2985 ("net: sched: cls_api: handle generic cls errors")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/cls_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 31bd1439cf60..2d41c5b21b48 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1252,7 +1252,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
 	}
 	chain = tcf_chain_get(block, chain_index, true);
 	if (!chain) {
-		NL_SET_ERR_MSG(extack, "Cannot find specified filter chain");
+		NL_SET_ERR_MSG(extack, "Cannot create specified filter chain");
 		err = -ENOMEM;
 		goto errout;
 	}
-- 
2.14.4

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

* [patch net 2/2] net: sched: return -ENOENT when trying to remove filter from non-existent chain
  2018-08-27 18:58 [patch net 0/2] net: sched: couple of small fixes Jiri Pirko
  2018-08-27 18:58 ` [patch net 1/2] net: sched: fix extack error message when chain is failed to be created Jiri Pirko
@ 2018-08-27 18:58 ` Jiri Pirko
  2018-08-27 20:44 ` [patch net 0/2] net: sched: couple of small fixes Cong Wang
  2 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2018-08-27 18:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, xiyou.wangcong, mrv, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

When chain 0 was implicitly created, removal of non-existent filter from
chain 0 gave -ENOENT. Once chain 0 became non-implicit, the same call is
giving -EINVAL. Fix this by returning -ENOENT in that case.

Reported-by: Roman Mashak <mrv@mojatatu.com>
Fixes: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/cls_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 2d41c5b21b48..1a67af8a6e8c 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1399,7 +1399,7 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
 			goto errout;
 		}
 		NL_SET_ERR_MSG(extack, "Cannot find specified filter chain");
-		err = -EINVAL;
+		err = -ENOENT;
 		goto errout;
 	}
 
-- 
2.14.4

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

* Re: [patch net 0/2] net: sched: couple of small fixes
  2018-08-27 18:58 [patch net 0/2] net: sched: couple of small fixes Jiri Pirko
  2018-08-27 18:58 ` [patch net 1/2] net: sched: fix extack error message when chain is failed to be created Jiri Pirko
  2018-08-27 18:58 ` [patch net 2/2] net: sched: return -ENOENT when trying to remove filter from non-existent chain Jiri Pirko
@ 2018-08-27 20:44 ` Cong Wang
  2018-08-27 22:17   ` David Miller
  2 siblings, 1 reply; 5+ messages in thread
From: Cong Wang @ 2018-08-27 20:44 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Linux Kernel Network Developers, David Miller, Jamal Hadi Salim,
	Roman Mashak, mlxsw

On Mon, Aug 27, 2018 at 11:58 AM Jiri Pirko <jiri@resnulli.us> wrote:
>
> From: Jiri Pirko <jiri@mellanox.com>
>
> Jiri Pirko (2):
>   net: sched: fix extack error message when chain is failed to be
>     created
>   net: sched: return -ENOENT when trying to remove filter from
>     non-existent chain

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

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

* Re: [patch net 0/2] net: sched: couple of small fixes
  2018-08-27 20:44 ` [patch net 0/2] net: sched: couple of small fixes Cong Wang
@ 2018-08-27 22:17   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-08-27 22:17 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: jiri, netdev, jhs, mrv, mlxsw

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon, 27 Aug 2018 13:44:56 -0700

> On Mon, Aug 27, 2018 at 11:58 AM Jiri Pirko <jiri@resnulli.us> wrote:
>>
>> From: Jiri Pirko <jiri@mellanox.com>
>>
>> Jiri Pirko (2):
>>   net: sched: fix extack error message when chain is failed to be
>>     created
>>   net: sched: return -ENOENT when trying to remove filter from
>>     non-existent chain
> 
> Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Series applied.

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

end of thread, other threads:[~2018-08-28  2:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27 18:58 [patch net 0/2] net: sched: couple of small fixes Jiri Pirko
2018-08-27 18:58 ` [patch net 1/2] net: sched: fix extack error message when chain is failed to be created Jiri Pirko
2018-08-27 18:58 ` [patch net 2/2] net: sched: return -ENOENT when trying to remove filter from non-existent chain Jiri Pirko
2018-08-27 20:44 ` [patch net 0/2] net: sched: couple of small fixes Cong Wang
2018-08-27 22:17   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).