public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Announce new capability via multicast TVLV
Date: Thu, 16 May 2013 21:41:20 +0200	[thread overview]
Message-ID: <20130516194120.GI3350@ritirata.org> (raw)
In-Reply-To: <20130516181945.GC22374@Linus-Debian>

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

On Thu, May 16, 2013 at 08:19:45PM +0200, Linus Lüssing wrote:
> > 
> > > +
> > > +	if (!(mcast_flags & BATADV_MCAST_LISTENER_ANNOUNCEMENT) &&
> > > +	    orig->mcast_flags & BATADV_MCAST_LISTENER_ANNOUNCEMENT) {
> > > +		atomic_inc(&bat_priv->mcast_num_non_aware);
> > > +	} else if (mcast_flags & BATADV_MCAST_LISTENER_ANNOUNCEMENT &&
> > > +		   !(orig->mcast_flags & BATADV_MCAST_LISTENER_ANNOUNCEMENT)) {
> > > +		atomic_dec(&bat_priv->mcast_num_non_aware);
> > > +	}
> > > +
> > > +	orig->mcast_flags = mcast_flags;
> > > +}
> > 
> > > diff --git a/originator.c b/originator.c
> > > index 5d53d2f..acc0c2d 100644
> > > --- a/originator.c
> > > +++ b/originator.c
> > > @@ -257,6 +257,9 @@ struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv,
> > >  	reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS);
> > >  	orig_node->bcast_seqno_reset = reset_time;
> > >  	orig_node->batman_seqno_reset = reset_time;
> > > +#ifdef CONFIG_BATMAN_ADV_MCAST_OPTIMIZATIONS
> > > +	orig_node->mcast_flags = BATADV_MCAST_LISTENER_ANNOUNCEMENT;
> > > +#endif
> > 
> > why do you start assuming that an originator has the optimisation enabled? would
> > it be better to wait for the first mcast tvlv from it to claim this?
> 
> Because it is easier code-wise. I had it the other way round first
> and issuing an atomic_inc(&bat_priv->mcast_num_non_ware) in
> batadv_get_orig_node(), but then I ended up counting up too many
> times because I was increasing that counter for secondary
> interface originators, too while not decreasing it again because
> no TVLV handler will be called for these. And within
> batadv_get_orig_node() I don't see an easy way to determine
> whether I was called for a primary or secondary interface
> originator.
> 

mh..I don't really understand this (maybe because I don't have a deep knowledge
of this code). My idea was to start with:

orig_node->mcast_flags = BATADV_NO_FLAGS;

and to set

orig_node->mcast_flags = BATADV_MCAST_LISTENER_ANNOUNCEMENT;

only in the received TVLV parsing function (if any TVLV has been received).
Is this inconsistent with what you have in the code?


Cheers,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-05-16 19:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-11 17:23 [B.A.T.M.A.N.] Basic Multicast Optimizations Linus Lüssing
2013-05-11 17:23 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: Multicast Listener Announcements via Translation Table Linus Lüssing
2013-05-11 22:55   ` Antonio Quartulli
2013-05-16 18:16     ` Linus Lüssing
2013-05-16 19:36       ` Antonio Quartulli
2013-05-11 17:23 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Announce new capability via multicast TVLV Linus Lüssing
2013-05-11 23:11   ` Antonio Quartulli
2013-05-16 18:19     ` Linus Lüssing
2013-05-16 19:41       ` Antonio Quartulli [this message]
2013-05-16 22:34         ` Linus Lüssing
2013-05-11 17:23 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: Modified forwarding behaviour for multicast packets Linus Lüssing
2013-05-11 23:29   ` Antonio Quartulli
2013-05-16 18:22     ` Linus Lüssing
2013-05-16 19:43       ` Antonio Quartulli
2013-05-16 11:51 ` [B.A.T.M.A.N.] Basic Multicast Optimizations Simon Wunderlich
2013-05-16 17:42   ` Linus Lüssing
2013-05-16 18:31     ` Simon Wunderlich
2013-05-17  1:38       ` Linus Lüssing
2013-05-17 10:24         ` Simon Wunderlich
  -- strict thread matches above, loose matches on Subject: below --
2013-06-10  6:28 Linus Lüssing
2013-06-10  6:28 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Announce new capability via multicast TVLV Linus Lüssing

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=20130516194120.GI3350@ritirata.org \
    --to=ordex@autistici.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.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