From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] net: ethernet: sun: niu set correct packet size in skb Date: Thu, 03 May 2018 16:04:55 -0400 (EDT) Message-ID: <20180503.160455.1091782405023067534.davem@davemloft.net> References: <1525359964.11695.1@server175.web-hosting.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: rob@taglang.io Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:52052 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbeECUE6 (ORCPT ); Thu, 3 May 2018 16:04:58 -0400 In-Reply-To: <1525359964.11695.1@server175.web-hosting.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Rob Taglang Date: Thu, 03 May 2018 11:06:04 -0400 > 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]. > > This is a resubmission after subscribing to the list; I think it got > caught in a spam filter since I can't see my message in the archive, > but if not and this is just pissing off a maintainer I'm really sorry. > > Signed-off-by: Rob Taglang > --- > drivers/net/ethernet/sun/niu.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/sun/niu.c > b/drivers/net/ethernet/sun/niu.c > index f081de4..88c1247 100644 > --- a/drivers/net/ethernet/sun/niu.c > +++ b/drivers/net/ethernet/sun/niu.c > @@ -3443,7 +3443,7 @@ static int niu_process_rx_pkt(struct napi_struct > *napi, struct niu *np, > > len = (val & RCR_ENTRY_L2_LEN) >> > RCR_ENTRY_L2_LEN_SHIFT; > - len -= ETH_FCS_LEN; > + append_size = len + ETH_HLEN + ETH_FCS_LEN; This patch is severely corrupted by your email client. Please fix this, send the patch to yourself as a test, and only repost the patch here on the list once you can successfully apply the patch contained in the test email. Thanks.