net:ethernet:aquantia: Misc fixes for atlantic driver.
Subsystems (3)
v3 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).
v2->v3: Added "Fixes" tags.
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
PATCH v3 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
@@ -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
PATCH v3 2/5 net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6.
In reply to Pavel BelousFrom: 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
@@ -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
PATCH v3 3/5 net:ethernet:aquantia: Missing spinlock initialization.
In reply to Pavel BelousFrom: 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
@@ -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
PATCH v3 4/5 net:ethernet:aquantia: Fix for LSO with IPv6.
In reply to Pavel BelousFrom: Pavel Belous <[email protected]>
Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6.
Atlantic A0 and B0 specific functions.")
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v3 5/5 net:ethernet:aquantia: Reset is_gso flag when EOP reached.
In reply to Pavel BelousFrom: Pavel Belous <[email protected]>
We need to reset is_gso flag when EOP reached (entire LSO packet processed).
Atlantic A0 and B0 specific functions.")
--- 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
@@ -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
@@ -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
Re: [PATCH v3 net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6.
In reply to Pavel BelousQuoted 34 lines · 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.
Fixes 97bde5c4f909 ("net: ethernet: aquantia: Support for NIC-specific code")Signed-off-by Pavel Belous <[email protected]>--- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)drivers/net/ethernet/aquantia/atlantic/aq_nic.c +9
-4@@ -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 ) {
drivers/net/ethernet/aquantia/atlantic/aq_nic.c static unsigned int aq_nic_map_skb(struct aq_nic_s *self, · line 531
Quoted 10 lines
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +7
-0+ 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) {
Fixes tcp/ipv6
David Miller
maintainerFrom: Pavel Belous <[email protected]>
Date: Thu, 23 Mar 2017 14:19:40 +0300
Quoted 8 lines
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 (usingHW_ATL_A0_TXD_CTL_CMD_IPV6insteadHW_ATL_B0_TXD_CTL_CMD_IPV6).
v2->v3: Added "Fixes" tags.
Series applied, thanks.