netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] Devlink health fixes series
@ 2019-02-21 12:12 Eran Ben Elisha
  2019-02-21 12:12 ` [PATCH net-next 1/2] devlink: Rename devlink health attributes Eran Ben Elisha
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Eran Ben Elisha @ 2019-02-21 12:12 UTC (permalink / raw)
  To: netdev, David S. Miller; +Cc: Jiri Pirko, Aya Levin, Eran Ben Elisha

This series includes two small fixes from Aya for the devlink health
infrastructure introduced earlier in this window.

First patch rename some UAPI attributes to better reflect their use.
Second patch reduces the amount of data passed from the devlink to the
netlink layer upon get reporter command, in case of no-recovery reporter.

Aya Levin (2):
  devlink: Rename devlink health attributes
  devlink: Modify reply of DEVLINK_CMD_HEALTH_REPORTER_GET

 include/uapi/linux/devlink.h |  4 ++--
 net/core/devlink.c           | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

-- 
2.17.1


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

* [PATCH net-next 1/2] devlink: Rename devlink health attributes
  2019-02-21 12:12 [PATCH net-next 0/2] Devlink health fixes series Eran Ben Elisha
@ 2019-02-21 12:12 ` Eran Ben Elisha
  2019-02-21 12:31   ` Jiri Pirko
  2019-02-22  7:59   ` Sergei Shtylyov
  2019-02-21 12:12 ` [PATCH net-next 2/2] devlink: Modify reply of DEVLINK_CMD_HEALTH_REPORTER_GET Eran Ben Elisha
  2019-02-21 18:39 ` [PATCH net-next 0/2] Devlink health fixes series David Miller
  2 siblings, 2 replies; 6+ messages in thread
From: Eran Ben Elisha @ 2019-02-21 12:12 UTC (permalink / raw)
  To: netdev, David S. Miller; +Cc: Jiri Pirko, Aya Levin, Eran Ben Elisha

From: Aya Levin <ayal@mellanox.com>

Rename devlink health attributes for better reflect the attributes use.
Add COUNT prefix on error counter attribute and recovery counter
attribute.

Fixes: 7afe335a8bed ("devlink: Add health get command")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
 include/uapi/linux/devlink.h | 4 ++--
 net/core/devlink.c           | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 53de8802a000..5bb4ea67d84f 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -323,8 +323,8 @@ enum devlink_attr {
 	DEVLINK_ATTR_HEALTH_REPORTER,			/* nested */
 	DEVLINK_ATTR_HEALTH_REPORTER_NAME,		/* string */
 	DEVLINK_ATTR_HEALTH_REPORTER_STATE,		/* u8 */
-	DEVLINK_ATTR_HEALTH_REPORTER_ERR,		/* u64 */
-	DEVLINK_ATTR_HEALTH_REPORTER_RECOVER,		/* u64 */
+	DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT,		/* u64 */
+	DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT,	/* u64 */
 	DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS,		/* u64 */
 	DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD,	/* u64 */
 	DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER,	/* u8 */
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 04d98550c78c..5135997ecbe7 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4650,10 +4650,10 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg,
 	if (nla_put_u8(msg, DEVLINK_ATTR_HEALTH_REPORTER_STATE,
 		       reporter->health_state))
 		goto reporter_nest_cancel;
-	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_ERR,
+	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT,
 			      reporter->error_count, DEVLINK_ATTR_PAD))
 		goto reporter_nest_cancel;
-	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_RECOVER,
+	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT,
 			      reporter->recovery_count, DEVLINK_ATTR_PAD))
 		goto reporter_nest_cancel;
 	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD,
-- 
2.17.1


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

* [PATCH net-next 2/2] devlink: Modify reply of DEVLINK_CMD_HEALTH_REPORTER_GET
  2019-02-21 12:12 [PATCH net-next 0/2] Devlink health fixes series Eran Ben Elisha
  2019-02-21 12:12 ` [PATCH net-next 1/2] devlink: Rename devlink health attributes Eran Ben Elisha
@ 2019-02-21 12:12 ` Eran Ben Elisha
  2019-02-21 18:39 ` [PATCH net-next 0/2] Devlink health fixes series David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Eran Ben Elisha @ 2019-02-21 12:12 UTC (permalink / raw)
  To: netdev, David S. Miller; +Cc: Jiri Pirko, Aya Levin, Eran Ben Elisha

From: Aya Levin <ayal@mellanox.com>

Avoid sending attributes related to recovery:
DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD and
DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER in reply to
DEVLINK_CMD_HEALTH_REPORTER_GET for a reporter which didn't register a
recover operation.
These parameters can't be configured on a reporter that did not provide
a recover operation, thus not needed to return them.

Fixes: 7afe335a8bed ("devlink: Add health get command")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
 net/core/devlink.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 5135997ecbe7..4f31ddc883e7 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4656,11 +4656,13 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg,
 	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT,
 			      reporter->recovery_count, DEVLINK_ATTR_PAD))
 		goto reporter_nest_cancel;
-	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD,
+	if (reporter->ops->recover &&
+	    nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD,
 			      reporter->graceful_period,
 			      DEVLINK_ATTR_PAD))
 		goto reporter_nest_cancel;
-	if (nla_put_u8(msg, DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER,
+	if (reporter->ops->recover &&
+	    nla_put_u8(msg, DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER,
 		       reporter->auto_recover))
 		goto reporter_nest_cancel;
 	if (reporter->dump_fmsg &&
-- 
2.17.1


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

* Re: [PATCH net-next 1/2] devlink: Rename devlink health attributes
  2019-02-21 12:12 ` [PATCH net-next 1/2] devlink: Rename devlink health attributes Eran Ben Elisha
@ 2019-02-21 12:31   ` Jiri Pirko
  2019-02-22  7:59   ` Sergei Shtylyov
  1 sibling, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2019-02-21 12:31 UTC (permalink / raw)
  To: Eran Ben Elisha; +Cc: netdev, David S. Miller, Jiri Pirko, Aya Levin

Thu, Feb 21, 2019 at 01:12:01PM CET, eranbe@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>Rename devlink health attributes for better reflect the attributes use.
>Add COUNT prefix on error counter attribute and recovery counter
>attribute.
>
>Fixes: 7afe335a8bed ("devlink: Add health get command")
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
>Acked-by: Jiri Pirko <jiri@mellanox.com>
>---
> include/uapi/linux/devlink.h | 4 ++--
> net/core/devlink.c           | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
>index 53de8802a000..5bb4ea67d84f 100644
>--- a/include/uapi/linux/devlink.h
>+++ b/include/uapi/linux/devlink.h
>@@ -323,8 +323,8 @@ enum devlink_attr {
> 	DEVLINK_ATTR_HEALTH_REPORTER,			/* nested */
> 	DEVLINK_ATTR_HEALTH_REPORTER_NAME,		/* string */
> 	DEVLINK_ATTR_HEALTH_REPORTER_STATE,		/* u8 */
>-	DEVLINK_ATTR_HEALTH_REPORTER_ERR,		/* u64 */
>-	DEVLINK_ATTR_HEALTH_REPORTER_RECOVER,		/* u64 */
>+	DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT,		/* u64 */
>+	DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT,	/* u64 */

Just note, this is still in net-next only, so it is okay to change it.


> 	DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS,		/* u64 */
> 	DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD,	/* u64 */
> 	DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER,	/* u8 */
>diff --git a/net/core/devlink.c b/net/core/devlink.c
>index 04d98550c78c..5135997ecbe7 100644
>--- a/net/core/devlink.c
>+++ b/net/core/devlink.c
>@@ -4650,10 +4650,10 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg,
> 	if (nla_put_u8(msg, DEVLINK_ATTR_HEALTH_REPORTER_STATE,
> 		       reporter->health_state))
> 		goto reporter_nest_cancel;
>-	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_ERR,
>+	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT,
> 			      reporter->error_count, DEVLINK_ATTR_PAD))
> 		goto reporter_nest_cancel;
>-	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_RECOVER,
>+	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT,
> 			      reporter->recovery_count, DEVLINK_ATTR_PAD))
> 		goto reporter_nest_cancel;
> 	if (nla_put_u64_64bit(msg, DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD,
>-- 
>2.17.1
>

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

* Re: [PATCH net-next 0/2] Devlink health fixes series
  2019-02-21 12:12 [PATCH net-next 0/2] Devlink health fixes series Eran Ben Elisha
  2019-02-21 12:12 ` [PATCH net-next 1/2] devlink: Rename devlink health attributes Eran Ben Elisha
  2019-02-21 12:12 ` [PATCH net-next 2/2] devlink: Modify reply of DEVLINK_CMD_HEALTH_REPORTER_GET Eran Ben Elisha
@ 2019-02-21 18:39 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-02-21 18:39 UTC (permalink / raw)
  To: eranbe; +Cc: netdev, jiri, ayal

From: Eran Ben Elisha <eranbe@mellanox.com>
Date: Thu, 21 Feb 2019 14:12:00 +0200

> This series includes two small fixes from Aya for the devlink health
> infrastructure introduced earlier in this window.
> 
> First patch rename some UAPI attributes to better reflect their use.
> Second patch reduces the amount of data passed from the devlink to the
> netlink layer upon get reporter command, in case of no-recovery reporter.

Series applied, thanks.

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

* Re: [PATCH net-next 1/2] devlink: Rename devlink health attributes
  2019-02-21 12:12 ` [PATCH net-next 1/2] devlink: Rename devlink health attributes Eran Ben Elisha
  2019-02-21 12:31   ` Jiri Pirko
@ 2019-02-22  7:59   ` Sergei Shtylyov
  1 sibling, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2019-02-22  7:59 UTC (permalink / raw)
  To: Eran Ben Elisha, netdev, David S. Miller; +Cc: Jiri Pirko, Aya Levin

Hello!

On 21.02.2019 15:12, Eran Ben Elisha wrote:

> From: Aya Levin <ayal@mellanox.com>
> 
> Rename devlink health attributes for better reflect the attributes use.

    s/for/to/.

> Add COUNT prefix on error counter attribute and recovery counter
> attribute.
> 
> Fixes: 7afe335a8bed ("devlink: Add health get command")
> Signed-off-by: Aya Levin <ayal@mellanox.com>
> Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
> Acked-by: Jiri Pirko <jiri@mellanox.com>
[...]

MBR, Sergei

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

end of thread, other threads:[~2019-02-22  8:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 12:12 [PATCH net-next 0/2] Devlink health fixes series Eran Ben Elisha
2019-02-21 12:12 ` [PATCH net-next 1/2] devlink: Rename devlink health attributes Eran Ben Elisha
2019-02-21 12:31   ` Jiri Pirko
2019-02-22  7:59   ` Sergei Shtylyov
2019-02-21 12:12 ` [PATCH net-next 2/2] devlink: Modify reply of DEVLINK_CMD_HEALTH_REPORTER_GET Eran Ben Elisha
2019-02-21 18:39 ` [PATCH net-next 0/2] Devlink health fixes series 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).