Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f868398 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

switchdev: rename SWITCHDEV_ATTR_* enum values to SWITCHDEV_ATTR_ID_*



To be aligned with obj.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57d80838
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ Switch ID
^^^^^^^^^

The switchdev driver must implement the switchdev op switchdev_port_attr_get
for SWITCHDEV_ATTR_PORT_PARENT_ID for each port netdev, returning the same
for SWITCHDEV_ATTR_ID_PORT_PARENT_ID for each port netdev, returning the same
physical ID for each port of a switch.  The ID must be unique between switches
on the same system.  The ID does not need to be unique between switches on
different systems.
@@ -233,8 +233,9 @@ the bridge's FDB. It's possible, but not optimal, to enable learning on the
device port and on the bridge port, and disable learning_sync.

To support learning and learning_sync port attributes, the driver implements
switchdev op switchdev_port_attr_get/set for SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS.
The driver should initialize the attributes to the hardware defaults.
switchdev op switchdev_port_attr_get/set for
SWITCHDEV_ATTR_PORT_ID_BRIDGE_FLAGS. The driver should initialize the attributes
to the hardware defaults.

FDB Ageing
^^^^^^^^^^
@@ -260,7 +261,7 @@ STP State Change on Port
Internally or with a third-party STP protocol implementation (e.g. mstpd), the
bridge driver maintains the STP state for ports, and will notify the switch
driver of STP state change on a port using the switchdev op
switchdev_attr_port_set for SWITCHDEV_ATTR_PORT_STP_UPDATE.
switchdev_attr_port_set for SWITCHDEV_ATTR_PORT_ID_STP_UPDATE.

State is one of BR_STATE_*.  The switch driver can use STP state updates to
update ingress packet filter list for the port.  For example, if port is
+1 −1
Original line number Diff line number Diff line
@@ -868,7 +868,7 @@ static int mlxsw_sx_port_attr_get(struct net_device *dev,
	struct mlxsw_sx *mlxsw_sx = mlxsw_sx_port->mlxsw_sx;

	switch (attr->id) {
	case SWITCHDEV_ATTR_PORT_PARENT_ID:
	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
		attr->u.ppid.id_len = sizeof(mlxsw_sx->hw_id);
		memcpy(&attr->u.ppid.id, &mlxsw_sx->hw_id, attr->u.ppid.id_len);
		break;
+4 −4
Original line number Diff line number Diff line
@@ -4329,11 +4329,11 @@ static int rocker_port_attr_get(struct net_device *dev,
	const struct rocker *rocker = rocker_port->rocker;

	switch (attr->id) {
	case SWITCHDEV_ATTR_PORT_PARENT_ID:
	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
		attr->u.ppid.id_len = sizeof(rocker->hw.id);
		memcpy(&attr->u.ppid.id, &rocker->hw.id, attr->u.ppid.id_len);
		break;
	case SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS:
	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
		attr->u.brport_flags = rocker_port->brport_flags;
		break;
	default:
@@ -4369,12 +4369,12 @@ static int rocker_port_attr_set(struct net_device *dev,
	int err = 0;

	switch (attr->id) {
	case SWITCHDEV_ATTR_PORT_STP_STATE:
	case SWITCHDEV_ATTR_ID_PORT_STP_STATE:
		err = rocker_port_stp_update(rocker_port, trans,
					     ROCKER_OP_FLAG_NOWAIT,
					     attr->u.stp_state);
		break;
	case SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS:
	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
		err = rocker_port_brport_flags_set(rocker_port, trans,
						   attr->u.brport_flags);
		break;
+4 −4
Original line number Diff line number Diff line
@@ -39,10 +39,10 @@ static inline bool switchdev_trans_ph_commit(struct switchdev_trans *trans)
}

enum switchdev_attr_id {
	SWITCHDEV_ATTR_UNDEFINED,
	SWITCHDEV_ATTR_PORT_PARENT_ID,
	SWITCHDEV_ATTR_PORT_STP_STATE,
	SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS,
	SWITCHDEV_ATTR_ID_UNDEFINED,
	SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
	SWITCHDEV_ATTR_ID_PORT_STP_STATE,
	SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
};

struct switchdev_attr {
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ void br_log_state(const struct net_bridge_port *p)
void br_set_state(struct net_bridge_port *p, unsigned int state)
{
	struct switchdev_attr attr = {
		.id = SWITCHDEV_ATTR_PORT_STP_STATE,
		.id = SWITCHDEV_ATTR_ID_PORT_STP_STATE,
		.u.stp_state = state,
	};
	int err;
Loading