netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] mlxsw: Two small changes
@ 2020-04-19  7:01 Ido Schimmel
  2020-04-19  7:01 ` [PATCH net-next 1/2] mlxsw: spectrum_router: Re-increase scale of IPv6 nexthop groups Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2020-04-19  7:01 UTC (permalink / raw)
  To: netdev; +Cc: davem, jiri, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

Patch #1 increases the scale of supported IPv6 nexthops groups when each
group has one nexthop and all are using the same nexthop device, but
with a different gateway IP.

Patch #2 adjusts a register definition in accordance with recent
firmware changes.

Ido Schimmel (2):
  mlxsw: spectrum_router: Re-increase scale of IPv6 nexthop groups
  mlxsw: reg: Increase register field length to 13 bits

 drivers/net/ethernet/mellanox/mlxsw/reg.h             | 2 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

-- 
2.24.1


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

* [PATCH net-next 1/2] mlxsw: spectrum_router: Re-increase scale of IPv6 nexthop groups
  2020-04-19  7:01 [PATCH net-next 0/2] mlxsw: Two small changes Ido Schimmel
@ 2020-04-19  7:01 ` Ido Schimmel
  2020-04-19  7:01 ` [PATCH net-next 2/2] mlxsw: reg: Increase register field length to 13 bits Ido Schimmel
  2020-04-20 19:00 ` [PATCH net-next 0/2] mlxsw: Two small changes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2020-04-19  7:01 UTC (permalink / raw)
  To: netdev; +Cc: davem, jiri, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

As explained in commit fc25996e6f46 ("mlxsw: spectrum_router: Increase
scale of IPv6 nexthop groups"), each nexthop group is hashed by XOR-ing
the interface indexes of all the member nexthop devices.

To avoid many different nexthop groups ending up using the same key, the
above commit started hashing the interface indexes themselves before
they are XOR-ed.

However, in cases in which there are many nexthop groups that all use
the same nexthop device and only differ in the gateway IP, we can still
end up in a situation in which all the groups are using the same key.
This eventually leads to -EBUSY error from rhashtable during insertion.

Improve the situation by also making the gateway IP part of the key.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Alex Veber <alexve@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Tested-by: Alex Veber <alexve@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index d5bca1be3ef5..71aee4914619 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -2999,6 +2999,7 @@ static u32 mlxsw_sp_nexthop_group_hash_obj(const void *data, u32 len, u32 seed)
 		for (i = 0; i < nh_grp->count; i++) {
 			nh = &nh_grp->nexthops[i];
 			val ^= jhash(&nh->ifindex, sizeof(nh->ifindex), seed);
+			val ^= jhash(&nh->gw_addr, sizeof(nh->gw_addr), seed);
 		}
 		return jhash(&val, sizeof(val), seed);
 	default:
@@ -3012,11 +3013,14 @@ mlxsw_sp_nexthop6_group_hash(struct mlxsw_sp_fib6_entry *fib6_entry, u32 seed)
 {
 	unsigned int val = fib6_entry->nrt6;
 	struct mlxsw_sp_rt6 *mlxsw_sp_rt6;
-	struct net_device *dev;
 
 	list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) {
-		dev = mlxsw_sp_rt6->rt->fib6_nh->fib_nh_dev;
+		struct fib6_nh *fib6_nh = mlxsw_sp_rt6->rt->fib6_nh;
+		struct net_device *dev = fib6_nh->fib_nh_dev;
+		struct in6_addr *gw = &fib6_nh->fib_nh_gw6;
+
 		val ^= jhash(&dev->ifindex, sizeof(dev->ifindex), seed);
+		val ^= jhash(gw, sizeof(*gw), seed);
 	}
 
 	return jhash(&val, sizeof(val), seed);
-- 
2.24.1


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

* [PATCH net-next 2/2] mlxsw: reg: Increase register field length to 13 bits
  2020-04-19  7:01 [PATCH net-next 0/2] mlxsw: Two small changes Ido Schimmel
  2020-04-19  7:01 ` [PATCH net-next 1/2] mlxsw: spectrum_router: Re-increase scale of IPv6 nexthop groups Ido Schimmel
@ 2020-04-19  7:01 ` Ido Schimmel
  2020-04-20 19:00 ` [PATCH net-next 0/2] mlxsw: Two small changes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2020-04-19  7:01 UTC (permalink / raw)
  To: netdev; +Cc: davem, jiri, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

The Infrastructure Entry Delete Register (IEDR) is used to delete
entries stored in the KVD linear database. Currently, it is only
possible to delete entries of size up to 2048. Future firmware versions
will support deletion of entries of size up to 4096.

Increase the size of the field so that the driver will be able to
perform such deletions in the future, when required.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-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 9b39b8e70519..3c3db1c874b6 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -3203,7 +3203,7 @@ MLXSW_ITEM32_INDEXED(reg, iedr, rec_type, MLXSW_REG_IEDR_BASE_LEN, 24, 8,
  * Size of entries do be deleted. The unit is 1 entry, regardless of entry type.
  * Access: OP
  */
-MLXSW_ITEM32_INDEXED(reg, iedr, rec_size, MLXSW_REG_IEDR_BASE_LEN, 0, 11,
+MLXSW_ITEM32_INDEXED(reg, iedr, rec_size, MLXSW_REG_IEDR_BASE_LEN, 0, 13,
 		     MLXSW_REG_IEDR_REC_LEN, 0x00, false);
 
 /* reg_iedr_rec_index_start
-- 
2.24.1


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

* Re: [PATCH net-next 0/2] mlxsw: Two small changes
  2020-04-19  7:01 [PATCH net-next 0/2] mlxsw: Two small changes Ido Schimmel
  2020-04-19  7:01 ` [PATCH net-next 1/2] mlxsw: spectrum_router: Re-increase scale of IPv6 nexthop groups Ido Schimmel
  2020-04-19  7:01 ` [PATCH net-next 2/2] mlxsw: reg: Increase register field length to 13 bits Ido Schimmel
@ 2020-04-20 19:00 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-04-20 19:00 UTC (permalink / raw)
  To: idosch; +Cc: netdev, jiri, mlxsw, idosch

From: Ido Schimmel <idosch@idosch.org>
Date: Sun, 19 Apr 2020 10:01:04 +0300

> From: Ido Schimmel <idosch@mellanox.com>
> 
> Patch #1 increases the scale of supported IPv6 nexthops groups when each
> group has one nexthop and all are using the same nexthop device, but
> with a different gateway IP.
> 
> Patch #2 adjusts a register definition in accordance with recent
> firmware changes.

Series applied, thanks.

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

end of thread, other threads:[~2020-04-20 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19  7:01 [PATCH net-next 0/2] mlxsw: Two small changes Ido Schimmel
2020-04-19  7:01 ` [PATCH net-next 1/2] mlxsw: spectrum_router: Re-increase scale of IPv6 nexthop groups Ido Schimmel
2020-04-19  7:01 ` [PATCH net-next 2/2] mlxsw: reg: Increase register field length to 13 bits Ido Schimmel
2020-04-20 19:00 ` [PATCH net-next 0/2] mlxsw: Two small changes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).