net: stmmac: Improvements and fixes for -next
Subsystems (4)
cover net: stmmac: Improvements and fixes for -next
Improvements and fixes for recently introduced features. All for -next tree. More info in commit logs.
---
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
Jose Abreu (5):
net: stmmac: selftests: Add missing checks for support of SA
net: stmmac: selftests: Set RX tail pointer in Flow Control test
net: stmmac: dwmac4: Enable RX Jumbo frame support
net: stmmac: selftests: Add Split Header test
net: stmmac: Limit max speeds of XGMAC if asked to
drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 3 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 6 --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 25 +++++---- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 60 ++++++++++++++++++++++ 4 files changed, 78 insertions(+), 16 deletions(-)
Signature · 1 line
2.7.4
PATCH 4/5 net: stmmac: selftests: Add Split Header test
Add a test to validate that Split Header feature is working correctly. It works by using the rececently introduced counter that increments each time a packet with split header is received.
---
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +42 -0
@@ -1603,6 +1603,44 @@ static int stmmac_test_mjumbo(struct stmmac_priv *priv)return 0 ; } +static int stmmac_test_sph (struct stmmac_priv *priv) +{ +unsigned long cnt_end, cnt_start = priv->xstats.rx_split_hdr_pkt_n; +struct stmmac_packet_attrs attr = { }; +int ret; + +if (!priv->sph) +return -EOPNOTSUPP ; + +/* Check for UDP first */ + attr.dst = priv->dev->dev_addr; + attr.tcp = false; + + ret =__stmmac_test_loopback (priv, &attr); +if (ret) +return ret; + + cnt_end = priv->xstats.rx_split_hdr_pkt_n; +if (cnt_end <= cnt_start) +return -EINVAL ; + +/* Check for TCP now */ + cnt_start = cnt_end; + + attr.dst = priv->dev->dev_addr; + attr.tcp = true; + + ret =__stmmac_test_loopback (priv, &attr); +if (ret) +return ret; + + cnt_end = priv->xstats.rx_split_hdr_pkt_n; +if (cnt_end <= cnt_start) +return -EINVAL ; + +return 0 ; +} +#define STMMAC_LOOPBACK_NONE 0#define STMMAC_LOOPBACK_MAC 1#define STMMAC_LOOPBACK_PHY 2
@@ -1724,6 +1762,10 @@ static const struct stmmac_test { .name = "Multichannel Jumbo ", .lb = STMMAC_LOOPBACK_PHY, .fn = stmmac_test_mjumbo, + }, { + .name = "Split Header ", + .lb = STMMAC_LOOPBACK_PHY, + .fn = stmmac_test_sph, }, };
Signature · 1 line
2.7.4
PATCH 2/5 net: stmmac: selftests: Set RX tail pointer in Flow Control test
In reply to Jose AbreuWe need to set the RX tail pointer so that RX engine starts working again after finishing the Flow Control test.
---
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +6 -0
@@ -722,8 +722,14 @@ static int stmmac_test_flowctrl(struct stmmac_priv *priv)for (i =0 ; i < rx_cnt; i++) {struct stmmac_channel *ch = &priv->channel[i]; +u32 tail; + tail = priv->rx_queue[i].dma_rx_phy + + (DMA_RX_SIZE *sizeof (struct dma_desc )); + +stmmac_set_rx_tail_ptr (priv, priv->ioaddr, tail, i);stmmac_start_rx (priv, priv->ioaddr, i); +local_bh_disable ();napi_reschedule (&ch->rx_napi);local_bh_enable ();
Signature · 1 line
2.7.4
PATCH 1/5 net: stmmac: selftests: Add missing checks for support of SA
In reply to Jose AbreuAdd checks for support of Source Address Insertion/Replacement before running the test.
---
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +12 -0
@@ -1057,6 +1057,9 @@ static int stmmac_test_desc_sai(struct stmmac_priv *priv)struct stmmac_packet_attrs attr = { };int ret; +if (!priv->dma_cap.vlins) +return -EOPNOTSUPP ; + attr.remove_sa = true; attr.sarc = true; attr.src = src;
@@ -1076,6 +1079,9 @@ static int stmmac_test_desc_sar(struct stmmac_priv *priv)struct stmmac_packet_attrs attr = { };int ret; +if (!priv->dma_cap.vlins) +return -EOPNOTSUPP ; + attr.sarc = true; attr.src = src; attr.dst = priv->dev->dev_addr;
@@ -1094,6 +1100,9 @@ static int stmmac_test_reg_sai(struct stmmac_priv *priv)struct stmmac_packet_attrs attr = { };int ret; +if (!priv->dma_cap.vlins) +return -EOPNOTSUPP ; + attr.remove_sa = true; attr.sarc = true; attr.src = src;
@@ -1114,6 +1123,9 @@ static int stmmac_test_reg_sar(struct stmmac_priv *priv)struct stmmac_packet_attrs attr = { };int ret; +if (!priv->dma_cap.vlins) +return -EOPNOTSUPP ; + attr.sarc = true; attr.src = src; attr.dst = priv->dev->dev_addr;
Signature · 1 line
2.7.4
PATCH 5/5 net: stmmac: Limit max speeds of XGMAC if asked to
In reply to Jose AbreuWe may have some SoCs that can't achieve XGMAC max speed. Limit it if asked to.
---
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 25 +++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +16 -9
@@ -831,15 +831,22 @@ static void stmmac_validate(struct phylink_config *config, phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); }else if (priv->plat->has_xgmac) { - phylink_set(mac_supported, 2500baseT_Full); - phylink_set(mac_supported, 5000baseT_Full); - phylink_set(mac_supported, 10000baseSR_Full); - phylink_set(mac_supported, 10000baseLR_Full); - phylink_set(mac_supported, 10000baseER_Full); - phylink_set(mac_supported, 10000baseLRM_Full); - phylink_set(mac_supported, 10000baseT_Full); - phylink_set(mac_supported, 10000baseKX4_Full); - phylink_set(mac_supported, 10000baseKR_Full); +if (!max_speed || (max_speed >=2500 )) { + phylink_set(mac_supported, 2500baseT_Full); + phylink_set(mac_supported, 2500baseX_Full); + } +if (!max_speed || (max_speed >=5000 )) { + phylink_set(mac_supported, 5000baseT_Full); + } +if (!max_speed || (max_speed >=10000 )) { + phylink_set(mac_supported, 10000baseSR_Full); + phylink_set(mac_supported, 10000baseLR_Full); + phylink_set(mac_supported, 10000baseER_Full); + phylink_set(mac_supported, 10000baseLRM_Full); + phylink_set(mac_supported, 10000baseT_Full); + phylink_set(mac_supported, 10000baseKX4_Full); + phylink_set(mac_supported, 10000baseKR_Full); + } }/* Half-Duplex can only work with single queue */
Signature · 7 lines
2.7.4 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 3/5 net: stmmac: dwmac4: Enable RX Jumbo frame support
In reply to Jose AbreuWe are already doing it by default in the TX path so we can also enable Jumbo Frame support in the RX path independently of MTU value.
---
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 3 ++- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac4.h +2 -1
@@ -352,7 +352,8 @@ enum power_event {/* Default operating mode of the MAC */ #define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | \ - GMAC_CONFIG_BE | GMAC_CONFIG_DCRS) + GMAC_CONFIG_BE | GMAC_CONFIG_DCRS | \ + GMAC_CONFIG_JE)/* To dump the core regs excluding the Address Registers */ #define GMAC_REG_NUM 132
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +0 -6
@@ -25,15 +25,9 @@ static void dwmac4_core_init(struct mac_device_info *hw, {void __iomem *ioaddr = hw->pcsr;u32 value =readl (ioaddr +GMAC_CONFIG ); -int mtu = dev->mtu; value |=GMAC_CORE_INIT ; -if (mtu >1500 ) - value |=GMAC_CONFIG_2K ; -if (mtu >2000 ) - value |=GMAC_CONFIG_JE ; -if (hw->ps) { value |=GMAC_CONFIG_TE ;
Signature · 1 line
2.7.4
David Miller
maintainerFrom: Jose Abreu <[email protected]>
Date: Fri, 6 Sep 2019 09:41:12 +0200
Quoted 2 lines
Improvements and fixes for recently introduced features. All for -next tree. More info in commit logs.
Series applied, thanks.