netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Philip Craig <philipc@snapgear.com>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] gre: transparent ethernet bridging
Date: Mon, 31 Jul 2006 22:08:22 -0700	[thread overview]
Message-ID: <20060731220822.444f04e4@localhost.localdomain> (raw)
In-Reply-To: <44CEAB31.5090501@snapgear.com>

On Tue, 01 Aug 2006 11:15:29 +1000
Philip Craig <philipc@snapgear.com> wrote:

> Stephen Hemminger wrote:
> > On Mon, 31 Jul 2006 20:06:41 +1000
> > Philip Craig <philipc@snapgear.com> wrote:
> > 
> >> This patch implements transparent ethernet bridging for gre tunnels.
> >> There are a few outstanding issues.
> > 
> > Why not use existing bridge code?
> 
> It does use the existing bridge code.  Perhaps the name is misleading.
> All it does is encapsulate the full ethernet header in a gre packet,
> rather than only layer 3.  That is, currently gre uses ARPHRD_IPGRE,
> but bridging requires ARPHRD_ETHER.
> 

I am not against making the bridge code smarter to handle other
encapsulation.

> >> Some routers set LLC_SAP_BSPAN in the gre protocol field, and then
> >> give the bpdu packet without any other ethernet/llc header. This patch
> >> currently tries to fake the ethernet/llc header before passing the
> >> packet up, but it is buggy (mac addresses are wrong at least). Maybe a
> >> better approach is to call directly into the bridging code. I didn't try
> >> that at first because it isn't modular, and may break other things that
> >> want to see the packet.
> > 
> > Existing bridge code already has spanning tree.
> 
> Yes, and I want to use that.  But this packet is a bit strange in
> that it does not have the ethernet header on it.   So what is the
> best way to pass it to existing code?  Either fake the ethernet
> header, or pass it directly?

Likewise if the bridge STP bpdu input code was smarter, it could
deal with it maybe?

> 
> >> +#if 0
> >>  	dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup);
> >> +#else
> >> +	dev = alloc_netdev(sizeof(*t), name, ipgre_ether_tunnel_setup);
> >> +#endif
> > 
> > "Do, or do not there is no try"
> 
> I am looking for comments as to whether adding a netlink interface
> to control this is appropriate.

If we make bridge code type aware, then the ipgre tunnel wouldn't have to change.

> >> +__be16 ipgre_type_trans(struct sk_buff *skb, int offset)
> >> +{
> >> +	u8     *h = skb->data;
> >> +	__be16 flags = *(__be16*)h;
> >> +	__be16 proto = *(__be16*)(h + 2);
> >> +
> >> +	/* WCCP version 1 and 2 protocol decoding.
> >> +	 * - Change protocol to IP
> >> +	 * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
> >> +	 */
> >> +	if (flags == 0 &&
> >> +	    proto == __constant_htons(ETH_P_WCCP)) {
> >> +		proto = __constant_htons(ETH_P_IP);
> >> +		if ((*(h + offset) & 0xF0) != 0x40)
> >> +			offset += 4;
> >> +	}
> > 
> > Don't use __constant_htons() except in initializers and switch cases
> > (where gcc is too stupid to optimize the macro).
> > 
> 
> This is a problem in the existing code, which I am simply moving
> around.  Should I fix it at the same time?

Usually if a diff touches some code, I try to make it use current practice.

  reply	other threads:[~2006-08-01  5:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-31 10:06 [RFC] gre: transparent ethernet bridging Philip Craig
2006-07-31 16:14 ` Stephen Hemminger
2006-08-01  1:15   ` Philip Craig
2006-08-01  5:08     ` Stephen Hemminger [this message]
2006-08-01  9:29       ` Philip Craig
2006-08-02  6:17         ` Philip Craig
2006-08-02 17:23           ` Stephen Hemminger
2006-08-03  1:08             ` Philip Craig
2006-08-02  7:42       ` Lennert Buytenhek
2006-08-03  1:33         ` Philip Craig
2006-08-03  7:33           ` Lennert Buytenhek
2006-08-03  9:14             ` Philip Craig
2006-08-03 19:40               ` Lennert Buytenhek
2006-08-04  1:00                 ` Philip Craig
2006-08-04  8:02                   ` Lennert Buytenhek
2006-08-07  1:55                     ` Philip Craig
2006-08-10 13:09                       ` Lennert Buytenhek

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=20060731220822.444f04e4@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=netdev@vger.kernel.org \
    --cc=philipc@snapgear.com \
    /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).