Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473AbdFGTzj (ORCPT ); Wed, 7 Jun 2017 15:55:39 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60062 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751072AbdFGTzh (ORCPT ); Wed, 7 Jun 2017 15:55:37 -0400 Date: Wed, 7 Jun 2017 16:55:27 -0300 From: Mauro Rodrigues To: Jeff Kirsher Cc: "Gustavo A. R. Silva" , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-intel-i40e] question about assignment overwrite References: <20170517154858.Horde.xMvsIEhHNSGu52mfyp7HA3R@gator4166.hostgator.com> <1495086551.46489.1.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1495086551.46489.1.camel@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-MML: disable x-cbid: 17060719-0024-0000-0000-0000017DEA06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060719-0025-0000-0000-00001645FC9A Message-Id: <20170607195526.GA26867@korriban> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-07_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706070357 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2593 Lines: 58 On Wed, May 17, 2017 at 10:49:11PM -0700, Jeff Kirsher wrote: > On Wed, 2017-05-17 at 15:48 -0500, Gustavo A. R. Silva wrote: > > 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 > > --- 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; > > ???????? } > > > > What do you think? > > This issue is already fixed in my dev-queue branch on my next-queue > tree. Hi Jeff, are you planning to push this fix into net branch anytime soon? Thanks, Mauro