* [patch net v2 0/2] mlxsw: couple of fixes
@ 2016-03-07 14:15 Jiri Pirko
2016-03-07 14:15 ` [patch net v2 1/2] mlxsw: spectrum: Always decrement bridge's ref count Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Jiri Pirko @ 2016-03-07 14:15 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, ogerlitz
From: Jiri Pirko <jiri@mellanox.com>
Couple of fixes from Ido.
Ido Schimmel (2):
mlxsw: spectrum: Always decrement bridge's ref count
mlxsw: pci: Correctly determine if descriptor queue is full
drivers/net/ethernet/mellanox/mlxsw/pci.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
--
2.5.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch net v2 1/2] mlxsw: spectrum: Always decrement bridge's ref count
2016-03-07 14:15 [patch net v2 0/2] mlxsw: couple of fixes Jiri Pirko
@ 2016-03-07 14:15 ` Jiri Pirko
2016-03-07 14:15 ` [patch net v2 2/2] mlxsw: pci: Correctly determine if descriptor queue is full Jiri Pirko
2016-03-07 16:40 ` [patch net v2 0/2] mlxsw: couple of fixes David Miller
2 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2016-03-07 14:15 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, ogerlitz
From: Ido Schimmel <idosch@mellanox.com>
Since we only support one VLAN filtering bridge we need to associate a
reference count with it, so that when the last port netdev leaves it, we
would know that a different bridge can be offloaded to hardware.
When a LAG device is memeber in a bridge and port netdevs are leaving
the LAG, we should always decrement the bridge's reference count, as it's
incremented for any port in the LAG.
Fixes: 4dc236c31733 ("mlxsw: spectrum: Handle port leaving LAG while bridged")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 09ce451..a94daa8 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -2358,9 +2358,7 @@ static int mlxsw_sp_port_lag_leave(struct mlxsw_sp_port *mlxsw_sp_port,
if (mlxsw_sp_port->bridged) {
mlxsw_sp_port_active_vlans_del(mlxsw_sp_port);
mlxsw_sp_port_bridge_leave(mlxsw_sp_port, false);
-
- if (lag->ref_count == 1)
- mlxsw_sp_master_bridge_dec(mlxsw_sp, NULL);
+ mlxsw_sp_master_bridge_dec(mlxsw_sp, NULL);
}
if (lag->ref_count == 1) {
--
2.5.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [patch net v2 2/2] mlxsw: pci: Correctly determine if descriptor queue is full
2016-03-07 14:15 [patch net v2 0/2] mlxsw: couple of fixes Jiri Pirko
2016-03-07 14:15 ` [patch net v2 1/2] mlxsw: spectrum: Always decrement bridge's ref count Jiri Pirko
@ 2016-03-07 14:15 ` Jiri Pirko
2016-03-07 16:40 ` [patch net v2 0/2] mlxsw: couple of fixes David Miller
2 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2016-03-07 14:15 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, ogerlitz
From: Ido Schimmel <idosch@mellanox.com>
The descriptor queues for sending (SDQs) and receiving (RDQs) packets
are managed by two counters - producer and consumer - which are both
16-bit in size. A queue is considered full when the difference between
the two equals the queue's maximum number of descriptors.
However, if the producer counter overflows, then it's possible for the
full queue check to fail, as it doesn't take the overflow into account.
In such a case, descriptors already passed to the device - but for which
a completion has yet to be posted - will be overwritten, thereby causing
undefined behavior. The above can be achieved under heavy load (~30
netperf instances).
Fix that by casting the subtraction result to u16, preventing it from
being treated as a signed integer.
Fixes: eda6500a987a ("mlxsw: Add PCI bus implementation")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
v1->v2: fixed typo in desc
---
drivers/net/ethernet/mellanox/mlxsw/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
index c071077..7992c55 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
@@ -215,7 +215,7 @@ mlxsw_pci_queue_elem_info_producer_get(struct mlxsw_pci_queue *q)
{
int index = q->producer_counter & (q->count - 1);
- if ((q->producer_counter - q->consumer_counter) == q->count)
+ if ((u16) (q->producer_counter - q->consumer_counter) == q->count)
return NULL;
return mlxsw_pci_queue_elem_info_get(q, index);
}
--
2.5.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [patch net v2 0/2] mlxsw: couple of fixes
2016-03-07 14:15 [patch net v2 0/2] mlxsw: couple of fixes Jiri Pirko
2016-03-07 14:15 ` [patch net v2 1/2] mlxsw: spectrum: Always decrement bridge's ref count Jiri Pirko
2016-03-07 14:15 ` [patch net v2 2/2] mlxsw: pci: Correctly determine if descriptor queue is full Jiri Pirko
@ 2016-03-07 16:40 ` David Miller
2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2016-03-07 16:40 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, eladr, yotamg, ogerlitz
From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 7 Mar 2016 15:15:28 +0100
> Couple of fixes from Ido.
Series applied, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch net v2 0/2] mlxsw: Couple of fixes
@ 2016-11-11 15:34 Jiri Pirko
2016-11-13 17:51 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Jiri Pirko @ 2016-11-11 15:34 UTC (permalink / raw)
To: netdev; +Cc: davem, yotamg, arkadis, idosch, eladr, nogahf, ogerlitz
From: Jiri Pirko <jiri@mellanox.com>
Please, queue-up both for stable. Thanks!
---
v1->v2:
- patch 1:
- fix this rather by initializing refcount to 1
- fix typo in description
- patch 2:
- remove an extra space
- fix the description
Arkadi Sharshevsky (1):
mlxsw: spectrum_router: Correctly dump neighbour activity
Yotam Gigi (1):
mlxsw: spectrum: Fix refcount bug on span entries
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +++-
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 22 +++++++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch net v2 0/2] mlxsw: Couple of fixes
2016-11-11 15:34 [patch net v2 0/2] mlxsw: Couple " Jiri Pirko
@ 2016-11-13 17:51 ` David Miller
2016-11-13 20:00 ` Jiri Pirko
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2016-11-13 17:51 UTC (permalink / raw)
To: jiri; +Cc: netdev, yotamg, arkadis, idosch, eladr, nogahf, ogerlitz
From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 11 Nov 2016 16:34:24 +0100
> From: Jiri Pirko <jiri@mellanox.com>
>
> Please, queue-up both for stable. Thanks!
Just to be clear I did make sure to take v2 rather than
v1.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch net v2 0/2] mlxsw: Couple of fixes
2016-11-13 17:51 ` David Miller
@ 2016-11-13 20:00 ` Jiri Pirko
0 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2016-11-13 20:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev, yotamg, arkadis, idosch, eladr, nogahf, ogerlitz
Sun, Nov 13, 2016 at 06:51:33PM CET, davem@davemloft.net wrote:
>From: Jiri Pirko <jiri@resnulli.us>
>Date: Fri, 11 Nov 2016 16:34:24 +0100
>
>> From: Jiri Pirko <jiri@mellanox.com>
>>
>> Please, queue-up both for stable. Thanks!
>
>Just to be clear I did make sure to take v2 rather than
>v1.
Good. Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-11-13 20:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 14:15 [patch net v2 0/2] mlxsw: couple of fixes Jiri Pirko
2016-03-07 14:15 ` [patch net v2 1/2] mlxsw: spectrum: Always decrement bridge's ref count Jiri Pirko
2016-03-07 14:15 ` [patch net v2 2/2] mlxsw: pci: Correctly determine if descriptor queue is full Jiri Pirko
2016-03-07 16:40 ` [patch net v2 0/2] mlxsw: couple of fixes David Miller
-- strict thread matches above, loose matches on Subject: below --
2016-11-11 15:34 [patch net v2 0/2] mlxsw: Couple " Jiri Pirko
2016-11-13 17:51 ` David Miller
2016-11-13 20:00 ` Jiri Pirko
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).