From: Simon Wunderlich <sw@simonwunderlich.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 6/6] batman-adv: Send multicast packets to nodes with a WANT_ALL flag
Date: Tue, 4 Feb 2014 17:46:02 +0100 [thread overview]
Message-ID: <201402041746.03043.sw@simonwunderlich.de> (raw)
In-Reply-To: <20140204020018.GB28274@Linus-Debian>
> > Maybe I am missing the whole point of WANT_ALL but why do we maintain a
> > list of WANT_ALL nodes to only send the packet to the first valid entry
> > in the list?
>
> Hm, the thing is, there can be multiple nodes with that flag. But
> most of the time we only end up in this function when there's just
> a single node in this list. (when there's more than one, we'd
> usually end up in the broadcast instead of unicasting path)
As far as I see, send_skb_via_mcast() is only called if forw_mode returned
BATADV_FORW_SINGLE, that is there is only one recipient in the list, and there
is no "regular" listener in TT.
(I don't see any good reason for calling that "most of the time" and
"usually")
>
> We could remove the list entirely but then we'd have to loop over
> all orig_nodes and check their mcast_flags for every packet -
> which is too costly on the fast path.
>
> We could replace these two lists by two variables holding a single
> originator address or orig_node each. But then we'd still have to
> loop over all originators when the numbers of nodes with such a
> flag decreases to one to find this one node to update the variable
> with.
>
>
> But yes, this pointer pointer to a list head is not really nice
> either... what do you think about returning a pointer pointer to
> an orig_node with batadv_mcast_want_all_count() already, instead?
> That way we'd spare checking the IP address family twice, too. Or
> the list-to-orig_node-variable substitution approach?
I think that would be good to do (returning an orig_node, that is). And also
please return an orig_node if a TT match was found for the single case.
With this we would unify the multicast sending in batadv_interface_tx() as
well which would make it more readable. Right now mcast packets are sent via
batadv_send_skb_via_mcast() if the want_all_list is present or via
batadv_send_skb_via_tt() if want_all_list is not present, which isn't exactly
easy to understand. :)
something like
forw_mode = batadv_mcast_forw_mode(bat_priv, skb,
&mcast_single_orig);
and then in the unicast branch below
} else if (mcast_single_orig) {
ret = batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0,
mcast_single_orig, vid);
}
should do the trick, no?
Thanks,
Simon
prev parent reply other threads:[~2014-02-04 16:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 9:48 [B.A.T.M.A.N.] Basic Multicast Optimizations Linus Lüssing
2014-01-27 9:48 ` [B.A.T.M.A.N.] [PATCH 1/6] batman-adv: Multicast Listener Announcements via Translation Table Linus Lüssing
2014-01-27 9:48 ` [B.A.T.M.A.N.] [PATCH 2/6] batman-adv: introduce capability initialization bitfield Linus Lüssing
2014-01-27 9:48 ` [B.A.T.M.A.N.] [PATCH 3/6] batman-adv: Announce new capability via multicast TVLV Linus Lüssing
2014-01-27 9:48 ` [B.A.T.M.A.N.] [PATCH 4/6] batman-adv: Modified forwarding behaviour for multicast packets Linus Lüssing
2014-01-27 9:48 ` [B.A.T.M.A.N.] [PATCH 5/6] batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support Linus Lüssing
2014-01-27 9:48 ` [B.A.T.M.A.N.] [PATCH 6/6] batman-adv: Send multicast packets to nodes with a WANT_ALL flag Linus Lüssing
2014-01-29 6:53 ` Marek Lindner
2014-02-04 2:00 ` Linus Lüssing
2014-02-04 16:46 ` Simon Wunderlich [this message]
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=201402041746.03043.sw@simonwunderlich.de \
--to=sw@simonwunderlich.de \
--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