All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danielle Ratson <danieller@mellanox.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, michael.chan@broadcom.com, kuba@kernel.org,
	jeffrey.t.kirsher@intel.com, saeedm@mellanox.com,
	leon@kernel.org, jiri@mellanox.com, idosch@mellanox.com,
	snelson@pensando.io, drivers@pensando.io, andrew@lunn.ch,
	vivien.didelot@gmail.com, f.fainelli@gmail.com,
	mlxsw@mellanox.com, Danielle Ratson <danieller@mellanox.com>
Subject: [RFC PATCH net-next 1/8] devlink: Move set attribute of devlink_port_attrs to devlink_port
Date: Tue,  2 Jun 2020 14:31:12 +0300	[thread overview]
Message-ID: <20200602113119.36665-2-danieller@mellanox.com> (raw)
In-Reply-To: <20200602113119.36665-1-danieller@mellanox.com>

The struct devlink_port_attrs holds the attributes of devlink_port.

The 'set' field is not devlink_port's attribute as opposed to most of the
others.

Move 'set' to be devlink_port's field called 'attrs_set'.

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
---
 include/net/devlink.h | 4 ++--
 net/core/devlink.c    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/net/devlink.h b/include/net/devlink.h
index 1df6dfec26c2..3e4efd51d5c5 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -65,8 +65,7 @@ struct devlink_port_pci_vf_attrs {
 };
 
 struct devlink_port_attrs {
-	u8 set:1,
-	   split:1,
+	u8 split:1,
 	   switch_port:1;
 	enum devlink_port_flavour flavour;
 	struct netdev_phys_item_id switch_id;
@@ -90,6 +89,7 @@ struct devlink_port {
 	enum devlink_port_type desired_type;
 	void *type_dev;
 	struct devlink_port_attrs attrs;
+	u8 attrs_set:1;
 	struct delayed_work type_warn_dw;
 };
 
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 2cafbc808b09..e5e594d15d3e 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -524,7 +524,7 @@ static int devlink_nl_port_attrs_put(struct sk_buff *msg,
 {
 	struct devlink_port_attrs *attrs = &devlink_port->attrs;
 
-	if (!attrs->set)
+	if (!devlink_port->attrs_set)
 		return 0;
 	if (nla_put_u16(msg, DEVLINK_ATTR_PORT_FLAVOUR, attrs->flavour))
 		return -EMSGSIZE;
@@ -7385,7 +7385,7 @@ static int __devlink_port_attrs_set(struct devlink_port *devlink_port,
 
 	if (WARN_ON(devlink_port->registered))
 		return -EEXIST;
-	attrs->set = true;
+	devlink_port->attrs_set = true;
 	attrs->flavour = flavour;
 	if (switch_id) {
 		attrs->switch_port = true;
@@ -7493,7 +7493,7 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
 	struct devlink_port_attrs *attrs = &devlink_port->attrs;
 	int n = 0;
 
-	if (!attrs->set)
+	if (!devlink_port->attrs_set)
 		return -EOPNOTSUPP;
 
 	switch (attrs->flavour) {
-- 
2.20.1


  reply	other threads:[~2020-06-02 11:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 11:31 [RFC PATCH net-next 0/8] Expose devlink port attributes Danielle Ratson
2020-06-02 11:31 ` Danielle Ratson [this message]
2020-06-02 11:31 ` [RFC PATCH net-next 2/8] devlink: Move switch_port attribute of devlink_port_attrs to devlink_port Danielle Ratson
2020-06-02 11:31 ` [RFC PATCH net-next 3/8] devlink: Replace devlink_port_attrs_set parameters with a struct Danielle Ratson
2020-06-02 11:31 ` [RFC PATCH net-next 4/8] mlxsw: Set number of port lanes attribute in driver Danielle Ratson
2020-06-02 11:31 ` [RFC PATCH net-next 5/8] devlink: Add a new devlink port lanes attribute and pass to netlink Danielle Ratson
2020-06-02 11:31 ` [RFC PATCH net-next 6/8] mlxsw: Set port split ability attribute in driver Danielle Ratson
2020-06-02 11:31 ` [RFC PATCH net-next 7/8] devlink: Add a new devlink port split ability attribute and pass to netlink Danielle Ratson
2020-06-02 11:31 ` [RFC PATCH net-next 8/8] selftests: net: Add port split test Danielle Ratson
2020-06-03 18:12   ` Florian Fainelli
2020-06-04  3:16     ` Jakub Kicinski
2020-06-04  4:01       ` Florian Fainelli
2020-06-04  9:44         ` Petr Machata
2020-06-02 16:21 ` [RFC PATCH net-next 0/8] Expose devlink port attributes Jakub Kicinski
2020-06-02 19:33 ` Jakub Kicinski
2020-06-03 10:45   ` Jiri Pirko
2020-06-04  2:48     ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200602113119.36665-2-danieller@mellanox.com \
    --to=danieller@mellanox.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=drivers@pensando.io \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=snelson@pensando.io \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.