Skip to content

Commit 4b470a7

Browse files
DaveWildergregkh
authored andcommitted
ibmveth: Identify ingress large send packets.
[ Upstream commit 413f142 ] 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: 7b59673 ("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> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4776258 commit 4b470a7

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/net/ethernet/ibm/ibmveth.c

Lines changed: 12 additions & 1 deletion
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,7 +1386,17 @@ 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 (length > netdev->mtu + ETH_HLEN) {
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;
1396+
}
1397+
1398+
if ((length > netdev->mtu + ETH_HLEN) ||
1399+
lrg_pkt || iph_check == 0xffff) {
13891400
ibmveth_rx_mss_helper(skb, mss, lrg_pkt);
13901401
adapter->rx_large_packets++;
13911402
}

0 commit comments

Comments
 (0)