From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alln-iport-5.cisco.com (alln-iport-5.cisco.com [173.37.142.92]) by dpdk.org (Postfix) with ESMTP id 217D11B9E7 for ; Sat, 12 Jan 2019 05:50:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1596; q=dns/txt; s=iport; t=1547268604; x=1548478204; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=i6ZMuC0PfIJVpqRstp18FYsTmBsKOFRxwWv9PbxztQA=; b=QTh2cOYNPtUPUztlm7F/Q+xPV8yVmTVPlQGpVheANIab6noDN1ZU2/tX 1ZWt2mxW7sPVKgT0SeeiqWlVamCb76TUHXcA+EY7+1rcvE5eTsuZSYcYV jrGuMndDW9VV1qmBPG7IFznsww8ez7DagTq9S/UIGr5q1zxR0ZQOllTVV Y=; X-IronPort-AV: E=Sophos;i="5.56,468,1539648000"; d="scan'208";a="224316516" Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by alln-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jan 2019 04:50:03 +0000 Received: from HYONKIM-7R0DR.cisco.com ([10.24.34.155]) by rcdn-core-10.cisco.com (8.15.2/8.15.2) with ESMTPS id x0C4nwDX030708 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 12 Jan 2019 04:50:00 GMT Date: Sat, 12 Jan 2019 13:49:57 +0900 From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley Message-ID: <20190112044956.GA23480@HYONKIM-7R0DR.cisco.com> References: <20181210182857.13043-1-hyonkim@cisco.com> <20181210182857.13043-4-hyonkim@cisco.com> <25e615b7-35ba-8019-62fa-64590ab69d19@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25e615b7-35ba-8019-62fa-64590ab69d19@intel.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Outbound-SMTP-Client: 10.24.34.155, [10.24.34.155] X-Outbound-Node: rcdn-core-10.cisco.com Subject: Re: [dpdk-dev] [PATCH 3/4] net/enic: support multicast filtering 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: Sat, 12 Jan 2019 04:50:04 -0000 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); Thanks. -Hyong