Skip to content

Commit db5dd0d

Browse files
wojtas-marcindavem330
authored andcommitted
net: mvneta: fix changing MTU when using per-cpu processing
After enabling per-cpu processing it appeared that under heavy load changing MTU can result in blocking all port's interrupts and transmitting data is not possible after the change. This commit fixes above issue by disabling percpu interrupts for the time, when TXQs and RXQs are reconfigured. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ce2a04c commit db5dd0d

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,6 +3042,20 @@ static int mvneta_check_mtu_valid(struct net_device *dev, int mtu)
30423042
return mtu;
30433043
}
30443044

3045+
static void mvneta_percpu_enable(void *arg)
3046+
{
3047+
struct mvneta_port *pp = arg;
3048+
3049+
enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE);
3050+
}
3051+
3052+
static void mvneta_percpu_disable(void *arg)
3053+
{
3054+
struct mvneta_port *pp = arg;
3055+
3056+
disable_percpu_irq(pp->dev->irq);
3057+
}
3058+
30453059
/* Change the device mtu */
30463060
static int mvneta_change_mtu(struct net_device *dev, int mtu)
30473061
{
@@ -3066,6 +3080,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
30663080
* reallocation of the queues
30673081
*/
30683082
mvneta_stop_dev(pp);
3083+
on_each_cpu(mvneta_percpu_disable, pp, true);
30693084

30703085
mvneta_cleanup_txqs(pp);
30713086
mvneta_cleanup_rxqs(pp);
@@ -3089,6 +3104,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
30893104
return ret;
30903105
}
30913106

3107+
on_each_cpu(mvneta_percpu_enable, pp, true);
30923108
mvneta_start_dev(pp);
30933109
mvneta_port_up(pp);
30943110

@@ -3242,20 +3258,6 @@ static void mvneta_mdio_remove(struct mvneta_port *pp)
32423258
pp->phy_dev = NULL;
32433259
}
32443260

3245-
static void mvneta_percpu_enable(void *arg)
3246-
{
3247-
struct mvneta_port *pp = arg;
3248-
3249-
enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE);
3250-
}
3251-
3252-
static void mvneta_percpu_disable(void *arg)
3253-
{
3254-
struct mvneta_port *pp = arg;
3255-
3256-
disable_percpu_irq(pp->dev->irq);
3257-
}
3258-
32593261
/* Electing a CPU must be done in an atomic way: it should be done
32603262
* after or before the removal/insertion of a CPU and this function is
32613263
* not reentrant.

0 commit comments

Comments
 (0)