Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1226484pxx; Tue, 27 Oct 2020 11:11:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8ssxSUYJedJPpV6lEWC2qcKpRVarllu9o3AochsbICm1sgmWi+5woGbOX5woacvtSOjVx X-Received: by 2002:a05:6402:6d8:: with SMTP id n24mr3617349edy.168.1603822317278; Tue, 27 Oct 2020 11:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603822317; cv=none; d=google.com; s=arc-20160816; b=wK0UhDr4m10qhp8tbEdlERLt2j5VFLC0fCskQfIweL7+9K+Hn5DR9bkOCar6oW0Y7D KIoHKLe+i7lFPCn3+0NXtwahToyl4S+WidQ2vIiny+aqT9sEQgYxJtzszzQkYQJEsgXb ug/hUl8+dWYKgXdHbsX2YAcrT9hQ5ujN7P4PbBlNdQn+TwGPdTsz4L8Wte92Rcyav/TE Xfo+YupBi7JK8+LxBao90VAjGvNtFg/5qnYOrztgCsc5TXC5vOWxix61gZqR8fBdFfq/ Zc1W+5YH2l9bWnoYqYGAGhu4gxxr4akUMEN72Iw5BuOxfYyAj0YK5Q6FJsmiOSOZZ268 aBVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D1RVofsiFSTPHu4Ix6mCaMBKUynozEcQ3erKji0PL4g=; b=ukV+vBDmN98NbLunSLGbIl3rzSud445h9iuR5X18IFj3rYx5zwpI+XnZcmi1GaQRzB sWi+q6Ko6D/eN+wl5d8Gc8tRkCXkgCo6CCayH4LF32k7YDD48zJJBKvMhORNbBM4lo8z lBPmwY4BvG4nDoDsm4JaoO3SD4xO4o598Trqq9NP9xYa7jPVjV7QAZusPDPTtcPM41wL UK1XIik4GpNaLXVzMSDNFS7uqnEBRDOutstARcnNKNYObfB+neH15nNegMSUr7W5ppI8 o7GpDi7IeAEq+x4XXed+PPo6ZB9pKCp+0Jb1q336z2nWuFeuEsdgwUubfIIIYJSP/Ooo +c1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DE0e83iJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si1620492eji.291.2020.10.27.11.11.31; Tue, 27 Oct 2020 11:11:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DE0e83iJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2902233AbgJ0Obh (ORCPT + 99 others); Tue, 27 Oct 2020 10:31:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:55294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759287AbgJ0O2t (ORCPT ); Tue, 27 Oct 2020 10:28:49 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 30CE120754; Tue, 27 Oct 2020 14:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808928; bh=f3oZ6lt1048Bbse2Sgh8W9XGTvPRDZB4uRcJs7R8j4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DE0e83iJog+EhGbKeL0tTiN0XXV8Adhjw7aziZiCPbKzZs6OawUi4B4mezEn5RcOe 9U3LfAnQza3BXN7u5SoRJJfLILvffNqEG9jvKMMHNUJUKdnsY/axD/sNm8VHSg0QKV vOvOjiaDXQ2IR+uGoVefPVTkd3eqnZCUMcRH+ATo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Wilder , Thomas Falcon , Cristobal Forno , Pradeep Satyanarayana , Willem de Bruijn , Jakub Kicinski Subject: [PATCH 5.4 002/408] ibmveth: Identify ingress large send packets. Date: Tue, 27 Oct 2020 14:49:00 +0100 Message-Id: <20201027135455.154994986@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Wilder [ Upstream commit 413f142cc05cb03f2d1ea83388e40c1ddc0d74e9 ] 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 Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ibm/ibmveth.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -1317,6 +1317,7 @@ static int ibmveth_poll(struct napi_stru 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); @@ -1353,7 +1354,17 @@ static int ibmveth_poll(struct napi_stru 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++; }