Commit 6e729175 authored by David S. Miller's avatar David S. Miller

Merge branch 'mlxsw-Various-small-fixes'

Jiri Pirko says:

====================
mlxsw: Various small fixes

This patch series is to contribute several fixes for nits that I noticed while
working on mlxsw. The changes range from typo fixes to local improvements of
the code and have little in common besides being small in scope.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 73a1ff59 213666a3
...@@ -3992,16 +3992,16 @@ MLXSW_ITEM32(reg, ritr, ipv4, 0x00, 29, 1); ...@@ -3992,16 +3992,16 @@ MLXSW_ITEM32(reg, ritr, ipv4, 0x00, 29, 1);
MLXSW_ITEM32(reg, ritr, ipv6, 0x00, 28, 1); MLXSW_ITEM32(reg, ritr, ipv6, 0x00, 28, 1);
enum mlxsw_reg_ritr_if_type { enum mlxsw_reg_ritr_if_type {
/* VLAN interface. */
MLXSW_REG_RITR_VLAN_IF, MLXSW_REG_RITR_VLAN_IF,
/* FID interface. */
MLXSW_REG_RITR_FID_IF, MLXSW_REG_RITR_FID_IF,
/* Sub-port interface. */
MLXSW_REG_RITR_SP_IF, MLXSW_REG_RITR_SP_IF,
}; };
/* reg_ritr_type /* reg_ritr_type
* Router interface type. * Router interface type as per enum mlxsw_reg_ritr_if_type.
* 0 - VLAN interface.
* 1 - FID interface.
* 2 - Sub-port interface.
* Access: RW * Access: RW
*/ */
MLXSW_ITEM32(reg, ritr, type, 0x00, 23, 3); MLXSW_ITEM32(reg, ritr, type, 0x00, 23, 3);
...@@ -4718,7 +4718,7 @@ MLXSW_ITEM32(reg, ralue, prefix_len, 0x08, 0, 8); ...@@ -4718,7 +4718,7 @@ MLXSW_ITEM32(reg, ralue, prefix_len, 0x08, 0, 8);
/* reg_ralue_dip* /* reg_ralue_dip*
* The prefix of the route or of the marker that the object of the LPM * The prefix of the route or of the marker that the object of the LPM
* is compared with. The most significant bits of the dip are the prefix. * is compared with. The most significant bits of the dip are the prefix.
* The list significant bits must be '0' if the prefix_len is smaller * The least significant bits must be '0' if the prefix_len is smaller
* than 128 for IPv6 or smaller than 32 for IPv4. * than 128 for IPv6 or smaller than 32 for IPv4.
* IPv4 address uses bits dip[31:0] and bits dip[127:32] are reserved. * IPv4 address uses bits dip[31:0] and bits dip[127:32] are reserved.
* Access: Index * Access: Index
...@@ -4813,7 +4813,7 @@ MLXSW_ITEM32(reg, ralue, ecmp_size, 0x28, 0, 13); ...@@ -4813,7 +4813,7 @@ MLXSW_ITEM32(reg, ralue, ecmp_size, 0x28, 0, 13);
*/ */
MLXSW_ITEM32(reg, ralue, local_erif, 0x24, 0, 16); MLXSW_ITEM32(reg, ralue, local_erif, 0x24, 0, 16);
/* reg_ralue_v /* reg_ralue_ip2me_v
* Valid bit for the tunnel_ptr field. * Valid bit for the tunnel_ptr field.
* If valid = 0 then trap to CPU as IP2ME trap ID. * If valid = 0 then trap to CPU as IP2ME trap ID.
* If valid = 1 and the packet format allows NVE or IPinIP tunnel * If valid = 1 and the packet format allows NVE or IPinIP tunnel
...@@ -4823,15 +4823,15 @@ MLXSW_ITEM32(reg, ralue, local_erif, 0x24, 0, 16); ...@@ -4823,15 +4823,15 @@ MLXSW_ITEM32(reg, ralue, local_erif, 0x24, 0, 16);
* Only relevant in case of IP2ME action. * Only relevant in case of IP2ME action.
* Access: RW * Access: RW
*/ */
MLXSW_ITEM32(reg, ralue, v, 0x24, 31, 1); MLXSW_ITEM32(reg, ralue, ip2me_v, 0x24, 31, 1);
/* reg_ralue_tunnel_ptr /* reg_ralue_ip2me_tunnel_ptr
* Tunnel Pointer for NVE or IPinIP tunnel decapsulation. * Tunnel Pointer for NVE or IPinIP tunnel decapsulation.
* For Spectrum, pointer to KVD Linear. * For Spectrum, pointer to KVD Linear.
* Only relevant in case of IP2ME action. * Only relevant in case of IP2ME action.
* Access: RW * Access: RW
*/ */
MLXSW_ITEM32(reg, ralue, tunnel_ptr, 0x24, 0, 24); MLXSW_ITEM32(reg, ralue, ip2me_tunnel_ptr, 0x24, 0, 24);
static inline void mlxsw_reg_ralue_pack(char *payload, static inline void mlxsw_reg_ralue_pack(char *payload,
enum mlxsw_reg_ralxx_protocol protocol, enum mlxsw_reg_ralxx_protocol protocol,
......
...@@ -369,7 +369,7 @@ int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp, ...@@ -369,7 +369,7 @@ int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp,
local_port = mlxsw_sp_port->local_port; local_port = mlxsw_sp_port->local_port;
in_port = false; in_port = false;
} else { } else {
/* If out_dev is NULL, the called wants to /* If out_dev is NULL, the caller wants to
* set forward to ingress port. * set forward to ingress port.
*/ */
local_port = 0; local_port = 0;
......
...@@ -1668,7 +1668,7 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp, ...@@ -1668,7 +1668,7 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
for (i = 0; i < nh_grp->count; i++) { for (i = 0; i < nh_grp->count; i++) {
nh = &nh_grp->nexthops[i]; nh = &nh_grp->nexthops[i];
if (nh->should_offload ^ nh->offloaded) { if (nh->should_offload != nh->offloaded) {
offload_change = true; offload_change = true;
if (nh->should_offload) if (nh->should_offload)
nh->update = 1; nh->update = 1;
...@@ -1752,9 +1752,9 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp, ...@@ -1752,9 +1752,9 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh, static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh,
bool removing) bool removing)
{ {
if (!removing && !nh->should_offload) if (!removing)
nh->should_offload = 1; nh->should_offload = 1;
else if (removing && nh->offloaded) else if (nh->offloaded)
nh->should_offload = 0; nh->should_offload = 0;
nh->update = 1; nh->update = 1;
} }
...@@ -1804,7 +1804,7 @@ static int mlxsw_sp_nexthop_neigh_init(struct mlxsw_sp *mlxsw_sp, ...@@ -1804,7 +1804,7 @@ static int mlxsw_sp_nexthop_neigh_init(struct mlxsw_sp *mlxsw_sp,
return 0; return 0;
/* Take a reference of neigh here ensuring that neigh would /* Take a reference of neigh here ensuring that neigh would
* not be detructed before the nexthop entry is finished. * not be destructed before the nexthop entry is finished.
* The reference is taken either in neigh_lookup() or * The reference is taken either in neigh_lookup() or
* in neigh_create() in case n is not found. * in neigh_create() in case n is not found.
*/ */
...@@ -3124,9 +3124,7 @@ mlxsw_sp_rif_should_config(struct mlxsw_sp_rif *rif, struct net_device *dev, ...@@ -3124,9 +3124,7 @@ mlxsw_sp_rif_should_config(struct mlxsw_sp_rif *rif, struct net_device *dev,
switch (event) { switch (event) {
case NETDEV_UP: case NETDEV_UP:
if (!rif) return rif == NULL;
return true;
return false;
case NETDEV_DOWN: case NETDEV_DOWN:
idev = __in_dev_get_rtnl(dev); idev = __in_dev_get_rtnl(dev);
if (idev && idev->ifa_list) if (idev && idev->ifa_list)
......
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