DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hyong Youb Kim <hyonkim@cisco.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, John Daley <johndale@cisco.com>
Subject: Re: [dpdk-dev] [PATCH 3/4] net/enic: support multicast filtering
Date: Sat, 12 Jan 2019 13:49:57 +0900	[thread overview]
Message-ID: <20190112044956.GA23480@HYONKIM-7R0DR.cisco.com> (raw)
In-Reply-To: <25e615b7-35ba-8019-62fa-64590ab69d19@intel.com>

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 <hyonkim@cisco.com>
> > Reviewed-by: John Daley <johndale@cisco.com>
> 
> <...>
> 
> > +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

  reply	other threads:[~2019-01-12  4:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 18:28 [dpdk-dev] [PATCH 0/4] net/enic: minor updates Hyong Youb Kim
2018-12-10 18:28 ` [dpdk-dev] [PATCH 1/4] net/enic: release port upon close Hyong Youb Kim
2018-12-10 18:28 ` [dpdk-dev] [PATCH 2/4] net/enic: add handler to return firmware version string Hyong Youb Kim
2018-12-10 18:28 ` [dpdk-dev] [PATCH 3/4] net/enic: support multicast filtering Hyong Youb Kim
2019-01-11 15:46   ` Ferruh Yigit
2019-01-12  4:49     ` Hyong Youb Kim [this message]
2019-01-14 10:29       ` Ferruh Yigit
2018-12-10 18:28 ` [dpdk-dev] [PATCH 4/4] doc: update release notes for enic Hyong Youb Kim
2018-12-11  2:44   ` Varghese, Vipin
2018-12-11 16:08     ` Hyong Youb Kim
2018-12-11 16:31       ` Varghese, Vipin
2018-12-11 16:40         ` Hyong Youb Kim
2018-12-11 16:49           ` Varghese, Vipin
2018-12-11 17:25             ` Hyong Youb Kim
2018-12-12  2:23               ` Varghese, Vipin
2018-12-12 11:56 ` [dpdk-dev] [PATCH 0/4] net/enic: minor updates Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190112044956.GA23480@HYONKIM-7R0DR.cisco.com \
    --to=hyonkim@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=johndale@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).