public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech•com>
To: NetDev <netdev@vger•kernel.org>
Subject: Adding multiple multicast routing tables.
Date: Mon, 26 May 2008 13:23:18 -0700	[thread overview]
Message-ID: <483B1C36.50603@candelatech.com> (raw)

I am working on adding support for multiple multicast routing tables, and
would welcome some feedback if anyone has comments.

It looks like there are several globals currently.  I would plan to wrap 
those
in a 'mroute_table_entry struct and have the global be a hash of these
routing tables.

Inside this table, I'd add a hash of vifs (no more max limit for vifs),
the mroute_socket for this table, and 32-bit vif_index (routing-table id).

In the ip_mroute_setsockopt, add a 32-bit table-id to all of the
optnames.  This will increase the optlen by 4 for all options,
so we can know it's the new API.  For MRT_INIT, could pass
in something like this, for instance:

struct foo {
  uint32 mrt_table_idx;
  uint32 mrt_version;
}

Or, use entirely new MRT_* sockopts so there is no chance
of confusion.  I plan to update xorp to support this API, so I can be 
flexible on
the API.

User space will need a way to detect the new API.  I could probably
just try to INIT with a larger optlen.  2.6.25 (and probably many previous kernels) 

appears to error nicely if optlen != sizeof(int), so I can trigger on that.

The mcast table ID would be associated directly with the 'regular' routing
table index, so if the mcast is table-id 4444, then any routes 
associated with it
should be added to the unicast routing table 4444.  Or, it could be mapped,
but I am not sure there is much benefit for that added complexity.

getsockopt and the ioctl would need similar changes to the setsockopt.

ip_mr_input looks interesting...not sure how to decide which mroute_socket
it uses...maybe it doesn't matter?

And, for things like pim_rcv*, might need some sort of table lookup to
map a skb->dev into a mroute table so that it can handle the reg_vif_num
thing.  To make this really fast, a new member could be added to struct netdev.

A netdev may belong to no more that one mcast routing table.  If someone 
wants
to share NICS, they can use something like mac-vlans to multiplex the 
physical
device.

Suggestions are welcome.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech•com> 
Candela Technologies Inc  http://www.candelatech.com



                 reply	other threads:[~2008-05-26 20:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=483B1C36.50603@candelatech.com \
    --to=greearb@candelatech$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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