ibmveth gso fix.
v2 cover ibmveth gso fix.
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.
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(-)
Signature · 1 line
1.8.3.1
PATCH v2 1/2 ibmveth: Switch order of ibmveth_helper calls.
ibmveth_rx_csum_helper() must be called after ibmveth_rx_mss_helper() as ibmveth_rx_csum_helper() may alter ip and tcp checksum values.
VEA.")
--- drivers/net/ethernet/ibm/ibmveth.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/ibm/ibmveth.c +5 -5
@@ -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++;
Signature · 1 line
1.8.3.1
Re: [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls.
Quoted 10 lines · David Wilder
ibmveth_rx_csum_helper()must be called afteribmveth_rx_mss_helper()asibmveth_rx_csum_helper()may alter ip and tcp checksum values.Fixes 66aa0678efc2 ("ibmveth: Support to enable LSO/CSO for TrunkVEA.")
Signed-off-by David Wilder <[email protected]>Reviewed-by Thomas Falcon <[email protected]>Reviewed-by Cristobal Forno <[email protected]>Reviewed-by Pradeep Satyanarayana <[email protected]>
Jakub Kicinski
maintainerRe: [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls.
In reply to David WilderQuoted 2 lines · On Tue, 13 Oct 2020 16:20:13 -0700 David Wilder wrote:
Fixes 66aa0678efc2 ("ibmveth: Support to enable LSO/CSO for TrunkVEA.")
Please make sure Fixes tags are not wrapped in the future.
PATCH v2 2/2 ibmveth: Identify ingress large send packets.
In reply to David WilderIngress 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.
--- drivers/net/ethernet/ibm/ibmveth.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmveth.c +12 -1
@@ -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++; }
Signature · 1 line
1.8.3.1
Re: [ PATCH v2 2/2] ibmveth: Identify ingress large send packets.
Quoted 8 lines · David Wilder
Ingress large send packets are identified by either:
TheIBMVETH_RXQ_LRG_PKTflag 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.
Quoted 5 lines
Fixes 7b5967389f5a ("ibmveth: set correct gso_size and gso_type")Signed-off-by David Wilder <[email protected]>Reviewed-by Thomas Falcon <[email protected]>Reviewed-by Cristobal Forno <[email protected]>Reviewed-by Pradeep Satyanarayana <[email protected]>
Thanks for clarifying the header validation. I clearly had missed that :)
Quoted 11 lines · 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!