From patchwork Thu Oct 8 19:05:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David J Wilder X-Patchwork-Id: 11824377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7535EC43457 for ; Thu, 8 Oct 2020 19:06:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08491221FE for ; Thu, 8 Oct 2020 19:06:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ki5ofLH8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729506AbgJHTGp (ORCPT ); Thu, 8 Oct 2020 15:06:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55572 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725887AbgJHTGo (ORCPT ); Thu, 8 Oct 2020 15:06:44 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 098J0k1T036183 for ; Thu, 8 Oct 2020 15:06:43 -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=aAQqzQ7/gGPOEh+om+A3VuXxcKPBjyug6lMuW8CYHVU=; b=ki5ofLH8YaNey0mjbiZdt2OZgxF3cmOdqEWYZ+I69eDEsemJsWNhY106/tvdqgamgwO/ f7DVz1bkpwk7tlfKt7ynwlcNRyNefafEZwzViOYtNo6lACqkzgf3w+WKlZ29/xkUxNtR sqSARAE8ikI1qypzljqd3XnY5xxyt2jo71cPzUsDCGeBqGExMs2WwckH/yhy7QP/JnwL rAWJogfElRhe9B31cNpdjKMaefqD+XDGp0QicRU+rSSJorZkhOvM/Lz9I7SfaTVCbJI4 1leKHvZE+1PeaD8UDBBzbCsJt2S2k/hL8MYlSrN67mfZc29PMuMM6KovnLKikGS0p/+c 8w== Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 3427xp1bjf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Oct 2020 15:06:43 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 098IrRal018835 for ; Thu, 8 Oct 2020 19:06:43 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma02wdc.us.ibm.com with ESMTP id 341carb07m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Oct 2020 19:06:43 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 098J6dXR42795430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Oct 2020 19:06:39 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C58C8BE059; Thu, 8 Oct 2020 19:06:39 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F1B7BE054; Thu, 8 Oct 2020 19:06:38 +0000 (GMT) Received: from oc8377887825.ibm.com (unknown [9.160.28.108]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 8 Oct 2020 19:06:38 +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 Subject: [ PATCH v1 1/2] ibmveth: Switch order of ibmveth_helper calls. Date: Thu, 8 Oct 2020 12:05:37 -0700 Message-Id: <20201008190538.6223-2-dwilder@us.ibm.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201008190538.6223-1-dwilder@us.ibm.com> References: <20201008190538.6223-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-08_12:2020-10-08,2020-10-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 adultscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=952 suspectscore=1 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010080133 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. 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 c5c7326..3935a7e 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 Thu Oct 8 19:05:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David J Wilder X-Patchwork-Id: 11824385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17EE6C433DF for ; Thu, 8 Oct 2020 19:06:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D541221FE for ; Thu, 8 Oct 2020 19:06:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ZU/eoNvw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729520AbgJHTGs (ORCPT ); Thu, 8 Oct 2020 15:06:48 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42856 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgJHTGq (ORCPT ); Thu, 8 Oct 2020 15:06:46 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 098J3Mfx117351 for ; Thu, 8 Oct 2020 15:06:45 -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=257nyO53XDdwa+Kdzw+f02+Zpc+6657u4DZTzaq0NSg=; b=ZU/eoNvwXSlOcinXhmsCqbjANo8an94Zh9n8nljVeMWFWfX0H85JQHNE5nFaL0AXTcoQ YgZi/WHjI7w2wma/OeNtu8Xig6jlY9ArBOCPpJ25EwFf4VPZg/ZckIhTEjDsbNzemg63 VB2IfaztpFCgHBxYITzgxWoBqdzszlL5efDqFIKxjUo/yIYUM9jPcEtVG7LJ0DKG1R3R cVOFhL7KVbQRS6+d/teDS8LvW2lxDGjw7iT3AnzUKdKda9tgMPJlRpyVFRFqqEn38hqS rnW3rvi45B+RSey0E42RwqjOah6bAV0GlLLuCHeLJbTm7PTxiU8ny6Pwoxw+k+07aMqa ww== 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 3428j0g6am-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Oct 2020 15:06:45 -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 098Ipe6D014458 for ; Thu, 8 Oct 2020 19:06:44 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma03dal.us.ibm.com with ESMTP id 33xgxa3u5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Oct 2020 19:06:44 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 098J6fha51773862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Oct 2020 19:06:41 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A16FFBE058; Thu, 8 Oct 2020 19:06:41 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 493C4BE054; Thu, 8 Oct 2020 19:06:40 +0000 (GMT) Received: from oc8377887825.ibm.com (unknown [9.160.28.108]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 8 Oct 2020 19:06:40 +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 Subject: [ PATCH v1 2/2] ibmveth: Identify ingress large send packets. Date: Thu, 8 Oct 2020 12:05:38 -0700 Message-Id: <20201008190538.6223-3-dwilder@us.ibm.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20201008190538.6223-1-dwilder@us.ibm.com> References: <20201008190538.6223-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-08_12:2020-10-08,2020-10-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 suspectscore=1 impostorscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 spamscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010080134 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. Signed-off-by: David Wilder Reviewed-by: Thomas Falcon Reviewed-by: Cristobal Forno Reviewed-by: Pradeep Satyanarayana --- 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 3935a7e..e357cbe 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 (be16_to_cpu(skb->protocol) == 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++; }