From patchwork Tue Oct 13 23:20:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wilder X-Patchwork-Id: 1381753 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=NleiPMTX; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4C9s3z5tQdz9ryj for ; Wed, 14 Oct 2020 10:21:03 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388861AbgJMXVC (ORCPT ); Tue, 13 Oct 2020 19:21:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:61418 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388762AbgJMXVB (ORCPT ); Tue, 13 Oct 2020 19:21:01 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09DN32nb194383; Tue, 13 Oct 2020 19:21:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=w5hvRibf+Xl0v/FPgqgUM7+dtyolydgzdOvYDD2XYqA=; b=NleiPMTXSCkPUj2TUvXsi+TfrbNewBttj779b3g3yI7ZH30oC4e3IvPxtm0cJdsaF589 S7+f0dSXH4yC+vKnI3BlSrtnzp4fv6v7/8wqlCBjBZr/h9bP78I+lrJFig0de1NfYwjB 3+vln7UBScA2+3dVynFXMM2MzrpwSzVaqyyUhZfniVhNflbypUH2+Uv60+i0I2f6B3KX Xay8KSupBxpT8SONSLBDXUxnOdupvZy0Qasu7rHwYiJdfjav264T0K7DPMJppy2/ZRRj p03kqPOCmGJasf/77k3hX8XMg7KL/hmu43Hzfzgt68NaKPafm2tVW3t2Cp8kzc/j/2Sx Dg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 345n2k12u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 19:20:59 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 09DNItFt093464; Tue, 13 Oct 2020 19:20:59 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 345n2k12u1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 19:20:59 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09DNHin9016362; Tue, 13 Oct 2020 23:20:58 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma03dal.us.ibm.com with ESMTP id 3434k8tddy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 23:20:58 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09DNKvvY55116122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Oct 2020 23:20:57 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1080BAE062; Tue, 13 Oct 2020 23:20:57 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C7A3AE063; Tue, 13 Oct 2020 23:20:55 +0000 (GMT) Received: from oc8377887825.ibm.com (unknown [9.65.207.144]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 13 Oct 2020 23:20:55 +0000 (GMT) From: David Wilder To: netdev@vger.kernel.org Cc: tlfalcon@linux.ibm.com, cris.forno@ibm.com, pradeeps@linux.vnet.ibm.com, wilder@us.ibm.com, willemdebruijn.kernel@gmail.com, kuba@kernel.org Subject: [ PATCH v2 1/2] ibmveth: Switch order of ibmveth_helper calls. Date: Tue, 13 Oct 2020 16:20:13 -0700 Message-Id: <20201013232014.26044-2-dwilder@us.ibm.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201013232014.26044-1-dwilder@us.ibm.com> References: <20201013232014.26044-1-dwilder@us.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-13_16:2020-10-13,2020-10-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 mlxscore=0 malwarescore=0 adultscore=0 priorityscore=1501 suspectscore=1 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010130160 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Reviewed-by: Thomas Falcon Reviewed-by: Cristobal Forno Reviewed-by: Pradeep Satyanarayana Acked-by: Willem de Bruijn --- 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++; From patchwork Tue Oct 13 23:20:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wilder X-Patchwork-Id: 1381754 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=gCAFMtuh; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4C9s433TR2z9ryj for ; Wed, 14 Oct 2020 10:21:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388881AbgJMXVG (ORCPT ); Tue, 13 Oct 2020 19:21:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42952 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388809AbgJMXVD (ORCPT ); Tue, 13 Oct 2020 19:21:03 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09DN2u0k168720; Tue, 13 Oct 2020 19:21:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=V9Wu368UELjgKQ7FBUQ0Gc5qiGKEPhNQDsUqm7YOJ3o=; b=gCAFMtuhbsqmGzaOjoXYan7H31eAQcHFFnDtzUOVP06nwqFHZ/yBLe8fHdJkXRHe6a5K HsZSpIPLU4E0d7B2bNic5MpIx8ytCH5aR96WixvHkTotZzTsb8hs/6PGcr1x3S1kKqCk 7HmkluGmO9kDEytdVNGRdqCTdT7OU5fXRLMSIGH1BS7zZByOq3pxE0MY2/VOgtBrYDOD yHvPjTRVdCDa5XL+75zOggjEEjcxA8pMcNuhxW3iuzJ3/2UoiTMvJDN+lEwoCxVIp7Wt adP2KOsHFEF8te7q/W9OliCkn66hxcCeDjXWSD2FElSbU/7auqP1kapcv/HoX2AnWhWX wg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 345m0b2p45-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 19:21:01 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 09DN3omC171552; Tue, 13 Oct 2020 19:21:00 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 345m0b2p3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 19:21:00 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09DNH6mE032654; Tue, 13 Oct 2020 23:21:00 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04wdc.us.ibm.com with ESMTP id 3434k8ugx0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 23:21:00 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09DNKwZJ16384608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Oct 2020 23:20:58 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0AF9AE05F; Tue, 13 Oct 2020 23:20:58 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 567CDAE05C; Tue, 13 Oct 2020 23:20:57 +0000 (GMT) Received: from oc8377887825.ibm.com (unknown [9.65.207.144]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 13 Oct 2020 23:20:57 +0000 (GMT) From: David Wilder To: netdev@vger.kernel.org Cc: tlfalcon@linux.ibm.com, cris.forno@ibm.com, pradeeps@linux.vnet.ibm.com, wilder@us.ibm.com, willemdebruijn.kernel@gmail.com, kuba@kernel.org Subject: [ PATCH v2 2/2] ibmveth: Identify ingress large send packets. Date: Tue, 13 Oct 2020 16:20:14 -0700 Message-Id: <20201013232014.26044-3-dwilder@us.ibm.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201013232014.26044-1-dwilder@us.ibm.com> References: <20201013232014.26044-1-dwilder@us.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-13_16:2020-10-13,2020-10-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=865 priorityscore=1501 bulkscore=0 impostorscore=0 spamscore=0 suspectscore=1 adultscore=0 malwarescore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010130160 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Reviewed-by: Thomas Falcon Reviewed-by: Cristobal Forno Reviewed-by: Pradeep Satyanarayana Acked-by: Willem de Bruijn --- 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++; }