All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] mlxsw: Couple of fixes
@ 2018-10-04 15:48 Ido Schimmel
  2018-10-04 15:48 ` [PATCH net 1/2] mlxsw: pci: Derive event type from event queue number Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ido Schimmel @ 2018-10-04 15:48 UTC (permalink / raw)
  To: netdev; +Cc: davem, Jiri Pirko, mlxsw, Ido Schimmel

First patch works around an hardware issue in Spectrum-2 where a field
indicating the event type is always set to the same value. Since there
are only two event types and they are reported using different queues,
we can use the queue number to derive the event type.

Second patch prevents a router interface (RIF) leakage when a VLAN
device is deleted from on top a bridge device.

Ido Schimmel (1):
  mlxsw: spectrum: Delete RIF when VLAN device is removed

Nir Dotan (1):
  mlxsw: pci: Derive event type from event queue number

 drivers/net/ethernet/mellanox/mlxsw/pci.c      | 11 +++++++----
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c |  2 ++
 2 files changed, 9 insertions(+), 4 deletions(-)

-- 
2.17.1

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

* [PATCH net 1/2] mlxsw: pci: Derive event type from event queue number
  2018-10-04 15:48 [PATCH net 0/2] mlxsw: Couple of fixes Ido Schimmel
@ 2018-10-04 15:48 ` Ido Schimmel
  2018-10-04 15:48 ` [PATCH net 2/2] mlxsw: spectrum: Delete RIF when VLAN device is removed Ido Schimmel
  2018-10-04 16:56 ` [PATCH net 0/2] mlxsw: Couple of fixes David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Ido Schimmel @ 2018-10-04 15:48 UTC (permalink / raw)
  To: netdev; +Cc: davem, Jiri Pirko, mlxsw, Nir Dotan, Ido Schimmel

From: Nir Dotan <nird@mellanox.com>

Due to a hardware issue in Spectrum-2, the field event_type of the event
queue element (EQE) has become reserved. It was used to distinguish between
command interface completion events and completion events.

Use queue number to determine event type, as command interface completion
events are always received on EQ0 and mlxsw driver maps completion events
to EQ1.

Fixes: c3ab435466d5 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC")
Signed-off-by: Nir Dotan <nird@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/pci.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
index 4d271fb3de3d..5890fdfd62c3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
@@ -718,14 +718,17 @@ static void mlxsw_pci_eq_tasklet(unsigned long data)
 	memset(&active_cqns, 0, sizeof(active_cqns));
 
 	while ((eqe = mlxsw_pci_eq_sw_eqe_get(q))) {
-		u8 event_type = mlxsw_pci_eqe_event_type_get(eqe);
 
-		switch (event_type) {
-		case MLXSW_PCI_EQE_EVENT_TYPE_CMD:
+		/* Command interface completion events are always received on
+		 * queue MLXSW_PCI_EQ_ASYNC_NUM (EQ0) and completion events
+		 * are mapped to queue MLXSW_PCI_EQ_COMP_NUM (EQ1).
+		 */
+		switch (q->num) {
+		case MLXSW_PCI_EQ_ASYNC_NUM:
 			mlxsw_pci_eq_cmd_event(mlxsw_pci, eqe);
 			q->u.eq.ev_cmd_count++;
 			break;
-		case MLXSW_PCI_EQE_EVENT_TYPE_COMP:
+		case MLXSW_PCI_EQ_COMP_NUM:
 			cqn = mlxsw_pci_eqe_cqn_get(eqe);
 			set_bit(cqn, active_cqns);
 			cq_handle = true;
-- 
2.17.1

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

* [PATCH net 2/2] mlxsw: spectrum: Delete RIF when VLAN device is removed
  2018-10-04 15:48 [PATCH net 0/2] mlxsw: Couple of fixes Ido Schimmel
  2018-10-04 15:48 ` [PATCH net 1/2] mlxsw: pci: Derive event type from event queue number Ido Schimmel
@ 2018-10-04 15:48 ` Ido Schimmel
  2018-10-04 16:56 ` [PATCH net 0/2] mlxsw: Couple of fixes David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Ido Schimmel @ 2018-10-04 15:48 UTC (permalink / raw)
  To: netdev; +Cc: davem, Jiri Pirko, mlxsw, Ido Schimmel

In commit 602b74eda813 ("mlxsw: spectrum_switchdev: Do not leak RIFs
when removing bridge") I handled the case where RIFs created for VLAN
devices were not properly cleaned up when their real device (a bridge)
was removed.

However, I forgot to handle the case of the VLAN device itself being
removed. Do so now when the VLAN device is being unlinked from its real
device.

Fixes: 99f44bb3527b ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reported-by: Artem Shvorin <art@qrator.net>
Tested-by: Artem Shvorin <art@qrator.net>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index b492152c8881..30bb2c533cec 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -4845,6 +4845,8 @@ static int mlxsw_sp_netdevice_bridge_event(struct net_device *br_dev,
 		upper_dev = info->upper_dev;
 		if (info->linking)
 			break;
+		if (is_vlan_dev(upper_dev))
+			mlxsw_sp_rif_destroy_by_dev(mlxsw_sp, upper_dev);
 		if (netif_is_macvlan(upper_dev))
 			mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev);
 		break;
-- 
2.17.1

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

* Re: [PATCH net 0/2] mlxsw: Couple of fixes
  2018-10-04 15:48 [PATCH net 0/2] mlxsw: Couple of fixes Ido Schimmel
  2018-10-04 15:48 ` [PATCH net 1/2] mlxsw: pci: Derive event type from event queue number Ido Schimmel
  2018-10-04 15:48 ` [PATCH net 2/2] mlxsw: spectrum: Delete RIF when VLAN device is removed Ido Schimmel
@ 2018-10-04 16:56 ` David Miller
  2018-10-04 17:05   ` Ido Schimmel
  2 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2018-10-04 16:56 UTC (permalink / raw)
  To: idosch; +Cc: netdev, jiri, mlxsw

From: Ido Schimmel <idosch@mellanox.com>
Date: Thu, 4 Oct 2018 15:48:00 +0000

> First patch works around an hardware issue in Spectrum-2 where a field
> indicating the event type is always set to the same value. Since there
> are only two event types and they are reported using different queues,
> we can use the queue number to derive the event type.
> 
> Second patch prevents a router interface (RIF) leakage when a VLAN
> device is deleted from on top a bridge device.

Series applied, and patch #2 queued up for -stable.

I was thinking about Fixes tags for the situation in patch #2 a bit,
and it's probably best to list two Fixes tags.  One for the original
bug that wasn't fixed properly, and one for the incomplete fix.

It's nice that you mentioned the incomplete fix in the commit message
but a backporter might miss this chain of commits and dependencies it
if it isn't in the Fixes: tags.

Thanks.

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

* Re: [PATCH net 0/2] mlxsw: Couple of fixes
  2018-10-04 16:56 ` [PATCH net 0/2] mlxsw: Couple of fixes David Miller
@ 2018-10-04 17:05   ` Ido Schimmel
  0 siblings, 0 replies; 5+ messages in thread
From: Ido Schimmel @ 2018-10-04 17:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, jiri, mlxsw

On Thu, Oct 04, 2018 at 09:56:54AM -0700, David Miller wrote:
> Series applied, and patch #2 queued up for -stable.
> 
> I was thinking about Fixes tags for the situation in patch #2 a bit,
> and it's probably best to list two Fixes tags.  One for the original
> bug that wasn't fixed properly, and one for the incomplete fix.
> 
> It's nice that you mentioned the incomplete fix in the commit message
> but a backporter might miss this chain of commits and dependencies it
> if it isn't in the Fixes: tags.

Noted. Will do so in future submissions.

Thanks, David.

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

end of thread, other threads:[~2018-10-04 23:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 15:48 [PATCH net 0/2] mlxsw: Couple of fixes Ido Schimmel
2018-10-04 15:48 ` [PATCH net 1/2] mlxsw: pci: Derive event type from event queue number Ido Schimmel
2018-10-04 15:48 ` [PATCH net 2/2] mlxsw: spectrum: Delete RIF when VLAN device is removed Ido Schimmel
2018-10-04 16:56 ` [PATCH net 0/2] mlxsw: Couple of fixes David Miller
2018-10-04 17:05   ` Ido Schimmel

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.