From patchwork Wed May 17 20:48:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 763764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wSnPC15xrz9s4q for ; Thu, 18 May 2017 07:23:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9331C87A1F; Wed, 17 May 2017 21:23:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4G20SYqtZEn8; Wed, 17 May 2017 21:23:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 609F487C66; Wed, 17 May 2017 21:23:39 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 517361C0E4A for ; Wed, 17 May 2017 21:13:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3D2218887F for ; Wed, 17 May 2017 21:13:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JeKRV-2ThDfc for ; Wed, 17 May 2017 21:13:39 +0000 (UTC) X-Greylist: delayed 00:24:39 by SQLgrey-1.7.6 Received: from gateway36.websitewelcome.com (gateway36.websitewelcome.com [192.185.187.5]) by whitealder.osuosl.org (Postfix) with ESMTPS id F3DB687695 for ; Wed, 17 May 2017 21:13:38 +0000 (UTC) Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway36.websitewelcome.com (Postfix) with ESMTP id D94724014E619 for ; Wed, 17 May 2017 15:48:58 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id B5sBd7N1bCWWRB5sBdxhK7; Wed, 17 May 2017 15:48:43 -0500 Received: from gator4166.hostgator.com ([108.167.133.22]:29008) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1dB5sQ-000Dnq-JW; Wed, 17 May 2017 15:48:58 -0500 Received: from 189.152.179.187 ([189.152.179.187]) by gator4166.hostgator.com (Horde Framework) with HTTPS; Wed, 17 May 2017 15:48:58 -0500 Date: Wed, 17 May 2017 15:48:58 -0500 Message-ID: <20170517154858.Horde.xMvsIEhHNSGu52mfyp7HA3R@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: Jeff Kirsher User-Agent: Horde Application Framework 5 MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.osuosl.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Exim-ID: 1dB5sQ-000Dnq-JW X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:29008 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 3 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Mailman-Approved-At: Wed, 17 May 2017 21:23:38 +0000 Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Hello everybody, While looking into Coverity ID 1408956 I ran into the following piece of code at drivers/net/ethernet/intel/i40e/i40e_main.c:8807: 8807 if (pf->hw.mac.type == I40E_MAC_X722) { 8808 pf->flags |= I40E_FLAG_RSS_AQ_CAPABLE 8809 | I40E_FLAG_128_QP_RSS_CAPABLE 8810 | I40E_FLAG_HW_ATR_EVICT_CAPABLE 8811 | I40E_FLAG_OUTER_UDP_CSUM_CAPABLE 8812 | I40E_FLAG_WB_ON_ITR_CAPABLE 8813 | I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE 8814 | I40E_FLAG_NO_PCI_LINK_CHECK 8815 | I40E_FLAG_USE_SET_LLDP_MIB 8816 | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE 8817 | I40E_FLAG_PTP_L4_CAPABLE 8818 | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE; 8819 } else if ((pf->hw.aq.api_maj_ver > 1) || 8820 ((pf->hw.aq.api_maj_ver == 1) && 8821 (pf->hw.aq.api_min_ver > 4))) { 8822 /* Supported in FW API version higher than 1.4 */ 8823 pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE; 8824 pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE; 8825 } else { 8826 pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE; 8827 } The issue here is that the assignment at line 8823 is overwritten by the code at line 8824. I'm suspicious that line 8824 should be remove and a patch like the following can be applied: index d5c9c9e..48ffa73 100644 What do you think? Thanks! --- Gustavo A. R. Silva --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -8821,7 +8821,6 @@ static int i40e_sw_init(struct i40e_pf *pf) (pf->hw.aq.api_min_ver > 4))) { /* Supported in FW API version higher than 1.4 */ pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE; - pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE; } else { pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE; }