Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2885125rwb; Wed, 30 Nov 2022 12:14:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jMREE7S/uCsF1aeY8Eha4+9a/S5XQUQ8d5iSva6uMcILuDwfP8w0wf5Q/o+25LbzHlZTU X-Received: by 2002:a17:906:aacb:b0:7c0:89b3:b9da with SMTP id kt11-20020a170906aacb00b007c089b3b9damr7670119ejb.275.1669839265142; Wed, 30 Nov 2022 12:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669839265; cv=none; d=google.com; s=arc-20160816; b=oNQutR758MoZAR9bD97EDNerj9oGF0KeLiwFj2UYWm2lPq/XrutQqLLDeKxGuJESGp K3cHaGDl6YNkw/mKTugigqfkQJY1dLh3juVEeDh6jxFVUCE32pkookXoDC3U3EYE9tiQ qPzr5cP4KtQUiyf/922WojWxOQQZ75WXJtqmD1tP/aJasDukj3jyNbHzKR2iCJlRZThS 282YKiItdWkd3XgNe7IzxAzjSDSNod1ryCjxltvz1Lq7lJH0lUZr4GyjG5UhHz+8J7x5 5QukaOcLgDwpD8SzfAE9wftCMmCZH7saKhAbFDYJ4Ggtx8tTyFKNrYoMfD/ZHunY2fvz 65yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zXus7AWbGFvlZk8Sk7ecVLyo2Fsrg0juin66Hc7tbkM=; b=XBPvC+fDaDv5+qkAJMFPqD3OeRXSbYCExwVoe3WYZUvW4GR+WnDDebuqfy0KRufCUP n+Xlbsn0UCY1CYM/00j4uaIefQMbNs/b4Tx6w0tpoR5IejzCc8EzIUeFQJW0t8uNbioj O+0k7tjOdTygjypVlVhh8OCIsfUu01j7EXtYGc3zXbii4fucp6R5bflhrwDVWwOuiOMD 1+Jy1pA+Fyd8bw68CTXwDhNPy9JS+aAGtDI204xS6HlbF8R3aY1tWB97wU1WNkHFSQgO psL5jgfQFTsl0xGlzOy/lQi1YAKzI3/GF8Qup1Vv73Qs733ApDmr1cgnHoUZPDCdBChN jzLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=vx83Cifa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv9-20020a17090760c900b007ae127c6c7asi2147989ejc.176.2022.11.30.12.14.04; Wed, 30 Nov 2022 12:14:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=vx83Cifa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbiK3Tlr (ORCPT + 83 others); Wed, 30 Nov 2022 14:41:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiK3Tlq (ORCPT ); Wed, 30 Nov 2022 14:41:46 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8C58C46D; Wed, 30 Nov 2022 11:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=zXus7AWbGFvlZk8Sk7ecVLyo2Fsrg0juin66Hc7tbkM=; b=vx83Cifa15/f9FRPh/8/OJaaLi 2Th5+WMD3IQT6xqoidPo+vhBW7nAI4mU3m2SBngSrwS7Y3avipQJTvGTxbLdjhyj2iDsysKAZyod7 y3BkMnoDsPajUpr0T7dBuUTw6FDdkQ5LFSOOMk+EHhkiZ00MZlDot3Jd13RAN7qZUjm8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p0SxV-003zgR-1Q; Wed, 30 Nov 2022 20:41:29 +0100 Date: Wed, 30 Nov 2022 20:41:29 +0100 From: Andrew Lunn To: Brian Masney Cc: irusskikh@marvell.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, cth451@gmail.com Subject: Re: [PATCH] net: atlantic: fix check for invalid ethernet addresses Message-ID: References: <20221130174259.1591567-1-bmasney@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221130174259.1591567-1-bmasney@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 30, 2022 at 12:42:59PM -0500, Brian Masney wrote: > The Qualcomm sa8540p automotive development board (QDrive3) has an > Aquantia NIC wired over PCIe. The ethernet MAC address assigned to > all of the boards in our lab is 00:17:b6:00:00:00. The existing > check in aq_nic_is_valid_ether_addr() only checks for leading zeros > in the MAC address. Let's update the check to also check for trailing > zeros in the MAC address so that a random MAC address is assigned > in this case. > > Signed-off-by: Brian Masney > --- > drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c > index 06508eebb585..c9c850bbc805 100644 > --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c > +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c > @@ -293,7 +293,8 @@ static bool aq_nic_is_valid_ether_addr(const u8 *addr) > /* Some engineering samples of Aquantia NICs are provisioned with a > * partially populated MAC, which is still invalid. > */ > - return !(addr[0] == 0 && addr[1] == 0 && addr[2] == 0); > + return !(addr[0] == 0 && addr[1] == 0 && addr[2] == 0) && > + !(addr[3] == 0 && addr[4] == 0 && addr[5] == 0); Hi Brian is_valid_ether_addr() Andrew