Skip to contentSkip to conversation

iMX28 Ethernet driver fix

PATCH New Peter Horton 2 participants 2 messages Nov 8, 2011 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iMX28 Ethernet driver fix

Fix driver to correctly handle cloned SKBs. Currently any clones of the transmit SKBs get endian-swapped by the driver. This breaks the ATA-over-Ethernet driver for example.

---
 drivers/net/fec.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/net/fec.c +7 -1
index c46ccb1..6455483 100644
@@ -302,8 +302,14 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	 * On some FEC implementations data must be aligned on
 	 * 4-byte boundaries. Use bounce buffers to copy data
 	 * and get it aligned. Ugh.
+	 *
+	 * We also have to use the bounce buffers if we need
+	 * to do the endian swap (see below) on a cloned buffer.
 	 */
-	if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
+	if ((((unsigned long) bufaddr) & FEC_ALIGNMENT) ||
+		((id_entry->driver_data & FEC_QUIRK_SWAP_FRAME) &&
+		skb_cloned(skb)))
+	{
 		unsigned int index;
 		index = bdp - fep->tx_bd_base;
 		memcpy(fep->tx_bounce[index], skb->data, skb->len);
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 iMX28 Ethernet driver fix

Hi Peter,

Quoted 3 lines · Peter Horton

Fix driver to correctly handle cloned SKBs. Currently any clones of the transmit SKBs get endian-swapped by the driver. This breaks the ATA-over-Ethernet driver for example.

Patches for network devices should go to the netdev list.

Quoted 3 lines
---
 drivers/net/fec.c |    8 +++++++-

The driver has moved to drivers/net/ethernet/freescale/fec.c. You should rebase on v3.2-rc1.

Quoted 13 lines
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/net/fec.c +2 -0
index c46ccb1..6455483 100644
@@ -302,8 +302,14 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	 * On some FEC implementations data must be aligned on
 	 * 4-byte boundaries. Use bounce buffers to copy data
 	 * and get it aligned. Ugh.
+	 *
+	 * We also have to use the bounce buffers if we need

drivers/net/fec.c fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) · line 315

Quoted 10 lines
drivers/net/fec.c +5 -1
+	 * to do the endian swap (see below) on a cloned buffer.
 	 */
-	if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
+	if ((((unsigned long) bufaddr) & FEC_ALIGNMENT) ||
+		((id_entry->driver_data & FEC_QUIRK_SWAP_FRAME) &&
+		skb_cloned(skb)))
+	{
 		unsigned int index;
 		index = bdp - fep->tx_bd_base;
 		memcpy(fep->tx_bounce[index], skb->data, skb->len);

baruch

Signature · 3 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -