Commit c1fe922e authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

rocker: pass "learning" value as a parameter to rocker_port_set_learning

Be consistent with the rest of the setting functions, and pass
"learning" as a bool function parameter.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e420114e
...@@ -1583,6 +1583,7 @@ rocker_cmd_set_port_learning_prep(const struct rocker_port *rocker_port, ...@@ -1583,6 +1583,7 @@ rocker_cmd_set_port_learning_prep(const struct rocker_port *rocker_port,
struct rocker_desc_info *desc_info, struct rocker_desc_info *desc_info,
void *priv) void *priv)
{ {
bool learning = *(bool *)priv;
struct rocker_tlv *cmd_info; struct rocker_tlv *cmd_info;
if (rocker_tlv_put_u16(desc_info, ROCKER_TLV_CMD_TYPE, if (rocker_tlv_put_u16(desc_info, ROCKER_TLV_CMD_TYPE,
...@@ -1595,7 +1596,7 @@ rocker_cmd_set_port_learning_prep(const struct rocker_port *rocker_port, ...@@ -1595,7 +1596,7 @@ rocker_cmd_set_port_learning_prep(const struct rocker_port *rocker_port,
rocker_port->pport)) rocker_port->pport))
return -EMSGSIZE; return -EMSGSIZE;
if (rocker_tlv_put_u8(desc_info, ROCKER_TLV_CMD_PORT_SETTINGS_LEARNING, if (rocker_tlv_put_u8(desc_info, ROCKER_TLV_CMD_PORT_SETTINGS_LEARNING,
!!(rocker_port->brport_flags & BR_LEARNING))) learning))
return -EMSGSIZE; return -EMSGSIZE;
rocker_tlv_nest_end(desc_info, cmd_info); rocker_tlv_nest_end(desc_info, cmd_info);
return 0; return 0;
...@@ -1652,11 +1653,12 @@ static int rocker_cmd_set_port_settings_mtu(struct rocker_port *rocker_port, ...@@ -1652,11 +1653,12 @@ static int rocker_cmd_set_port_settings_mtu(struct rocker_port *rocker_port,
} }
static int rocker_port_set_learning(struct rocker_port *rocker_port, static int rocker_port_set_learning(struct rocker_port *rocker_port,
struct switchdev_trans *trans) struct switchdev_trans *trans,
bool learning)
{ {
return rocker_cmd_exec(rocker_port, trans, 0, return rocker_cmd_exec(rocker_port, trans, 0,
rocker_cmd_set_port_learning_prep, rocker_cmd_set_port_learning_prep,
NULL, NULL, NULL); &learning, NULL, NULL);
} }
/********************** /**********************
...@@ -4447,7 +4449,8 @@ static int rocker_port_brport_flags_set(struct rocker_port *rocker_port, ...@@ -4447,7 +4449,8 @@ static int rocker_port_brport_flags_set(struct rocker_port *rocker_port,
orig_flags = rocker_port->brport_flags; orig_flags = rocker_port->brport_flags;
rocker_port->brport_flags = brport_flags; rocker_port->brport_flags = brport_flags;
if ((orig_flags ^ rocker_port->brport_flags) & BR_LEARNING) if ((orig_flags ^ rocker_port->brport_flags) & BR_LEARNING)
err = rocker_port_set_learning(rocker_port, trans); err = rocker_port_set_learning(rocker_port, trans,
!!(rocker_port->brport_flags & BR_LEARNING));
if (switchdev_trans_ph_prepare(trans)) if (switchdev_trans_ph_prepare(trans))
rocker_port->brport_flags = orig_flags; rocker_port->brport_flags = orig_flags;
...@@ -5182,7 +5185,8 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number) ...@@ -5182,7 +5185,8 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
switchdev_port_fwd_mark_set(rocker_port->dev, NULL, false); switchdev_port_fwd_mark_set(rocker_port->dev, NULL, false);
rocker_port_set_learning(rocker_port, NULL); rocker_port_set_learning(rocker_port, NULL,
!!(rocker_port->brport_flags & BR_LEARNING));
err = rocker_port_ig_tbl(rocker_port, NULL, 0); err = rocker_port_ig_tbl(rocker_port, NULL, 0);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment