Skip to content

Commit

Permalink
Merge branch 'mvneta-jumbo-frames'
Browse files Browse the repository at this point in the history
Simon Guinot says:

====================
Fix Ethernet jumbo frames support for Armada 370 and 38x

This patch series fixes the Ethernet jumbo frames support for the SoCs
Armada 370, 380 and 385. Unlike Armada XP, the Ethernet controller for
this SoCs don't support TCP/IP checksumming with a frame size larger
than 1600 bytes.

This patches should be applied to the -stable kernels 3.8 and onwards.

Changes since v1:
- Use a new compatible string for the Ethernet IP found in Armada XP
  SoCs (instead of using an optional property).
- Fix the issue for the Armada 380 and 385 SoCs as well.

Changes since v2:
- Add Acked-by from Gregory Clement.
- Add "Fixes:" tag to each commits.

Changes since v3:
- Fix patch 3 name: replace prefix "ARM: mvebu:" with "net: mvneta:".
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 30, 2015
2 parents 279c6c7 + b65657f commit 7f4ef97
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* Marvell Armada 370 / Armada XP Ethernet Controller (NETA)

Required properties:
- compatible: should be "marvell,armada-370-neta".
- compatible: "marvell,armada-370-neta" or "marvell,armada-xp-neta".
- reg: address and length of the register set for the device.
- interrupts: interrupt for the device
- phy: See ethernet.txt file in the same directory.
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/boot/dts/armada-370-xp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@
};

eth0: ethernet@70000 {
compatible = "marvell,armada-370-neta";
reg = <0x70000 0x4000>;
interrupts = <8>;
clocks = <&gateclk 4>;
Expand All @@ -286,7 +285,6 @@
};

eth1: ethernet@74000 {
compatible = "marvell,armada-370-neta";
reg = <0x74000 0x4000>;
interrupts = <10>;
clocks = <&gateclk 3>;
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/boot/dts/armada-370.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@
dmacap,memset;
};
};

ethernet@70000 {
compatible = "marvell,armada-370-neta";
};

ethernet@74000 {
compatible = "marvell,armada-370-neta";
};
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/armada-xp-mv78260.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
};

eth3: ethernet@34000 {
compatible = "marvell,armada-370-neta";
compatible = "marvell,armada-xp-neta";
reg = <0x34000 0x4000>;
interrupts = <14>;
clocks = <&gateclk 1>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/armada-xp-mv78460.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
};

eth3: ethernet@34000 {
compatible = "marvell,armada-370-neta";
compatible = "marvell,armada-xp-neta";
reg = <0x34000 0x4000>;
interrupts = <14>;
clocks = <&gateclk 1>;
Expand Down
10 changes: 9 additions & 1 deletion arch/arm/boot/dts/armada-xp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
};

eth2: ethernet@30000 {
compatible = "marvell,armada-370-neta";
compatible = "marvell,armada-xp-neta";
reg = <0x30000 0x4000>;
interrupts = <12>;
clocks = <&gateclk 2>;
Expand Down Expand Up @@ -220,6 +220,14 @@
};
};

ethernet@70000 {
compatible = "marvell,armada-xp-neta";
};

ethernet@74000 {
compatible = "marvell,armada-xp-neta";
};

xor@f0900 {
compatible = "marvell,orion-xor";
reg = <0xF0900 0x100
Expand Down
27 changes: 26 additions & 1 deletion drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ struct mvneta_port {
unsigned int link;
unsigned int duplex;
unsigned int speed;
unsigned int tx_csum_limit;
int use_inband_status:1;
};

Expand Down Expand Up @@ -2508,8 +2509,10 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)

dev->mtu = mtu;

if (!netif_running(dev))
if (!netif_running(dev)) {
netdev_update_features(dev);
return 0;
}

/* The interface is running, so we have to force a
* reallocation of the queues
Expand Down Expand Up @@ -2538,9 +2541,26 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
mvneta_start_dev(pp);
mvneta_port_up(pp);

netdev_update_features(dev);

return 0;
}

static netdev_features_t mvneta_fix_features(struct net_device *dev,
netdev_features_t features)
{
struct mvneta_port *pp = netdev_priv(dev);

if (pp->tx_csum_limit && dev->mtu > pp->tx_csum_limit) {
features &= ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
netdev_info(dev,
"Disable IP checksum for MTU greater than %dB\n",
pp->tx_csum_limit);
}

return features;
}

/* Get mac address */
static void mvneta_get_mac_addr(struct mvneta_port *pp, unsigned char *addr)
{
Expand Down Expand Up @@ -2862,6 +2882,7 @@ static const struct net_device_ops mvneta_netdev_ops = {
.ndo_set_rx_mode = mvneta_set_rx_mode,
.ndo_set_mac_address = mvneta_set_mac_addr,
.ndo_change_mtu = mvneta_change_mtu,
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl,
};
Expand Down Expand Up @@ -3107,6 +3128,9 @@ static int mvneta_probe(struct platform_device *pdev)
}
}

if (of_device_is_compatible(dn, "marvell,armada-370-neta"))
pp->tx_csum_limit = 1600;

pp->tx_ring_size = MVNETA_MAX_TXD;
pp->rx_ring_size = MVNETA_MAX_RXD;

Expand Down Expand Up @@ -3185,6 +3209,7 @@ static int mvneta_remove(struct platform_device *pdev)

static const struct of_device_id mvneta_match[] = {
{ .compatible = "marvell,armada-370-neta" },
{ .compatible = "marvell,armada-xp-neta" },
{ }
};
MODULE_DEVICE_TABLE(of, mvneta_match);
Expand Down

0 comments on commit 7f4ef97

Please sign in to comment.