From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 132B5325F for ; Mon, 22 Jan 2018 13:26:22 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 04:26:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,396,1511856000"; d="scan'208";a="21600047" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.48]) ([10.237.220.48]) by FMSMGA003.fm.intel.com with ESMTP; 22 Jan 2018 04:26:21 -0800 To: Ajit Khaparde , dev@dpdk.org References: <20180122062046.81908-1-ajit.khaparde@broadcom.com> <20180122062046.81908-5-ajit.khaparde@broadcom.com> From: Ferruh Yigit Message-ID: <832e9f66-fa74-07cb-7908-9808937c94a9@intel.com> Date: Mon, 22 Jan 2018 12:26:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180122062046.81908-5-ajit.khaparde@broadcom.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 4/5] net/bnxt: check if MAC address is all zeros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2018 12:26:23 -0000 On 1/22/2018 6:20 AM, Ajit Khaparde wrote: > In certain cases the MAC address of a port could be all zeros. > Catch it early, log a message and fail the initiaization. > > Signed-off-by: Ajit Khaparde <...> > @@ -3247,6 +3247,16 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev) > rc = -ENOMEM; > goto error_free; > } > + > + if (check_zero_bytes(bp->dflt_mac_addr, ETHER_ADDR_LEN)) { There is already a function is_zero_ether_addr() which can be used here that prevents exposing your check_zero_bytes() function, up to you which one to use.