netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: Joe Perches <joe@perches.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, gospo@redhat.com,
	sassmann@redhat.com,
	Kavindya Deegala <kavindya.s.deegala@intel.com>
Subject: Re: [net-next 01/13] i40e: use ether_addr_equal_64bits
Date: Wed, 05 Mar 2014 20:40:45 -0800	[thread overview]
Message-ID: <1394080845.2214.1.camel@jtkirshe-mobl> (raw)
In-Reply-To: <1394080559.12070.50.camel@joe-AO722>

[-- Attachment #1: Type: text/plain, Size: 3825 bytes --]

On Wed, 2014-03-05 at 20:35 -0800, Joe Perches wrote:
> On Wed, 2014-03-05 at 20:21 -0800, Jeff Kirsher wrote:
> > From: Joe Perches <joe@perches.com>
> > 
> > All ether_addr_equal tests in i40e can use the
> > slightly more efficient ether_addr_equal_64bits.
> > 
> > All addresses passed to the various functions that
> > use ether_addr_equal are using structs that have 2
> > or more bytes of additional data after the mac addr
> > being tested.
> 
> Hey Jeff.  Hi Kavindya.
> 
> I don't know if these are really that important to convert.
> 
> I did these when I looked for an example to convert and
> I thought "hey, 40 gig's fast, I should start there..."
> 
> Recently, I've come to think that ether_addr_equal should
> be used almost exclusively and ether_addr_equal_64bits
> should only be used on performance sensitive or fast-path
> code.
> 
> Are any of these on anything like a fast path or are
> performance sensitive?

Not sure if Kavindya has before and after performance numbers, hopefully
she does and can provide the numbers tomorrow.

> 
> If not, maybe this patch should get tossed.
> 
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> []
> > @@ -997,7 +997,7 @@ static struct i40e_mac_filter *i40e_find_filter(struct i40e_vsi *vsi,
> >  		return NULL;
> >  
> >  	list_for_each_entry(f, &vsi->mac_filter_list, list) {
> > -		if ((ether_addr_equal(macaddr, f->macaddr)) &&
> > +		if (ether_addr_equal_64bits(macaddr, f->macaddr) &&
> >  		    (vlan == f->vlan)    &&
> >  		    (!is_vf || f->is_vf) &&
> >  		    (!is_netdev || f->is_netdev))
> > @@ -1025,7 +1025,7 @@ struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
> >  		return NULL;
> >  
> >  	list_for_each_entry(f, &vsi->mac_filter_list, list) {
> > -		if ((ether_addr_equal(macaddr, f->macaddr)) &&
> > +		if (ether_addr_equal_64bits(macaddr, f->macaddr) &&
> >  		    (!is_vf || f->is_vf) &&
> >  		    (!is_netdev || f->is_netdev))
> >  			return f;
> 
> Well, maybe these 2.
> 
> > @@ -1214,7 +1214,7 @@ static int i40e_set_mac(struct net_device *netdev, void *p)
> >  
> >  	netdev_info(netdev, "set mac address=%pM\n", addr->sa_data);
> >  
> > -	if (ether_addr_equal(netdev->dev_addr, addr->sa_data))
> > +	if (ether_addr_equal_64bits(netdev->dev_addr, addr->sa_data))
> >  		return 0;
> >  
> >  	if (test_bit(__I40E_DOWN, &vsi->back->state) ||
> 
> probably not.
> 
> > @@ -1417,21 +1417,24 @@ static void i40e_set_rx_mode(struct net_device *netdev)
> >  
> >  		if (is_multicast_ether_addr(f->macaddr)) {
> >  			netdev_for_each_mc_addr(mca, netdev) {
> > -				if (ether_addr_equal(mca->addr, f->macaddr)) {
> > +				if (ether_addr_equal_64bits(mca->addr,
> > +							    f->macaddr)) {
> >  					found = true;
> >  					break;
> >  				}
> >  			}
> >  		} else {
> >  			netdev_for_each_uc_addr(uca, netdev) {
> > -				if (ether_addr_equal(uca->addr, f->macaddr)) {
> > +				if (ether_addr_equal_64bits(uca->addr,
> > +							    f->macaddr)) {
> >  					found = true;
> >  					break;
> >  				}
> >  			}
> >  
> >  			for_each_dev_addr(netdev, ha) {
> > -				if (ether_addr_equal(ha->addr, f->macaddr)) {
> > +				if (ether_addr_equal_64bits(ha->addr,
> > +							    f->macaddr)) {
> >  					found = true;
> >  					break;
> >  				}
> 
> probably not.
> 
> > @@ -1905,7 +1908,8 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
> >  	list_for_each_entry(f, &vsi->mac_filter_list, list) {
> >  		if (is_netdev) {
> >  			if (f->vlan &&
> > -			    ether_addr_equal(netdev->dev_addr, f->macaddr))
> > +			    ether_addr_equal_64bits(netdev->dev_addr,
> > +						    f->macaddr))
> >  				filter_count++;
> >  		}
> 
> Dunno.
> 


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-03-06  4:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  4:21 [net-next 00/13][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-06  4:21 ` [net-next 01/13] i40e: use ether_addr_equal_64bits Jeff Kirsher
2014-03-06  4:35   ` Joe Perches
2014-03-06  4:40     ` Jeff Kirsher [this message]
     [not found]       ` <CAP-MU4Nf=T-BZDpHnBzq8xcPf7CG3v2oMSD3fitAKXp=fP4XPw@mail.gmail.com>
2014-03-06 19:33         ` Jeff Kirsher
2014-03-06 20:45           ` David Miller
2014-03-06  4:21 ` [net-next 02/13] i40evf: Enable the ndo_set_features netdev op Jeff Kirsher
2014-03-06  4:21 ` [net-next 03/13] i40e: Flow Director sideband accounting Jeff Kirsher
2014-03-09 18:35   ` Ben Hutchings
2014-03-06  4:21 ` [net-next 04/13] i40e: Prevent overflow due to kzalloc Jeff Kirsher
2014-03-06  4:21 ` [net-next 05/13] i40e/i40evf: i40e implementation for skb_set_hash Jeff Kirsher
2014-03-06  4:21 ` [net-next 06/13] i40e: clean up comment style Jeff Kirsher
2014-03-06  4:21 ` [net-next 07/13] i40e: Remove a FW workaround for Number of MSIX vectors Jeff Kirsher
2014-03-06  4:21 ` [net-next 08/13] i40e: count timeout events Jeff Kirsher
2014-03-06  4:21 ` [net-next 09/13] i40e: Remove a redundant filter addition Jeff Kirsher
2014-03-06  4:21 ` [net-next 10/13] i40e: Fix static checker warning Jeff Kirsher
2014-03-06  4:21 ` [net-next 11/13] i40e: fix nvm version and remove firmware report Jeff Kirsher
2014-03-06  4:21 ` [net-next 12/13] i40e/i40evf: carefully fill tx ring Jeff Kirsher
2014-03-06  4:21 ` [net-next 13/13] i40e/i40evf: Bump pf&vf build versions Jeff Kirsher

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=1394080845.2214.1.camel@jtkirshe-mobl \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=joe@perches.com \
    --cc=kavindya.s.deegala@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.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).