netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, ja@ssi.bg
Subject: Re: [PATCH v2 net-next] net: better IFF_XMIT_DST_RELEASE support
Date: Mon, 06 Oct 2014 17:50:15 -0400 (EDT)	[thread overview]
Message-ID: <20141006.175015.2075737681876306575.davem@davemloft.net> (raw)
In-Reply-To: <1412559515.11091.46.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 05 Oct 2014 18:38:35 -0700

> @@ -1001,7 +1001,8 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
>  
>  static void bond_compute_features(struct bonding *bond)
>  {
> -	unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
> +	unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
> +					IFF_XMIT_DST_RELEASE_PERM;
>  	netdev_features_t vlan_features = BOND_VLAN_FEATURES;
>  	netdev_features_t enc_features  = BOND_ENC_FEATURES;
>  	struct net_device *bond_dev = bond->dev;
> @@ -1037,8 +1038,10 @@ done:
>  	bond_dev->gso_max_segs = gso_max_segs;
>  	netif_set_gso_max_size(bond_dev, gso_max_size);
>  
> -	flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
> -	bond_dev->priv_flags = flags | dst_release_flag;
> +	bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
> +	if ((bond_dev->priv_flags & IFF_XMIT_DST_RELEASE_PERM) &&
> +	    dst_release_flag == (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
> +		bond_dev->priv_flags |= IFF_XMIT_DST_RELEASE;

I think I might be missing something, but in all of these places where
you add this logic, it looks to me like:

	dst_release_flag = CONSTANT;
	...
	if (... &&
	    dst_release_flags == CONSTANT)

This 'dst_release_flag' variable never changes, so why bother with the
test at all?

Maybe I'm just being dense today...

  reply	other threads:[~2014-10-06 21:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06  1:38 [PATCH v2 net-next] net: better IFF_XMIT_DST_RELEASE support Eric Dumazet
2014-10-06 21:50 ` David Miller [this message]
2014-10-06 22:05   ` Eric Dumazet
2014-10-07 17:22     ` David Miller

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=20141006.175015.2075737681876306575.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=ja@ssi.bg \
    --cc=netdev@vger.kernel.org \
    /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).