Received: by 10.192.165.148 with SMTP id m20csp527259imm; Wed, 25 Apr 2018 03:42:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+caZDD8PXGRBlGUlRyn5taIMDdfIwj21D0uQqxoaC48b1B/YveL6LmOLNUDLkSnbi94+yp X-Received: by 10.98.13.151 with SMTP id 23mr27697997pfn.231.1524652942637; Wed, 25 Apr 2018 03:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524652942; cv=none; d=google.com; s=arc-20160816; b=rKcS1yH7DKzIXXXTPtzimnS+sv1l8fEQXk+s0LS5OaYEsaRSQXLNYVCw90om6oCbjo Ibe5tQCsZlaCVJkRSPJMDpZl6Rej6C3xeJPc7kVZl8sAmM8auTeq/W1mo0yGrNJUYCuF GMT9DToE8fG4T6GTOhQm2+DF7sMbnLmpVI/e7n7BDlt/aplURmAigIxqNSBuEj72oyZ+ LV9YXuWgSz/iQTFyD5+K2ajGSqzqW1fGq767pvduhFxYNCyNqlp8fzpINp0ztjUZOQ1A wAOOwOu0Cn0Tv3TEOPXwdEwFyygq8PHdSmjs3AOqtbMffVa/MbfTGhA+4xMdpIvnRirr 9SOQ== 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 :arc-authentication-results; bh=FhgKPJs/NBCbE+wo84KcsjMaPRBV9nHVrmNtErZQcwQ=; b=XsVR/JrOGzmETni5MQ5a0hFjLA0CwtVj0Wgov3RoJWolAtseLFEAcS1MdG4ziaswP7 gu2eY31nUFj6Y/5gE57sX0qEvILydC8QB+cr9yGeuZEd+erVM/k/YFctI8Liw6ulTY8R Cpj3I0uO6vBjPZUbEnWskUNAXXxhaKpajiC5j+ZprgcdqIpEJd3mZMd2ADGiix8gL/wA 4r18SJWT8mvA4V6njoNoe5KaCFl+BXlup8ibChiWN9Gu4lqd+rfKcbLHPUL1WpNLNyfg AW8RV9Ns5DiA+PGrDkHBU5egKgV3wOMifzfXWaucByaiAHk0SyMS1Ehx6s3BppwGuz2G t8Hg== ARC-Authentication-Results: i=1; mx.google.com; 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 c131si9047856pfg.108.2018.04.25.03.42.08; Wed, 25 Apr 2018 03:42:22 -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; 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 S1752051AbeDYKlD (ORCPT + 99 others); Wed, 25 Apr 2018 06:41:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52256 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753630AbeDYKk7 (ORCPT ); Wed, 25 Apr 2018 06:40:59 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8286F36; Wed, 25 Apr 2018 10:40:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacob Keller , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.14 095/183] i40e: fix reported mask for ntuple filters Date: Wed, 25 Apr 2018 12:35:15 +0200 Message-Id: <20180425103246.288420349@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jacob Keller [ Upstream commit 40339af33c703bacb336493157d43c86a8bf2fed ] In commit 36777d9fa24c ("i40e: check current configured input set when adding ntuple filters") some code was added to report the input set mask for a given filter when reporting it to the user. This code is necessary so that the reported filter correctly displays that it is or is not masking certain fields. Unfortunately the code was incorrect. Development error accidentally swapped the mask values for the IPv4 addresses with the L4 port numbers. The port numbers are only 16bits wide while IPv4 addresses are 32 bits. Unfortunately we assigned only 16 bits to the IPv4 address masks. Additionally we assigned 32bit value 0xFFFFFFF to the TCP port numbers. This second part does not matter as the value would be truncated to 16bits regardless, but it is unnecessary. Fix the reported masks to properly report that the entire field is masked. Fixes: 36777d9fa24c ("i40e: check current configured input set when adding ntuple filters") Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2588,16 +2588,16 @@ static int i40e_get_ethtool_fdir_entry(s no_input_set: if (input_set & I40E_L3_SRC_MASK) - fsp->m_u.tcp_ip4_spec.ip4src = htonl(0xFFFF); + fsp->m_u.tcp_ip4_spec.ip4src = htonl(0xFFFFFFFF); if (input_set & I40E_L3_DST_MASK) - fsp->m_u.tcp_ip4_spec.ip4dst = htonl(0xFFFF); + fsp->m_u.tcp_ip4_spec.ip4dst = htonl(0xFFFFFFFF); if (input_set & I40E_L4_SRC_MASK) - fsp->m_u.tcp_ip4_spec.psrc = htons(0xFFFFFFFF); + fsp->m_u.tcp_ip4_spec.psrc = htons(0xFFFF); if (input_set & I40E_L4_DST_MASK) - fsp->m_u.tcp_ip4_spec.pdst = htons(0xFFFFFFFF); + fsp->m_u.tcp_ip4_spec.pdst = htons(0xFFFF); if (rule->dest_ctl == I40E_FILTER_PROGRAM_DESC_DEST_DROP_PACKET) fsp->ring_cookie = RX_CLS_FLOW_DISC;