Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ac63187

Browse files
linuswdavem330
authored andcommitted
net: ethernet: cortina: Drop TSO support
The recent change to allow large frames without hardware checksumming slotted in software checksumming in the driver if hardware could not do it. This will however upset TSO (TCP Segment Offloading). Typical error dumps includes this: skb len=2961 headroom=222 headlen=66 tailroom=0 (...) WARNING: CPU: 0 PID: 956 at net/core/dev.c:3259 skb_warn_bad_offload+0x7c/0x108 gemini-ethernet-port: caps=(0x0000010000154813, 0x00002007ffdd7889) And the packets do not go through. The TSO implementation is bogus: a TSO enabled driver must propagate the skb_shinfo(skb)->gso_size value to the TSO engine on the NIC. Drop the size check and TSO offloading features for now: this needs to be fixed up properly. After this ethernet works fine on Gemini devices with a direct connected PHY such as D-Link DNS-313. Also tested to still be working with a DSA switch using the Gemini ethernet as conduit interface. Link: https://lore.kernel.org/netdev/CANn89iJLfxng1sYL5Zk0mknXpyYQPCp83m3KgD2KJ2_hKCpEUg@mail.gmail.com/ Suggested-by: Eric Dumazet <[email protected]> Fixes: d4d0c5b ("net: ethernet: cortina: Handle large frames") Signed-off-by: Linus Walleij <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 61921bd commit ac63187

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

drivers/net/ethernet/cortina/gemini.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
7979
#define GMAC0_IRQ4_8 (GMAC0_MIB_INT_BIT | GMAC0_RX_OVERRUN_INT_BIT)
8080

8181
#define GMAC_OFFLOAD_FEATURES (NETIF_F_SG | NETIF_F_IP_CSUM | \
82-
NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | \
83-
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
82+
NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM)
8483

8584
/**
8685
* struct gmac_queue_page - page buffer per-page info
@@ -1143,23 +1142,13 @@ static int gmac_map_tx_bufs(struct net_device *netdev, struct sk_buff *skb,
11431142
struct gmac_txdesc *txd;
11441143
skb_frag_t *skb_frag;
11451144
dma_addr_t mapping;
1146-
unsigned short mtu;
11471145
void *buffer;
11481146
int ret;
11491147

1150-
mtu = ETH_HLEN;
1151-
mtu += netdev->mtu;
1152-
if (skb->protocol == htons(ETH_P_8021Q))
1153-
mtu += VLAN_HLEN;
1154-
1148+
/* TODO: implement proper TSO using MTU in word3 */
11551149
word1 = skb->len;
11561150
word3 = SOF_BIT;
11571151

1158-
if (word1 > mtu) {
1159-
word1 |= TSS_MTU_ENABLE_BIT;
1160-
word3 |= mtu;
1161-
}
1162-
11631152
if (skb->len >= ETH_FRAME_LEN) {
11641153
/* Hardware offloaded checksumming isn't working on frames
11651154
* bigger than 1514 bytes. A hypothesis about this is that the

0 commit comments

Comments
 (0)