* [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver.
@ 2017-03-22 21:19 Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 1/5] net:ethernet:aquantia: Remove adapter re-opening when mtu changed Pavel Belous
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Pavel Belous @ 2017-03-22 21:19 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari, Pavel Belous
From: Pavel Belous <pavel.belous@aquantia.com>
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(-)
--
2.7.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 net 1/5] net:ethernet:aquantia: Remove adapter re-opening when mtu changed.
2017-03-22 21:19 [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Pavel Belous
@ 2017-03-22 21:19 ` Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6 Pavel Belous
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Pavel Belous @ 2017-03-22 21:19 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari, Pavel Belous
From: Pavel Belous <pavel.belous@aquantia.com>
Closing/opening the adapter is not needed at all.
The new mtu settings take effect immediately.
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
---
drivers/net/ethernet/aquantia/atlantic/aq_main.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
index d05fbfd..5d6c40d 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_main.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
@@ -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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6.
2017-03-22 21:19 [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 1/5] net:ethernet:aquantia: Remove adapter re-opening when mtu changed Pavel Belous
@ 2017-03-22 21:19 ` Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 3/5] net:ethernet:aquantia: Missing spinlock initialization Pavel Belous
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Pavel Belous @ 2017-03-22 21:19 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari, Pavel Belous
From: Pavel Belous <pavel.belous@aquantia.com>
In order for the checksum offloads to work correctly we need to set the
packet type bit (TCP/UDP) in the TX context buffer.
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
---
drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index ee78444..db2b51d 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -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) {
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 net 3/5] net:ethernet:aquantia: Missing spinlock initialization.
2017-03-22 21:19 [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 1/5] net:ethernet:aquantia: Remove adapter re-opening when mtu changed Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6 Pavel Belous
@ 2017-03-22 21:19 ` Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6 Pavel Belous
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Pavel Belous @ 2017-03-22 21:19 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari, Pavel Belous
From: Pavel Belous <pavel.belous@aquantia.com>
Fix for missing initialization aq_ring header.lock spinlock.
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
---
drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
index 0358e607..3a8a4aa 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
@@ -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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6.
2017-03-22 21:19 [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Pavel Belous
` (2 preceding siblings ...)
2017-03-22 21:19 ` [PATCH v2 net 3/5] net:ethernet:aquantia: Missing spinlock initialization Pavel Belous
@ 2017-03-22 21:19 ` Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 5/5] net:ethernet:aquantia: Reset is_gso flag when EOP reached Pavel Belous
2017-03-22 21:44 ` [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Florian Fainelli
5 siblings, 0 replies; 8+ messages in thread
From: Pavel Belous @ 2017-03-22 21:19 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari, Pavel Belous
From: Pavel Belous <pavel.belous@aquantia.com>
Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6.
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
---
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(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index db2b51d..cdb0299 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -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;
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
index 2572546..eecd6d1 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
@@ -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;
};
};
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index a2b746a..a536875 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -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;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index cab2931..69488c9 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 net 5/5] net:ethernet:aquantia: Reset is_gso flag when EOP reached.
2017-03-22 21:19 [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Pavel Belous
` (3 preceding siblings ...)
2017-03-22 21:19 ` [PATCH v2 net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6 Pavel Belous
@ 2017-03-22 21:19 ` Pavel Belous
2017-03-22 21:44 ` [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Florian Fainelli
5 siblings, 0 replies; 8+ messages in thread
From: Pavel Belous @ 2017-03-22 21:19 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari, Pavel Belous
From: Pavel Belous <pavel.belous@aquantia.com>
We need to reset is_gso flag when EOP reached (entire LSO packet processed).
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
---
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(+)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index a536875..4ee15ff 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -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;
}
}
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index 69488c9..4215070 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -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;
}
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver.
2017-03-22 21:19 [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Pavel Belous
` (4 preceding siblings ...)
2017-03-22 21:19 ` [PATCH v2 net 5/5] net:ethernet:aquantia: Reset is_gso flag when EOP reached Pavel Belous
@ 2017-03-22 21:44 ` Florian Fainelli
2017-03-22 22:05 ` Pavel Belous
5 siblings, 1 reply; 8+ messages in thread
From: Florian Fainelli @ 2017-03-22 21:44 UTC (permalink / raw)
To: Pavel Belous, David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari
On 03/22/2017 02:19 PM, Pavel Belous wrote:
> From: Pavel Belous <pavel.belous@aquantia.com>
>
> 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!
>
>
> 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(-)
>
--
Florian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver.
2017-03-22 21:44 ` [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Florian Fainelli
@ 2017-03-22 22:05 ` Pavel Belous
0 siblings, 0 replies; 8+ messages in thread
From: Pavel Belous @ 2017-03-22 22:05 UTC (permalink / raw)
To: Florian Fainelli, David S . Miller; +Cc: netdev, Simon Edelhaus, David Arcari
On 03/23/2017 12:44 AM, Florian Fainelli wrote:
> On 03/22/2017 02:19 PM, Pavel Belous wrote:
>> From: Pavel Belous <pavel.belous@aquantia.com>
>>
>> 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!
>
Thank you, Florian.
I will add 'Fixes' tags in patchset v3.
Regards,
Pavel
>>
>>
>> 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(-)
>>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-03-22 22:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22 21:19 [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 1/5] net:ethernet:aquantia: Remove adapter re-opening when mtu changed Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 2/5] net:ethernet:aquantia: Fix packet type detection (TCP/UDP) for IPv6 Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 3/5] net:ethernet:aquantia: Missing spinlock initialization Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 4/5] net:ethernet:aquantia: Fix for LSO with IPv6 Pavel Belous
2017-03-22 21:19 ` [PATCH v2 net 5/5] net:ethernet:aquantia: Reset is_gso flag when EOP reached Pavel Belous
2017-03-22 21:44 ` [PATCH v2 net 0/5] net:ethernet:aquantia: Misc fixes for atlantic driver Florian Fainelli
2017-03-22 22:05 ` Pavel Belous
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).