netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Garver <e@erig.me>
To: Hangbin Liu <haliu@redhat.com>
Cc: Hangbin Liu <liuhangbin@gmail.com>,
	netdev@vger.kernel.org, Pravin B Shelar <pshelar@ovn.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jiri Benc <jbenc@redhat.com>
Subject: Re: [PATCH net] geneve: show remote address and checksum info even after link down
Date: Tue, 14 Nov 2017 10:48:17 -0500	[thread overview]
Message-ID: <20171114154817.GO25853@dev-rhel7> (raw)
In-Reply-To: <20171114023941.GO22043@leo.usersys.redhat.com>

On Tue, Nov 14, 2017 at 10:39:41AM +0800, Hangbin Liu wrote:
> Hi Eric,
> 
> Thanks for the comments.
> 
> On Mon, Nov 13, 2017 at 03:27:25PM -0500, Eric Garver wrote:
> > > Fixes: 11387fe4a98 ("geneve: fix fill_info when using collect_metadata")
> > > Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> > > ---
> > >  drivers/net/geneve.c | 28 +++++++++++-----------------
> > >  1 file changed, 11 insertions(+), 17 deletions(-)
> > > 
> > > diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
> > > index ed51018..b010db7 100644
> > > --- a/drivers/net/geneve.c
> > > +++ b/drivers/net/geneve.c
> > > @@ -1511,32 +1511,18 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
> > >  	if (nla_put_u32(skb, IFLA_GENEVE_ID, vni))
> > >  		goto nla_put_failure;
> > >  
> > > -	if (rtnl_dereference(geneve->sock4)) {
> > > +	if (ip_tunnel_info_af(info) == AF_INET) {
> > >  		if (nla_put_in_addr(skb, IFLA_GENEVE_REMOTE,
> > >  				    info->key.u.ipv4.dst))
> > >  			goto nla_put_failure;
> > >  
> > 
> > We can avoid passing up *_REMOTE{,6} for COLLECT_METADATA. They're
> > mutually exclusive.
> 
> Do you mean something like
> 
> +       bool metadata = geneve->collect_md;
> -       if (rtnl_dereference(geneve->sock4)) {
> +       if (!metadata && ip_tunnel_info_af(info) == AF_INET) {

Yes.

> > 
> > > -		if (nla_put_u8(skb, IFLA_GENEVE_UDP_CSUM,
> > > -			       !!(info->key.tun_flags & TUNNEL_CSUM)))
> > > -			goto nla_put_failure;
> > > -
> > > -	}
> > > -
> > >  #if IS_ENABLED(CONFIG_IPV6)
> > > -	if (rtnl_dereference(geneve->sock6)) {
> > > +	} else {
> 
> and
> 
> -       if (rtnl_dereference(geneve->sock6)) {
> +       } else if (!metadata) {
> 
> ?

Yes.

  reply	other threads:[~2017-11-14 15:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13  9:03 [PATCH net] geneve: show remote address and checksum info even after link down Hangbin Liu
2017-11-13 20:27 ` Eric Garver
2017-11-14  2:39   ` Hangbin Liu
2017-11-14 15:48     ` Eric Garver [this message]
2017-11-15  1:43 ` [PATCHv2 net] geneve: fix fill_info when " Hangbin Liu
2017-11-15 10:48   ` 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=20171114154817.GO25853@dev-rhel7 \
    --to=e@erig.me \
    --cc=davem@davemloft.net \
    --cc=haliu@redhat.com \
    --cc=jbenc@redhat.com \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.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).