net:ethernet:aquantia: Misc fixes for atlantic driver.
Subsystems (3)
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.
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 | 26 +++++++++++++++++----- 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, 31 insertions(+), 12 deletions(-)
Signature · 1 line
2.7.4
PATCH 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 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 | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +17 -6
@@ -508,12 +508,23 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self, ++ret;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 ; + dx_buff->is_ip_cso = (htons (ETH_P_IP ) == skb->protocol) ?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 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 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.
--- 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_B0_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 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).
--- 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 net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.
In reply to Pavel BelousHi,
Quoted 45 lines · Pavel Belous
From: Pavel Belous <[email protected]>
Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6.
Signed-off-by Pavel Belous <[email protected]>--- 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 +0
-0
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c static int hw_atl_a0_hw_ring_tx_xmit(struct aq_hw_s *self, · line 438
Quoted 6 lines
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_B0_TXD_CTL_CMD_IPV6 ;
I think this is a mistake. I believe it should be HW_ATL_A0_TXD_CTL_CMD_IPV6.
AFAICT this file doesn't include hw_atl_b0_internal.h, so I don't believe this will compile.
Thanks,
-DA
Quoted 18 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +0
-0}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;
Re: [PATCH net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.
Quoted 67 lines · David Arcari
Hi,
Quoted 45 lines · Pavel Belous
From: Pavel Belous <[email protected]>
Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6.
Signed-off-by Pavel Belous <[email protected]>--- 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 +0
-0drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c static int hw_atl_a0_hw_ring_tx_xmit(struct aq_hw_s *self, · line 438
Quoted 6 lines
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_B0_TXD_CTL_CMD_IPV6 ;I think this is a mistake. I believe it should be
HW_ATL_A0_TXD_CTL_CMD_IPV6.AFAICT this file doesn't include
hw_atl_b0_internal.h, so I don't believe this will compile.Thanks,
-DA
Quoted 3 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +0
-0}else { buff_pa_len = buff->len;
Quoted 16 lines
Quoted 6 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +0
-0drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self, · line 479
Quoted 9 lines
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;
Thank you, David.
I will fix this in patchset v2.
Regards,
Pavel
kbuild test robot
build botRe: [PATCH net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.
In reply to Pavel Belousurl: https://github.com/0day-ci/linux/commits/Pavel-Belous/net-ethernet-aquantia-Misc-fixes-for-atlantic-driver/20170323-191314 config: x86_64-allmodconfig (attached as .config) compiler: gcc-6…
Hi Pavel,
[auto build test ERROR on net/master]
url: https://github.com/0day-ci/linux/commits/Pavel-Belous/net-ethernet-aquantia-Misc-fixes-for-atlantic-driver/20170323-191314
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 All errors (new ones prefixed by >>):
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c: In function 'hw_atl_a0_hw_ring_tx_xmit':
>> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c:438:17: error: 'HW_ATL_B0_TXD_CTL_CMD_IPV6' undeclared (first use in this function)
txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_IPV6;
^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c:438:17: note: each undeclared identifier is reported only once for each function it appears in
vim +/HW_ATL_B0_TXD_CTL_CMD_IPV6 +438 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
432 pkt_len -= (buff->len_l4 +
433 buff->len_l3 +
434 buff->len_l2);
435 is_gso = true;
436
437 if (buff->is_ipv6)
> 438 txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_IPV6;
439 } else {
440 buff_pa_len = buff->len;
441
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation