* [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable
@ 2023-03-24 8:06 Oleksij Rempel
2023-03-24 8:06 ` [PATCH net v2 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() Oleksij Rempel
` (6 more replies)
0 siblings, 7 replies; 14+ messages in thread
From: Oleksij Rempel @ 2023-03-24 8:06 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: Oleksij Rempel, kernel, linux-kernel, netdev, UNGLinuxDriver
changes v2:
- use proper Fixes tag
- add Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> on all
reviewed patches except the ksz8863_smi patch.
These fixes address issues such as incomplete FDB extraction, incorrect
FID extraction and configuration, incorrect timestamp extraction, and
ghost entry extraction from an empty dynamic MAC table. These updates
ensure proper functioning of the FDB/MDB functionality for the
ksz8863/ksz8873 series of chips.
Oleksij Rempel (6):
net: dsa: microchip: ksz8: fix ksz8_fdb_dump()
net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024
entries
net: dsa: microchip: ksz8: fix offset for the timestamp filed
net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry
from empty dynamic MAC table.
net: dsa: microchip: ksz8863_smi: fix bulk access
net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID
drivers/net/dsa/microchip/ksz8795.c | 11 +++++------
drivers/net/dsa/microchip/ksz8863_smi.c | 9 ---------
drivers/net/dsa/microchip/ksz_common.c | 12 ++++++------
3 files changed, 11 insertions(+), 21 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net v2 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump()
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
@ 2023-03-24 8:06 ` Oleksij Rempel
2023-03-24 22:19 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries Oleksij Rempel
` (5 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Oleksij Rempel @ 2023-03-24 8:06 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: Oleksij Rempel, kernel, linux-kernel, netdev, UNGLinuxDriver
Before this patch, the ksz8_fdb_dump() function had several issues, such
as uninitialized variables and incorrect usage of source port as a bit
mask. These problems caused inaccurate reporting of vid information and
port assignment in the bridge fdb.
Fixes: e587be759e6e ("net: dsa: microchip: update fdb add/del/dump in ksz_common")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/dsa/microchip/ksz8795.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index 003b0ac2854c..3fffd5da8d3b 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -958,15 +958,14 @@ int ksz8_fdb_dump(struct ksz_device *dev, int port,
u16 entries = 0;
u8 timestamp = 0;
u8 fid;
- u8 member;
- struct alu_struct alu;
+ u8 src_port;
+ u8 mac[ETH_ALEN];
do {
- alu.is_static = false;
- ret = ksz8_r_dyn_mac_table(dev, i, alu.mac, &fid, &member,
+ ret = ksz8_r_dyn_mac_table(dev, i, mac, &fid, &src_port,
×tamp, &entries);
- if (!ret && (member & BIT(port))) {
- ret = cb(alu.mac, alu.fid, alu.is_static, data);
+ if (!ret && port == src_port) {
+ ret = cb(mac, fid, false, data);
if (ret)
break;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net v2 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
2023-03-24 8:06 ` [PATCH net v2 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() Oleksij Rempel
@ 2023-03-24 8:06 ` Oleksij Rempel
2023-03-24 22:19 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed Oleksij Rempel
` (4 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Oleksij Rempel @ 2023-03-24 8:06 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: Oleksij Rempel, kernel, linux-kernel, netdev, UNGLinuxDriver
Current ksz8_fdb_dump() is able to extract only max 249 entries on
the ksz8863/ksz8873 series of switches. This happened due to wrong
bit mask and offset calculation.
This commit corrects the issue and allows for the complete extraction of
all 1024 entries.
Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/dsa/microchip/ksz_common.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 7fc2155d93d6..3a1afc9f4621 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -407,10 +407,10 @@ static const u32 ksz8863_masks[] = {
[STATIC_MAC_TABLE_FID] = GENMASK(29, 26),
[STATIC_MAC_TABLE_OVERRIDE] = BIT(20),
[STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(18, 16),
- [DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(5, 0),
+ [DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(1, 0),
[DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(7),
[DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7),
- [DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 28),
+ [DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 24),
[DYNAMIC_MAC_TABLE_FID] = GENMASK(19, 16),
[DYNAMIC_MAC_TABLE_SRC_PORT] = GENMASK(21, 20),
[DYNAMIC_MAC_TABLE_TIMESTAMP] = GENMASK(23, 22),
@@ -420,7 +420,7 @@ static u8 ksz8863_shifts[] = {
[VLAN_TABLE_MEMBERSHIP_S] = 16,
[STATIC_MAC_FWD_PORTS] = 16,
[STATIC_MAC_FID] = 22,
- [DYNAMIC_MAC_ENTRIES_H] = 3,
+ [DYNAMIC_MAC_ENTRIES_H] = 8,
[DYNAMIC_MAC_ENTRIES] = 24,
[DYNAMIC_MAC_FID] = 16,
[DYNAMIC_MAC_TIMESTAMP] = 24,
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net v2 3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
2023-03-24 8:06 ` [PATCH net v2 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() Oleksij Rempel
2023-03-24 8:06 ` [PATCH net v2 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries Oleksij Rempel
@ 2023-03-24 8:06 ` Oleksij Rempel
2023-03-24 22:20 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table Oleksij Rempel
` (3 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Oleksij Rempel @ 2023-03-24 8:06 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: Oleksij Rempel, kernel, linux-kernel, netdev, UNGLinuxDriver
We are using wrong offset, so we will get not a timestamp.
Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/dsa/microchip/ksz_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 3a1afc9f4621..c914449645ca 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -423,7 +423,7 @@ static u8 ksz8863_shifts[] = {
[DYNAMIC_MAC_ENTRIES_H] = 8,
[DYNAMIC_MAC_ENTRIES] = 24,
[DYNAMIC_MAC_FID] = 16,
- [DYNAMIC_MAC_TIMESTAMP] = 24,
+ [DYNAMIC_MAC_TIMESTAMP] = 22,
[DYNAMIC_MAC_SRC_PORT] = 20,
};
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net v2 4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table.
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
` (2 preceding siblings ...)
2023-03-24 8:06 ` [PATCH net v2 3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed Oleksij Rempel
@ 2023-03-24 8:06 ` Oleksij Rempel
2023-03-24 22:20 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 5/6] net: dsa: microchip: ksz8863_smi: fix bulk access Oleksij Rempel
` (2 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Oleksij Rempel @ 2023-03-24 8:06 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: Oleksij Rempel, kernel, linux-kernel, netdev, UNGLinuxDriver
If the dynamic MAC table is empty, we will still extract one outdated
entry. Fix it by using correct bit offset.
Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/dsa/microchip/ksz_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index c914449645ca..4929fb29ed06 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -408,7 +408,7 @@ static const u32 ksz8863_masks[] = {
[STATIC_MAC_TABLE_OVERRIDE] = BIT(20),
[STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(18, 16),
[DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(1, 0),
- [DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(7),
+ [DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(2),
[DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7),
[DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 24),
[DYNAMIC_MAC_TABLE_FID] = GENMASK(19, 16),
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net v2 5/6] net: dsa: microchip: ksz8863_smi: fix bulk access
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
` (3 preceding siblings ...)
2023-03-24 8:06 ` [PATCH net v2 4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table Oleksij Rempel
@ 2023-03-24 8:06 ` Oleksij Rempel
2023-03-24 22:21 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 6/6] net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID Oleksij Rempel
2023-03-25 11:31 ` [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable patchwork-bot+netdevbpf
6 siblings, 1 reply; 14+ messages in thread
From: Oleksij Rempel @ 2023-03-24 8:06 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: Oleksij Rempel, kernel, linux-kernel, netdev, UNGLinuxDriver
Current regmap bulk access is broken, resulting to wrong reads/writes
if ksz_read64/ksz_write64 functions are used.
Mostly this issue was visible by using ksz8_fdb_dump(), which returned
corrupt MAC address.
The reason is that regmap was configured to have max_raw_read/write,
even if ksz8863_mdio_read/write functions are able to handle unlimited
read/write accesses. On ksz_read64 function we are using multiple 32bit
accesses by incrementing each access by 1 instead of 4. Resulting buffer
had 01234567.12345678 instead of 01234567.89abcdef.
We have multiple ways to fix it:
- enable 4 byte alignment for 32bit accesses. Since the HW do not have
this requirement. It will break driver.
- disable max_raw_* limit.
This patch is removing max_raw_* limit for regmap accesses in ksz8863_smi.
Fixes: 60a364760002 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
drivers/net/dsa/microchip/ksz8863_smi.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz8863_smi.c b/drivers/net/dsa/microchip/ksz8863_smi.c
index 2f4623f3bd85..3698112138b7 100644
--- a/drivers/net/dsa/microchip/ksz8863_smi.c
+++ b/drivers/net/dsa/microchip/ksz8863_smi.c
@@ -82,22 +82,16 @@ static const struct regmap_bus regmap_smi[] = {
{
.read = ksz8863_mdio_read,
.write = ksz8863_mdio_write,
- .max_raw_read = 1,
- .max_raw_write = 1,
},
{
.read = ksz8863_mdio_read,
.write = ksz8863_mdio_write,
.val_format_endian_default = REGMAP_ENDIAN_BIG,
- .max_raw_read = 2,
- .max_raw_write = 2,
},
{
.read = ksz8863_mdio_read,
.write = ksz8863_mdio_write,
.val_format_endian_default = REGMAP_ENDIAN_BIG,
- .max_raw_read = 4,
- .max_raw_write = 4,
}
};
@@ -108,7 +102,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
.pad_bits = 24,
.val_bits = 8,
.cache_type = REGCACHE_NONE,
- .use_single_read = 1,
.lock = ksz_regmap_lock,
.unlock = ksz_regmap_unlock,
},
@@ -118,7 +111,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
.pad_bits = 24,
.val_bits = 16,
.cache_type = REGCACHE_NONE,
- .use_single_read = 1,
.lock = ksz_regmap_lock,
.unlock = ksz_regmap_unlock,
},
@@ -128,7 +120,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
.pad_bits = 24,
.val_bits = 32,
.cache_type = REGCACHE_NONE,
- .use_single_read = 1,
.lock = ksz_regmap_lock,
.unlock = ksz_regmap_unlock,
}
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net v2 6/6] net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
` (4 preceding siblings ...)
2023-03-24 8:06 ` [PATCH net v2 5/6] net: dsa: microchip: ksz8863_smi: fix bulk access Oleksij Rempel
@ 2023-03-24 8:06 ` Oleksij Rempel
2023-03-24 22:21 ` Florian Fainelli
2023-03-25 11:31 ` [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable patchwork-bot+netdevbpf
6 siblings, 1 reply; 14+ messages in thread
From: Oleksij Rempel @ 2023-03-24 8:06 UTC (permalink / raw)
To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: Oleksij Rempel, kernel, linux-kernel, netdev, UNGLinuxDriver
FID is directly mapped to VID. However, configuring a MAC address with a
VID != 0 resulted in incorrect configuration due to an incorrect bit
mask. This kernel commit fixed the issue by correcting the bit mask and
ensuring proper configuration of MAC addresses with non-zero VID.
Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/dsa/microchip/ksz_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 4929fb29ed06..74c56d05ab0b 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -404,7 +404,7 @@ static const u32 ksz8863_masks[] = {
[VLAN_TABLE_VALID] = BIT(19),
[STATIC_MAC_TABLE_VALID] = BIT(19),
[STATIC_MAC_TABLE_USE_FID] = BIT(21),
- [STATIC_MAC_TABLE_FID] = GENMASK(29, 26),
+ [STATIC_MAC_TABLE_FID] = GENMASK(25, 22),
[STATIC_MAC_TABLE_OVERRIDE] = BIT(20),
[STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(18, 16),
[DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(1, 0),
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net v2 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump()
2023-03-24 8:06 ` [PATCH net v2 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() Oleksij Rempel
@ 2023-03-24 22:19 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-03-24 22:19 UTC (permalink / raw)
To: Oleksij Rempel, David S. Miller, Andrew Lunn, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: kernel, linux-kernel, netdev, UNGLinuxDriver
On 3/24/23 01:06, Oleksij Rempel wrote:
> Before this patch, the ksz8_fdb_dump() function had several issues, such
> as uninitialized variables and incorrect usage of source port as a bit
> mask. These problems caused inaccurate reporting of vid information and
> port assignment in the bridge fdb.
>
> Fixes: e587be759e6e ("net: dsa: microchip: update fdb add/del/dump in ksz_common")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net v2 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries
2023-03-24 8:06 ` [PATCH net v2 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries Oleksij Rempel
@ 2023-03-24 22:19 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-03-24 22:19 UTC (permalink / raw)
To: Oleksij Rempel, David S. Miller, Andrew Lunn, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: kernel, linux-kernel, netdev, UNGLinuxDriver
On 3/24/23 01:06, Oleksij Rempel wrote:
> Current ksz8_fdb_dump() is able to extract only max 249 entries on
> the ksz8863/ksz8873 series of switches. This happened due to wrong
> bit mask and offset calculation.
>
> This commit corrects the issue and allows for the complete extraction of
> all 1024 entries.
>
> Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net v2 3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed
2023-03-24 8:06 ` [PATCH net v2 3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed Oleksij Rempel
@ 2023-03-24 22:20 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-03-24 22:20 UTC (permalink / raw)
To: Oleksij Rempel, David S. Miller, Andrew Lunn, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: kernel, linux-kernel, netdev, UNGLinuxDriver
On 3/24/23 01:06, Oleksij Rempel wrote:
> We are using wrong offset, so we will get not a timestamp.
>
> Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net v2 4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table.
2023-03-24 8:06 ` [PATCH net v2 4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table Oleksij Rempel
@ 2023-03-24 22:20 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-03-24 22:20 UTC (permalink / raw)
To: Oleksij Rempel, David S. Miller, Andrew Lunn, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: kernel, linux-kernel, netdev, UNGLinuxDriver
On 3/24/23 01:06, Oleksij Rempel wrote:
> If the dynamic MAC table is empty, we will still extract one outdated
> entry. Fix it by using correct bit offset.
>
> Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net v2 5/6] net: dsa: microchip: ksz8863_smi: fix bulk access
2023-03-24 8:06 ` [PATCH net v2 5/6] net: dsa: microchip: ksz8863_smi: fix bulk access Oleksij Rempel
@ 2023-03-24 22:21 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-03-24 22:21 UTC (permalink / raw)
To: Oleksij Rempel, David S. Miller, Andrew Lunn, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: kernel, linux-kernel, netdev, UNGLinuxDriver
On 3/24/23 01:06, Oleksij Rempel wrote:
> Current regmap bulk access is broken, resulting to wrong reads/writes
> if ksz_read64/ksz_write64 functions are used.
> Mostly this issue was visible by using ksz8_fdb_dump(), which returned
> corrupt MAC address.
>
> The reason is that regmap was configured to have max_raw_read/write,
> even if ksz8863_mdio_read/write functions are able to handle unlimited
> read/write accesses. On ksz_read64 function we are using multiple 32bit
> accesses by incrementing each access by 1 instead of 4. Resulting buffer
> had 01234567.12345678 instead of 01234567.89abcdef.
>
> We have multiple ways to fix it:
> - enable 4 byte alignment for 32bit accesses. Since the HW do not have
> this requirement. It will break driver.
> - disable max_raw_* limit.
>
> This patch is removing max_raw_* limit for regmap accesses in ksz8863_smi.
>
> Fixes: 60a364760002 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net v2 6/6] net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID
2023-03-24 8:06 ` [PATCH net v2 6/6] net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID Oleksij Rempel
@ 2023-03-24 22:21 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-03-24 22:21 UTC (permalink / raw)
To: Oleksij Rempel, David S. Miller, Andrew Lunn, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
Arun Ramadoss
Cc: kernel, linux-kernel, netdev, UNGLinuxDriver
On 3/24/23 01:06, Oleksij Rempel wrote:
> FID is directly mapped to VID. However, configuring a MAC address with a
> VID != 0 resulted in incorrect configuration due to an incorrect bit
> mask. This kernel commit fixed the issue by correcting the bit mask and
> ensuring proper configuration of MAC addresses with non-zero VID.
>
> Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
` (5 preceding siblings ...)
2023-03-24 8:06 ` [PATCH net v2 6/6] net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID Oleksij Rempel
@ 2023-03-25 11:31 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-25 11:31 UTC (permalink / raw)
To: Oleksij Rempel
Cc: davem, andrew, edumazet, f.fainelli, kuba, pabeni, olteanv,
woojung.huh, arun.ramadoss, kernel, linux-kernel, netdev,
UNGLinuxDriver
Hello:
This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 24 Mar 2023 09:06:02 +0100 you wrote:
> changes v2:
> - use proper Fixes tag
> - add Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> on all
> reviewed patches except the ksz8863_smi patch.
>
> These fixes address issues such as incomplete FDB extraction, incorrect
> FID extraction and configuration, incorrect timestamp extraction, and
> ghost entry extraction from an empty dynamic MAC table. These updates
> ensure proper functioning of the FDB/MDB functionality for the
> ksz8863/ksz8873 series of chips.
>
> [...]
Here is the summary with links:
- [net,v2,1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump()
https://git.kernel.org/netdev/net/c/88e943e83827
- [net,v2,2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries
https://git.kernel.org/netdev/net/c/5d90492dd4ff
- [net,v2,3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed
https://git.kernel.org/netdev/net/c/b3177aab89be
- [net,v2,4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table.
https://git.kernel.org/netdev/net/c/492606cdc748
- [net,v2,5/6] net: dsa: microchip: ksz8863_smi: fix bulk access
https://git.kernel.org/netdev/net/c/392ff7a84cbc
- [net,v2,6/6] net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID
https://git.kernel.org/netdev/net/c/9aa5757e1f71
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2023-03-25 11:31 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-24 8:06 [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
2023-03-24 8:06 ` [PATCH net v2 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() Oleksij Rempel
2023-03-24 22:19 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries Oleksij Rempel
2023-03-24 22:19 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed Oleksij Rempel
2023-03-24 22:20 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table Oleksij Rempel
2023-03-24 22:20 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 5/6] net: dsa: microchip: ksz8863_smi: fix bulk access Oleksij Rempel
2023-03-24 22:21 ` Florian Fainelli
2023-03-24 8:06 ` [PATCH net v2 6/6] net: dsa: microchip: ksz8: fix MDB configuration with non-zero VID Oleksij Rempel
2023-03-24 22:21 ` Florian Fainelli
2023-03-25 11:31 ` [PATCH net v2 0/6] net: dsa: microchip: ksz8: fixes for stable patchwork-bot+netdevbpf
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).