Skip to content

Commit 15f0d29

Browse files
committed
Merge branch 'ibmveth-gso-fix'
David Wilder says: ==================== 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. ==================== Link: https://lore.kernel.org/r/20201013232014.26044-1-dwilder@us.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 2ef813b + 413f142 commit 15f0d29

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

drivers/net/ethernet/ibm/ibmveth.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
13491349
int offset = ibmveth_rxq_frame_offset(adapter);
13501350
int csum_good = ibmveth_rxq_csum_good(adapter);
13511351
int lrg_pkt = ibmveth_rxq_large_packet(adapter);
1352+
__sum16 iph_check = 0;
13521353

13531354
skb = ibmveth_rxq_get_buffer(adapter);
13541355

@@ -1385,16 +1386,26 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
13851386
skb_put(skb, length);
13861387
skb->protocol = eth_type_trans(skb, netdev);
13871388

1388-
if (csum_good) {
1389-
skb->ip_summed = CHECKSUM_UNNECESSARY;
1390-
ibmveth_rx_csum_helper(skb, adapter);
1389+
/* PHYP without PLSO support places a -1 in the ip
1390+
* checksum for large send frames.
1391+
*/
1392+
if (skb->protocol == cpu_to_be16(ETH_P_IP)) {
1393+
struct iphdr *iph = (struct iphdr *)skb->data;
1394+
1395+
iph_check = iph->check;
13911396
}
13921397

1393-
if (length > netdev->mtu + ETH_HLEN) {
1398+
if ((length > netdev->mtu + ETH_HLEN) ||
1399+
lrg_pkt || iph_check == 0xffff) {
13941400
ibmveth_rx_mss_helper(skb, mss, lrg_pkt);
13951401
adapter->rx_large_packets++;
13961402
}
13971403

1404+
if (csum_good) {
1405+
skb->ip_summed = CHECKSUM_UNNECESSARY;
1406+
ibmveth_rx_csum_helper(skb, adapter);
1407+
}
1408+
13981409
napi_gro_receive(napi, skb); /* send it up */
13991410

14001411
netdev->stats.rx_packets++;

0 commit comments

Comments
 (0)