From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH 3/4] net/enic: support multicast filtering Date: Mon, 14 Jan 2019 10:29:40 +0000 Message-ID: References: <20181210182857.13043-1-hyonkim@cisco.com> <20181210182857.13043-4-hyonkim@cisco.com> <25e615b7-35ba-8019-62fa-64590ab69d19@intel.com> <20190112044956.GA23480@HYONKIM-7R0DR.cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, John Daley To: Hyong Youb Kim Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E41411B3B5 for ; Mon, 14 Jan 2019 11:29:42 +0100 (CET) In-Reply-To: <20190112044956.GA23480@HYONKIM-7R0DR.cisco.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/12/2019 4:49 AM, Hyong Youb Kim wrote: > On Fri, Jan 11, 2019 at 03:46:47PM +0000, Ferruh Yigit wrote: >> On 12/10/2018 6:28 PM, Hyong Youb Kim wrote: >>> The VIC hardware has 64 MAC filters per vNIC, which can be either >>> unicast or multicast. Use one half for unicast and the other half for >>> multicast, as the VIC kernel drivers for Linux and Windows do. >>> >>> Signed-off-by: Hyong Youb Kim >>> Reviewed-by: John Daley >> >> <...> >> >>> +static void debug_log_add_del_addr(struct ether_addr *addr, bool add) >>> +{ >>> + char mac_str[ETHER_ADDR_FMT_SIZE]; >>> + if (rte_log_get_level(enicpmd_logtype_init) == RTE_LOG_DEBUG) { >>> + ether_format_addr(mac_str, ETHER_ADDR_FMT_SIZE, addr); >>> + PMD_INIT_LOG(ERR, " %s address %s\n", >>> + add ? "add" : "remove", mac_str); >>> + } >>> +} >> >> Why logging with 'ERR' level after checking if 'DEBUG' level is set? > > Thanks for pointing this out. Our mistake. Should be DEBUG. > >> And why need that check at all? > > The outer check ("is log level debug?") is there to make this function > to do nothing (including ether_format_addr) if log level > debug. I > could not find a good way to combine the level test, > ether_format_addr, and rte_log into one clean macro.. > > Since this function is on a slow path, I think I can just remove the > level check and do something like the following. Would this satisfy > your concern? > > char mac_str[ETHER_ADDR_FMT_SIZE]; > ether_format_addr(mac_str, ETHER_ADDR_FMT_SIZE, addr); > PMD_INIT_LOG(DEBUG, " %s address %s\n", add ? "add" : "remove", mac_str); Yes, I think this is better, thanks.