All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next 0/8] mlxsw: Various small fixes
@ 2017-07-31  7:27 Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 1/8] mlxsw: spectrum_acl: Fix a typo Jiri Pirko
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

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.

Petr Machata (8):
  mlxsw: spectrum_acl: Fix a typo
  mlxsw: reg.h: Fix a typo
  mlxsw: spectrum_router: Fix a typo
  mlxsw: Update specification of reg_ritr_type
  mlxsw: reg.h: Namespace IP2ME registers
  mlxsw: spectrum_router: Simplify a piece of code
  mlxsw: spectrum_router: Clarify a piece of code
  mlxsw: spectrum_router: Simplify a piece of code

 drivers/net/ethernet/mellanox/mlxsw/reg.h             | 18 +++++++++---------
 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c    |  2 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 12 +++++-------
 3 files changed, 15 insertions(+), 17 deletions(-)

-- 
2.9.3

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

* [patch net-next 1/8] mlxsw: spectrum_acl: Fix a typo
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 2/8] mlxsw: reg.h: " Jiri Pirko
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
index 01a1501..508b5fc 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
@@ -369,7 +369,7 @@ int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp,
 		local_port = mlxsw_sp_port->local_port;
 		in_port = false;
 	} else {
-		/* If out_dev is NULL, the called wants to
+		/* If out_dev is NULL, the caller wants to
 		 * set forward to ingress port.
 		 */
 		local_port = 0;
-- 
2.9.3

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

* [patch net-next 2/8] mlxsw: reg.h: Fix a typo
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 1/8] mlxsw: spectrum_acl: Fix a typo Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 3/8] mlxsw: spectrum_router: " Jiri Pirko
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index c6c50894..b4ea8cb 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -4718,7 +4718,7 @@ MLXSW_ITEM32(reg, ralue, prefix_len, 0x08, 0, 8);
 /* reg_ralue_dip*
  * 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.
- * 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.
  * IPv4 address uses bits dip[31:0] and bits dip[127:32] are reserved.
  * Access: Index
-- 
2.9.3

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

* [patch net-next 3/8] mlxsw: spectrum_router: Fix a typo
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 1/8] mlxsw: spectrum_acl: Fix a typo Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 2/8] mlxsw: reg.h: " Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 4/8] mlxsw: Update specification of reg_ritr_type Jiri Pirko
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 8bf076d..b6df3c3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -1804,7 +1804,7 @@ static int mlxsw_sp_nexthop_neigh_init(struct mlxsw_sp *mlxsw_sp,
 		return 0;
 
 	/* 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
 	 * in neigh_create() in case n is not found.
 	 */
-- 
2.9.3

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

* [patch net-next 4/8] mlxsw: Update specification of reg_ritr_type
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
                   ` (2 preceding siblings ...)
  2017-07-31  7:27 ` [patch net-next 3/8] mlxsw: spectrum_router: " Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 5/8] mlxsw: reg.h: Namespace IP2ME registers Jiri Pirko
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

The comments really belong to the individual enumerators. The comment
at the register should instead reference the enum.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index b4ea8cb..a671438 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -3992,16 +3992,16 @@ MLXSW_ITEM32(reg, ritr, ipv4, 0x00, 29, 1);
 MLXSW_ITEM32(reg, ritr, ipv6, 0x00, 28, 1);
 
 enum mlxsw_reg_ritr_if_type {
+	/* VLAN interface. */
 	MLXSW_REG_RITR_VLAN_IF,
+	/* FID interface. */
 	MLXSW_REG_RITR_FID_IF,
+	/* Sub-port interface. */
 	MLXSW_REG_RITR_SP_IF,
 };
 
 /* reg_ritr_type
- * Router interface type.
- * 0 - VLAN interface.
- * 1 - FID interface.
- * 2 - Sub-port interface.
+ * Router interface type as per enum mlxsw_reg_ritr_if_type.
  * Access: RW
  */
 MLXSW_ITEM32(reg, ritr, type, 0x00, 23, 3);
-- 
2.9.3

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

* [patch net-next 5/8] mlxsw: reg.h: Namespace IP2ME registers
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
                   ` (3 preceding siblings ...)
  2017-07-31  7:27 ` [patch net-next 4/8] mlxsw: Update specification of reg_ritr_type Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 6/8] mlxsw: spectrum_router: Simplify a piece of code Jiri Pirko
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

This renames IP2ME-specific registers reg_ralue_v and
reg_ralue_tunnel_ptr to reg_ralue_ip2me_*.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index a671438..7e8ba54 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -4813,7 +4813,7 @@ MLXSW_ITEM32(reg, ralue, ecmp_size, 0x28, 0, 13);
  */
 MLXSW_ITEM32(reg, ralue, local_erif, 0x24, 0, 16);
 
-/* reg_ralue_v
+/* reg_ralue_ip2me_v
  * Valid bit for the tunnel_ptr field.
  * If valid = 0 then trap to CPU as IP2ME trap ID.
  * 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);
  * Only relevant in case of IP2ME action.
  * 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.
  * For Spectrum, pointer to KVD Linear.
  * Only relevant in case of IP2ME action.
  * 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,
 					enum mlxsw_reg_ralxx_protocol protocol,
-- 
2.9.3

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

* [patch net-next 6/8] mlxsw: spectrum_router: Simplify a piece of code
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
                   ` (4 preceding siblings ...)
  2017-07-31  7:27 ` [patch net-next 5/8] mlxsw: reg.h: Namespace IP2ME registers Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 7/8] mlxsw: spectrum_router: Clarify " Jiri Pirko
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index b6df3c3..600268c 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -3124,9 +3124,7 @@ mlxsw_sp_rif_should_config(struct mlxsw_sp_rif *rif, struct net_device *dev,
 
 	switch (event) {
 	case NETDEV_UP:
-		if (!rif)
-			return true;
-		return false;
+		return rif == NULL;
 	case NETDEV_DOWN:
 		idev = __in_dev_get_rtnl(dev);
 		if (idev && idev->ifa_list)
-- 
2.9.3

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

* [patch net-next 7/8] mlxsw: spectrum_router: Clarify a piece of code
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
                   ` (5 preceding siblings ...)
  2017-07-31  7:27 ` [patch net-next 6/8] mlxsw: spectrum_router: Simplify a piece of code Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31  7:27 ` [patch net-next 8/8] mlxsw: spectrum_router: Simplify " Jiri Pirko
  2017-07-31 21:49 ` [patch net-next 0/8] mlxsw: Various small fixes David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

Prefer logical operator that expresses the intent to bitwise one that
happens to give the same result.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 600268c..c69efbd 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -1668,7 +1668,7 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
 	for (i = 0; i < nh_grp->count; i++) {
 		nh = &nh_grp->nexthops[i];
 
-		if (nh->should_offload ^ nh->offloaded) {
+		if (nh->should_offload != nh->offloaded) {
 			offload_change = true;
 			if (nh->should_offload)
 				nh->update = 1;
-- 
2.9.3

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

* [patch net-next 8/8] mlxsw: spectrum_router: Simplify a piece of code
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
                   ` (6 preceding siblings ...)
  2017-07-31  7:27 ` [patch net-next 7/8] mlxsw: spectrum_router: Clarify " Jiri Pirko
@ 2017-07-31  7:27 ` Jiri Pirko
  2017-07-31 21:49 ` [patch net-next 0/8] mlxsw: Various small fixes David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2017-07-31  7:27 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, petrm, mlxsw

From: Petr Machata <petrm@mellanox.com>

Express the same logic more succinctly.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index c69efbd..802f5b8 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -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,
 					    bool removing)
 {
-	if (!removing && !nh->should_offload)
+	if (!removing)
 		nh->should_offload = 1;
-	else if (removing && nh->offloaded)
+	else if (nh->offloaded)
 		nh->should_offload = 0;
 	nh->update = 1;
 }
-- 
2.9.3

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

* Re: [patch net-next 0/8] mlxsw: Various small fixes
  2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
                   ` (7 preceding siblings ...)
  2017-07-31  7:27 ` [patch net-next 8/8] mlxsw: spectrum_router: Simplify " Jiri Pirko
@ 2017-07-31 21:49 ` David Miller
  8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2017-07-31 21:49 UTC (permalink / raw)
  To: jiri; +Cc: netdev, idosch, petrm, mlxsw

From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 31 Jul 2017 09:27:22 +0200

> 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.

Series applied, thanks Jiri.

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

end of thread, other threads:[~2017-07-31 21:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-31  7:27 [patch net-next 0/8] mlxsw: Various small fixes Jiri Pirko
2017-07-31  7:27 ` [patch net-next 1/8] mlxsw: spectrum_acl: Fix a typo Jiri Pirko
2017-07-31  7:27 ` [patch net-next 2/8] mlxsw: reg.h: " Jiri Pirko
2017-07-31  7:27 ` [patch net-next 3/8] mlxsw: spectrum_router: " Jiri Pirko
2017-07-31  7:27 ` [patch net-next 4/8] mlxsw: Update specification of reg_ritr_type Jiri Pirko
2017-07-31  7:27 ` [patch net-next 5/8] mlxsw: reg.h: Namespace IP2ME registers Jiri Pirko
2017-07-31  7:27 ` [patch net-next 6/8] mlxsw: spectrum_router: Simplify a piece of code Jiri Pirko
2017-07-31  7:27 ` [patch net-next 7/8] mlxsw: spectrum_router: Clarify " Jiri Pirko
2017-07-31  7:27 ` [patch net-next 8/8] mlxsw: spectrum_router: Simplify " Jiri Pirko
2017-07-31 21:49 ` [patch net-next 0/8] mlxsw: Various small fixes David Miller

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.