Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2056207imm; Thu, 24 May 2018 05:11:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqiJigKWTHSlxWWQyE8UffvHENIuDZcP8ztHQYLOjlYIvsFh8/2h9aHq7Gj2vFZBMtRE/4t X-Received: by 2002:a63:9741:: with SMTP id d1-v6mr5750055pgo.447.1527163861034; Thu, 24 May 2018 05:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527163861; cv=none; d=google.com; s=arc-20160816; b=N6lf3GS5/O99hROq+G47wI751ayuvc/EUU+50VAJIjK3ZWKjDYsLaEGUQsm5KKBMBL nhaIMD6YHZDYRPt/UGUYb5Lz/DPKF2dQhqZMwFa4GlxsNREu5yegYG/nJBagZ/lFTkGY BrtLOHDHLEkblACugNm4mL6zi0swPOe/16wG+SqUwZJt/GyirceGvlG/+qSQrwUmCrd+ Rv0/tThrnGRLMREe2L3ZCKZscDTcHOCfr8JsNs9NuRztjZldH48Gru2xQBBRGwC7YTtd jvREZ6VJPvVArubyS9rM0aQpNrPFXxBjuHJFQeIxuM7jjOeygT4/ZldPc4cgZpRh4w5T FYwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=LPbuK20ES1PWwBWVpm+ZczrsjYs2C+SdddvZ4xGG03Q=; b=upqO3UJO7ccCfdhbkRdsi23GU5EXkwdODNfIbXqb5qvyo/t1i4KF1PFlSFC+bSb1Dc WSd/uRwKXQuG9vJCz2yiMlPDlzhOO3n69uiYsz6kkHU4OR5z/G6QUDsnKiIxiIgBOFSn kBXjXntZBCFNAUXc4ZzXYBSwc5727GSamLlQ346JIpnFSyi/u2uvqb1cI8ztdUFUyqGq 56kDaNAgVLAyuCmssm5omlCL8noCxDHeBhUtZppZ6a4bKMQhaZUfEl2pO4AYaYOl+e+U noQWWrcOkRhjmqm8PPkGsAWdASDWFg8LaPUkcvgvQOHgKw6/byfUffGKyJpRC7oQi+Dt c4VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wUBXoNVA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si20372079plo.62.2018.05.24.05.10.41; Thu, 24 May 2018 05:11:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wUBXoNVA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966466AbeEXJnT (ORCPT + 99 others); Thu, 24 May 2018 05:43:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:54620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966432AbeEXJnH (ORCPT ); Thu, 24 May 2018 05:43:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 452F8208AF; Thu, 24 May 2018 09:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527154986; bh=5wmsTSdR2T0Db6RXJt/7O/ME3TKr7+rehIslCKesPWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wUBXoNVAaHLNVfodoZcahq/FBP+25VwgKR6u1mJPPq4xaYCQTCCg/p4aBVCkGoQLS mZmJf655jf7i/XPmzOsDoW+/JlRcbpZgn86+Z9qRgNEvg+6NVHlWBrC1gGgqiw/qAd 4/UCJm8KdXUlDS+/0MZ64nLOv6yVBPwcCXmVvl0Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Taglang , "David S. Miller" Subject: [PATCH 4.4 06/92] net: ethernet: sun: niu set correct packet size in skb Date: Thu, 24 May 2018 11:37:43 +0200 Message-Id: <20180524093159.859034674@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rob Taglang [ Upstream commit 14224923c3600bae2ac4dcae3bf0c3d4dc2812be ] Currently, skb->len and skb->data_len are set to the page size, not the packet size. This causes the frame check sequence to not be located at the "end" of the packet resulting in ethernet frame check errors. The driver does work currently, but stricter kernel facing networking solutions like OpenVSwitch will drop these packets as invalid. These changes set the packet size correctly so that these errors no longer occur. The length does not include the frame check sequence, so that subtraction was removed. Tested on Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller [108e:abcd] and validated in wireshark. Signed-off-by: Rob Taglang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/sun/niu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -3442,7 +3442,7 @@ static int niu_process_rx_pkt(struct nap len = (val & RCR_ENTRY_L2_LEN) >> RCR_ENTRY_L2_LEN_SHIFT; - len -= ETH_FCS_LEN; + append_size = len + ETH_HLEN + ETH_FCS_LEN; addr = (val & RCR_ENTRY_PKT_BUF_ADDR) << RCR_ENTRY_PKT_BUF_ADDR_SHIFT; @@ -3452,7 +3452,6 @@ static int niu_process_rx_pkt(struct nap RCR_ENTRY_PKTBUFSZ_SHIFT]; off = addr & ~PAGE_MASK; - append_size = rcr_size; if (num_rcr == 1) { int ptype; @@ -3465,7 +3464,7 @@ static int niu_process_rx_pkt(struct nap else skb_checksum_none_assert(skb); } else if (!(val & RCR_ENTRY_MULTI)) - append_size = len - skb->len; + append_size = append_size - skb->len; niu_rx_skb_append(skb, page, off, append_size, rcr_size); if ((page->index + rp->rbr_block_size) - rcr_size == addr) {