netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ PATCH v2 0/2] ibmveth gso fix.
@ 2020-10-13 23:20 David Wilder
  2020-10-13 23:20 ` [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls David Wilder
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Wilder @ 2020-10-13 23:20 UTC (permalink / raw)
  To: netdev
  Cc: tlfalcon, cris.forno, pradeeps, wilder, willemdebruijn.kernel, kuba

The ibmveth driver is a virtual Ethernet driver used on IBM pSeries systems.
Gso packets can be sent between LPARS (virtual hosts) without segmentation,
by flagging gso packets using one of two methods depending on the firmware
version. Some gso packet were not correctly identified by the receiver.
This patch-set corrects this issue.

V2:
- Added fix tags.
- Byteswap the constant at compilation time.
- Updated the commit message to clarify what frame validation is performed
  by the hypervisor.

Signed-off-by: David Wilder <dwilder@us.ibm.com>
Reviewed-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Reviewed-by: Cristobal Forno <cris.forno@ibm.com>
Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>

David Wilder (2):
  ibmveth: Switch order of ibmveth_helper calls.
  ibmveth: Identify ingress large send packets.

 drivers/net/ethernet/ibm/ibmveth.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls.
  2020-10-13 23:20 [ PATCH v2 0/2] ibmveth gso fix David Wilder
@ 2020-10-13 23:20 ` David Wilder
  2020-10-14 16:22   ` Willem de Bruijn
  2020-10-15  3:23   ` Jakub Kicinski
  2020-10-13 23:20 ` [ PATCH v2 2/2] ibmveth: Identify ingress large send packets David Wilder
  2020-10-15  3:23 ` [ PATCH v2 0/2] ibmveth gso fix Jakub Kicinski
  2 siblings, 2 replies; 7+ messages in thread
From: David Wilder @ 2020-10-13 23:20 UTC (permalink / raw)
  To: netdev
  Cc: tlfalcon, cris.forno, pradeeps, wilder, willemdebruijn.kernel, kuba

ibmveth_rx_csum_helper() must be called after ibmveth_rx_mss_helper()
as ibmveth_rx_csum_helper() may alter ip and tcp checksum values.

Fixes: 66aa0678efc2 ("ibmveth: Support to enable LSO/CSO for Trunk
VEA.")
Signed-off-by: David Wilder <dwilder@us.ibm.com>
Reviewed-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Reviewed-by: Cristobal Forno <cris.forno@ibm.com>
Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmveth.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index c5c732601e35..3935a7e22ce5 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1385,16 +1385,16 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
 			skb_put(skb, length);
 			skb->protocol = eth_type_trans(skb, netdev);
 
-			if (csum_good) {
-				skb->ip_summed = CHECKSUM_UNNECESSARY;
-				ibmveth_rx_csum_helper(skb, adapter);
-			}
-
 			if (length > netdev->mtu + ETH_HLEN) {
 				ibmveth_rx_mss_helper(skb, mss, lrg_pkt);
 				adapter->rx_large_packets++;
 			}
 
+			if (csum_good) {
+				skb->ip_summed = CHECKSUM_UNNECESSARY;
+				ibmveth_rx_csum_helper(skb, adapter);
+			}
+
 			napi_gro_receive(napi, skb);	/* send it up */
 
 			netdev->stats.rx_packets++;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [ PATCH v2 2/2] ibmveth: Identify ingress large send packets.
  2020-10-13 23:20 [ PATCH v2 0/2] ibmveth gso fix David Wilder
  2020-10-13 23:20 ` [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls David Wilder
@ 2020-10-13 23:20 ` David Wilder
  2020-10-14 16:23   ` Willem de Bruijn
  2020-10-15  3:23 ` [ PATCH v2 0/2] ibmveth gso fix Jakub Kicinski
  2 siblings, 1 reply; 7+ messages in thread
From: David Wilder @ 2020-10-13 23:20 UTC (permalink / raw)
  To: netdev
  Cc: tlfalcon, cris.forno, pradeeps, wilder, willemdebruijn.kernel, kuba

Ingress large send packets are identified by either:
The IBMVETH_RXQ_LRG_PKT flag in the receive buffer
or with a -1 placed in the ip header checksum.
The method used depends on firmware version. Frame
geometry and sufficient header validation is performed by the
hypervisor eliminating the need for further header checks here.

Fixes: 7b5967389f5a ("ibmveth: set correct gso_size and gso_type")
Signed-off-by: David Wilder <dwilder@us.ibm.com>
Reviewed-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Reviewed-by: Cristobal Forno <cris.forno@ibm.com>
Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmveth.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index 3935a7e22ce5..7ef3369953b6 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1349,6 +1349,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
 			int offset = ibmveth_rxq_frame_offset(adapter);
 			int csum_good = ibmveth_rxq_csum_good(adapter);
 			int lrg_pkt = ibmveth_rxq_large_packet(adapter);
+			__sum16 iph_check = 0;
 
 			skb = ibmveth_rxq_get_buffer(adapter);
 
@@ -1385,7 +1386,17 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
 			skb_put(skb, length);
 			skb->protocol = eth_type_trans(skb, netdev);
 
-			if (length > netdev->mtu + ETH_HLEN) {
+			/* PHYP without PLSO support places a -1 in the ip
+			 * checksum for large send frames.
+			 */
+			if (skb->protocol == cpu_to_be16(ETH_P_IP)) {
+				struct iphdr *iph = (struct iphdr *)skb->data;
+
+				iph_check = iph->check;
+			}
+
+			if ((length > netdev->mtu + ETH_HLEN) ||
+			    lrg_pkt || iph_check == 0xffff) {
 				ibmveth_rx_mss_helper(skb, mss, lrg_pkt);
 				adapter->rx_large_packets++;
 			}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls.
  2020-10-13 23:20 ` [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls David Wilder
@ 2020-10-14 16:22   ` Willem de Bruijn
  2020-10-15  3:23   ` Jakub Kicinski
  1 sibling, 0 replies; 7+ messages in thread
From: Willem de Bruijn @ 2020-10-14 16:22 UTC (permalink / raw)
  To: David Wilder
  Cc: Network Development, tlfalcon, cris.forno, pradeeps, wilder,
	Willem de Bruijn, Jakub Kicinski

On Tue, Oct 13, 2020 at 7:21 PM David Wilder <dwilder@us.ibm.com> wrote:
>
> ibmveth_rx_csum_helper() must be called after ibmveth_rx_mss_helper()
> as ibmveth_rx_csum_helper() may alter ip and tcp checksum values.
>
> Fixes: 66aa0678efc2 ("ibmveth: Support to enable LSO/CSO for Trunk
> VEA.")
> Signed-off-by: David Wilder <dwilder@us.ibm.com>
> Reviewed-by: Thomas Falcon <tlfalcon@linux.ibm.com>
> Reviewed-by: Cristobal Forno <cris.forno@ibm.com>
> Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>

Acked-by: Willem de Bruijn <willemb@google.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ PATCH v2 2/2] ibmveth: Identify ingress large send packets.
  2020-10-13 23:20 ` [ PATCH v2 2/2] ibmveth: Identify ingress large send packets David Wilder
@ 2020-10-14 16:23   ` Willem de Bruijn
  0 siblings, 0 replies; 7+ messages in thread
From: Willem de Bruijn @ 2020-10-14 16:23 UTC (permalink / raw)
  To: David Wilder
  Cc: Network Development, tlfalcon, cris.forno, pradeeps, wilder,
	Jakub Kicinski

On Tue, Oct 13, 2020 at 7:21 PM David Wilder <dwilder@us.ibm.com> wrote:
>
> Ingress large send packets are identified by either:
> The IBMVETH_RXQ_LRG_PKT flag in the receive buffer
> or with a -1 placed in the ip header checksum.
> The method used depends on firmware version. Frame
> geometry and sufficient header validation is performed by the
> hypervisor eliminating the need for further header checks here.
>
> Fixes: 7b5967389f5a ("ibmveth: set correct gso_size and gso_type")
> Signed-off-by: David Wilder <dwilder@us.ibm.com>
> Reviewed-by: Thomas Falcon <tlfalcon@linux.ibm.com>
> Reviewed-by: Cristobal Forno <cris.forno@ibm.com>
> Reviewed-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>

Acked-by: Willem de Bruijn <willemb@google.com>

Thanks for clarifying the header validation. I clearly had missed that :)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ PATCH v2 0/2] ibmveth gso fix.
  2020-10-13 23:20 [ PATCH v2 0/2] ibmveth gso fix David Wilder
  2020-10-13 23:20 ` [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls David Wilder
  2020-10-13 23:20 ` [ PATCH v2 2/2] ibmveth: Identify ingress large send packets David Wilder
@ 2020-10-15  3:23 ` Jakub Kicinski
  2 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2020-10-15  3:23 UTC (permalink / raw)
  To: David Wilder
  Cc: netdev, tlfalcon, cris.forno, pradeeps, wilder, willemdebruijn.kernel

On Tue, 13 Oct 2020 16:20:12 -0700 David Wilder wrote:
> The ibmveth driver is a virtual Ethernet driver used on IBM pSeries systems.
> Gso packets can be sent between LPARS (virtual hosts) without segmentation,
> by flagging gso packets using one of two methods depending on the firmware
> version. Some gso packet were not correctly identified by the receiver.
> This patch-set corrects this issue.
> 
> V2:
> - Added fix tags.
> - Byteswap the constant at compilation time.
> - Updated the commit message to clarify what frame validation is performed
>   by the hypervisor.

Applied, thanks everyone!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls.
  2020-10-13 23:20 ` [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls David Wilder
  2020-10-14 16:22   ` Willem de Bruijn
@ 2020-10-15  3:23   ` Jakub Kicinski
  1 sibling, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2020-10-15  3:23 UTC (permalink / raw)
  To: David Wilder
  Cc: netdev, tlfalcon, cris.forno, pradeeps, wilder, willemdebruijn.kernel

On Tue, 13 Oct 2020 16:20:13 -0700 David Wilder wrote:
> Fixes: 66aa0678efc2 ("ibmveth: Support to enable LSO/CSO for Trunk
> VEA.")

Please make sure Fixes tags are not wrapped in the future.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-10-15  3:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 23:20 [ PATCH v2 0/2] ibmveth gso fix David Wilder
2020-10-13 23:20 ` [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls David Wilder
2020-10-14 16:22   ` Willem de Bruijn
2020-10-15  3:23   ` Jakub Kicinski
2020-10-13 23:20 ` [ PATCH v2 2/2] ibmveth: Identify ingress large send packets David Wilder
2020-10-14 16:23   ` Willem de Bruijn
2020-10-15  3:23 ` [ PATCH v2 0/2] ibmveth gso fix Jakub Kicinski

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).