Skip to contentSkip to conversation

net:ethernet:aquantia: Misc fixes for atlantic driver.

PATCH Superseded Pavel Belous 2 participants 8 messages Mar 22, 2017

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover net:ethernet:aquantia: Misc fixes for atlantic driver.

From: Pavel Belous <[email protected]>

The following patchset containg several fixes for aQuantia AQtion driver for net tree: A couple fixes for IPv6 and other fixes.

v1->v2: Fix compilation error (using HW_ATL_A0_TXD_CTL_CMD_IPV6 instead

        HW_ATL_B0_TXD_CTL_CMD_IPV6).

Pavel Belous (5):
net:ethernet:aquantia: Remove adapter re-opening when mtu changed. net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6. net:ethernet:aquantia: Missing spinlock initialization. net:ethernet:aquantia: Fix for LSO with IPv6. net:ethernet:aquantia: Reset is_gso flag when EOP reached.

 drivers/net/ethernet/aquantia/atlantic/aq_main.c   |  5 -----
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    | 23 ++++++++++++++++++----
 drivers/net/ethernet/aquantia/atlantic/aq_ring.c   |  1 +
 drivers/net/ethernet/aquantia/atlantic/aq_ring.h   |  3 ++-
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  |  4 ++++
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  |  4 ++++
 6 files changed, 30 insertions(+), 10 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/5 net:ethernet:aquantia: Remove adapter re-opening when mtu changed.

From: Pavel Belous <[email protected]>

Closing/opening the adapter is not needed at all.
The new mtu settings take effect immediately.

---
 drivers/net/ethernet/aquantia/atlantic/aq_main.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_main.c +0 -5
index d05fbfd..5d6c40d 100644
@@ -100,11 +100,6 @@ static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
 		goto err_exit;
 	ndev->mtu = new_mtu;
 
-	if (netif_running(ndev)) {
-		aq_ndev_close(ndev);
-		aq_ndev_open(ndev);
-	}
-
 err_exit:
 	return err;
 }
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/5 net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6.

In reply to Pavel Belous

From: Pavel Belous <[email protected]>

In order for the checksum offloads to work correctly we need to set the packet type bit (TCP/UDP) in the TX context buffer.

---
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +16 -4
index ee78444..db2b51d 100644
@@ -510,10 +510,22 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		dx_buff->is_ip_cso = (htons(ETH_P_IP) == skb->protocol) ?
 			1U : 0U;
-		dx_buff->is_tcp_cso =
-			(ip_hdr(skb)->protocol == IPPROTO_TCP) ? 1U : 0U;
-		dx_buff->is_udp_cso =
-			(ip_hdr(skb)->protocol == IPPROTO_UDP) ? 1U : 0U;
+
+		if (ip_hdr(skb)->version == 4) {
+			dx_buff->is_tcp_cso =
+				(ip_hdr(skb)->protocol == IPPROTO_TCP) ?
+					1U : 0U;
+			dx_buff->is_udp_cso =
+				(ip_hdr(skb)->protocol == IPPROTO_UDP) ?
+					1U : 0U;
+		} else if (ip_hdr(skb)->version == 6) {
+			dx_buff->is_tcp_cso =
+				(ipv6_hdr(skb)->nexthdr == NEXTHDR_TCP) ?
+					1U : 0U;
+			dx_buff->is_udp_cso =
+				(ipv6_hdr(skb)->nexthdr == NEXTHDR_UDP) ?
+					1U : 0U;
+		}
 	}
 
 	for (; nr_frags--; ++frag_count) {
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 3/5 net:ethernet:aquantia: Missing spinlock initialization.

In reply to Pavel Belous

From: Pavel Belous <[email protected]>

Fix for missing initialization aq_ring header.lock spinlock.

---
 drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/aquantia/atlantic/aq_ring.c +1 -0
index 0358e607..3a8a4aa 100644
@@ -101,6 +101,7 @@ int aq_ring_init(struct aq_ring_s *self)
 	self->hw_head = 0;
 	self->sw_head = 0;
 	self->sw_tail = 0;
+	spin_lock_init(&self->header.lock);
 	return 0;
 }
 
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 4/5 net:ethernet:aquantia: Fix for LSO with IPv6.

In reply to Pavel Belous

From: Pavel Belous <[email protected]>

Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6.

---
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c           | 3 +++
 drivers/net/ethernet/aquantia/atlantic/aq_ring.h          | 3 ++-
 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 3 +++
 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 3 +++
 4 files changed, 11 insertions(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +3 -0
index db2b51d..cdb0299 100644
@@ -487,6 +487,9 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
 		dx_buff->mss = skb_shinfo(skb)->gso_size;
 		dx_buff->is_txc = 1U;
 
+		dx_buff->is_ipv6 =
+			(ip_hdr(skb)->version == 6) ? 1U : 0U;
+
 		dx = aq_ring_next_dx(ring, dx);
 		dx_buff = &ring->buff_ring[dx];
 		++ret;
drivers/net/ethernet/aquantia/atlantic/aq_ring.h +2 -1
index 2572546..eecd6d1 100644
@@ -58,7 +58,8 @@ struct __packed aq_ring_buff_s {
 			u8 len_l2;
 			u8 len_l3;
 			u8 len_l4;
-			u8 rsvd2;
+			u8 is_ipv6:1;
+			u8 rsvd2:7;
 			u32 len_pkt;
 		};
 	};
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +3 -0
index a2b746a..a536875 100644
@@ -433,6 +433,9 @@ static int hw_atl_a0_hw_ring_tx_xmit(struct aq_hw_s *self,
 				    buff->len_l3 +
 				    buff->len_l2);
 			is_gso = true;
+
+			if (buff->is_ipv6)
+				txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_IPV6;
 		} else {
 			buff_pa_len = buff->len;
 
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +3 -0
index cab2931..69488c9 100644
@@ -471,6 +471,9 @@ static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self,
 				    buff->len_l3 +
 				    buff->len_l2);
 			is_gso = true;
+
+			if (buff->is_ipv6)
+				txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_IPV6;
 		} else {
 			buff_pa_len = buff->len;
 
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 5/5 net:ethernet:aquantia: Reset is_gso flag when EOP reached.

In reply to Pavel Belous

From: Pavel Belous <[email protected]>

We need to reset is_gso flag when EOP reached (entire LSO packet processed).

---
 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 1 +
 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 1 +
 2 files changed, 2 insertions(+)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +1 -0
index a536875..4ee15ff 100644
@@ -461,6 +461,7 @@ static int hw_atl_a0_hw_ring_tx_xmit(struct aq_hw_s *self,
 			if (unlikely(buff->is_eop)) {
 				txd->ctl |= HW_ATL_A0_TXD_CTL_EOP;
 				txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_WB;
+				is_gso = false;
 			}
 		}
 
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +1 -0
index 69488c9..4215070 100644
@@ -499,6 +499,7 @@ static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self,
 			if (unlikely(buff->is_eop)) {
 				txd->ctl |= HW_ATL_B0_TXD_CTL_EOP;
 				txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_WB;
+				is_gso = false;
 			}
 		}
 
Signature · 1 line
2.7.4
#6 lore raw
In reply to Pavel Belous
Quoted 7 lines · Pavel Belous

From: Pavel Belous <[email protected]>

The following patchset containg several fixes for aQuantia AQtion driver for net tree: A couple fixes for IPv6 and other fixes.

v1->v2: Fix compilation error (using HW_ATL_A0_TXD_CTL_CMD_IPV6 instead

        HW_ATL_B0_TXD_CTL_CMD_IPV6).

Since you are fixing bugs, can you add proper Fixes: <12-digit commit> ("Commit subject") tags for each commit?

Also, you may want to fix your subjects to be:

net: ethernet: aquantia: Remove adapter re-opening when MTU changed

Thanks!

Quoted 17 lines

Pavel Belous (5):
net:ethernet:aquantia: Remove adapter re-opening when mtu changed. net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6. net:ethernet:aquantia: Missing spinlock initialization. net:ethernet:aquantia: Fix for LSO with IPv6. net:ethernet:aquantia: Reset is_gso flag when EOP reached.

 drivers/net/ethernet/aquantia/atlantic/aq_main.c   |  5 -----
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    | 23 ++++++++++++++++++----
 drivers/net/ethernet/aquantia/atlantic/aq_ring.c   |  1 +
 drivers/net/ethernet/aquantia/atlantic/aq_ring.h   |  3 ++-
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  |  4 ++++
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  |  4 ++++
 6 files changed, 30 insertions(+), 10 deletions(-)
Signature · 1 line
Florian
#7 lore raw
Quoted 9 lines · Florian Fainelli
Quoted 7 lines · Pavel Belous

From: Pavel Belous <[email protected]>

The following patchset containg several fixes for aQuantia AQtion driver for net tree: A couple fixes for IPv6 and other fixes.

v1->v2: Fix compilation error (using HW_ATL_A0_TXD_CTL_CMD_IPV6 instead

        HW_ATL_B0_TXD_CTL_CMD_IPV6).
Quoted 9 lines

Since you are fixing bugs, can you add proper Fixes: <12-digit commit> ("Commit subject") tags for each commit?

Also, you may want to fix your subjects to be:

net: ethernet: aquantia: Remove adapter re-opening when MTU changed

Thanks!

Thank you, Florian.
I will add 'Fixes' tags in patchset v3.

Regards,
Pavel

Quoted 19 lines
Quoted 17 lines

Pavel Belous (5):
net:ethernet:aquantia: Remove adapter re-opening when mtu changed. net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6. net:ethernet:aquantia: Missing spinlock initialization. net:ethernet:aquantia: Fix for LSO with IPv6. net:ethernet:aquantia: Reset is_gso flag when EOP reached.

 drivers/net/ethernet/aquantia/atlantic/aq_main.c   |  5 -----
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    | 23 ++++++++++++++++++----
 drivers/net/ethernet/aquantia/atlantic/aq_ring.c   |  1 +
 drivers/net/ethernet/aquantia/atlantic/aq_ring.h   |  3 ++-
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  |  4 ++++
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  |  4 ++++
 6 files changed, 30 insertions(+), 10 deletions(-)