Re: bridge callbacks in if_ed.c?

From: Gleb Smirnoff (glebius_at_freebsd.org)
Date: 09/05/04

  • Next message: Andre Oppermann: "Re: bridge callbacks in if_ed.c?"
    Date: Mon, 6 Sep 2004 01:38:23 +0400
    To: Luigi Rizzo <luigi@freebsd.org>
    
    

    On Sun, Sep 05, 2004 at 02:20:36PM -0700, Luigi Rizzo wrote:
    L> > I see that bridge callbacks are still living in if_ed.c
    L> > from FreeBSD 2.x times. See if_ed.c:2816. I think this is
    L> > not correct.
    L> >
    L> > Bridge code is called from ether_input(), which is
    L> > indirectly called from if_ed.c:2836.
    L> >
    L> > Any objections about attached patch?
    L>
    L> there are performance reasons to do this way -- grabbing
    L> the entire packet is expensive because it is done via programmed
    L> I/O, so the current code only grabs the header, does the
    L> filtering, and grabs the rest of the packet only if
    L> needed.

    Well, what percentage of packets is usually dropped by bridge in
    normal operation? Performance degradation applies only to them.

    L> Probably the current code runs bridge_in_ptr() twice, but I
    L> believe this is still cheaper than grabbing all packets
    L> entirely.
    L> I'd rather not apply the patch unless you can show that
    L> the current code leads to incorrect behaviour.

    The problem is with layer intermixing. ed(4) is a device
    driver, it must pass its frames to Ethernet stack
    without any hacks. By the way ed(4) is the only driver
    which does this.

    Actually I'm working on the problem decribed here

    http://lists.freebsd.org/mailman/htdig/freebsd-net/2004-May/003881.html

    and one of the approaches I'm considering is to push the
    block (lines 569-615) from if_ethersubr.c into bridge.c. This
    probably requires small changes to bridge_in()/bdg_forward()
    logic, so it's caller must take care. We have only two callers
    now - ether_input(), which is OK and if_ed, which looks like
    a hack.

    P.S. Sam said, that there are plans to convert bridge to use pfil-hooks.
    If this happens, the code in if_ed.c will be on the way again.

    -- 
    Totus tuus, Glebius.
    GLEBIUS-RIPN GLEB-RIPE
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
    

  • Next message: Andre Oppermann: "Re: bridge callbacks in if_ed.c?"

    Relevant Pages

    • Re: bridge callbacks in if_ed.c?
      ... L>> I see that bridge callbacks are still living in if_ed.c ... L> the entire packet is expensive because it is done via programmed ... without any hacks. ... so it's caller must take care. ...
      (freebsd-hackers)
    • Re[2]: [PATCH] ethernet-bridge: update skb->priority in case forwarded frame has VLAN-header
      ... bridge should update skb->prioriry for properly QoS ... PM> skb->priority to an arbitary value or derive it from vlan priority or IP ... BG> If this packet came in from an 802.1Q VLAN device, ...
      (Linux-Kernel)
    • Debugging bridge behavior
      ... I have a bridge between two ports where a packet comes into one port ... packets physically connected to eth1 on the VM host system. ... tcpdump: WARNING: eth1: no IPv4 address assigned ...
      (comp.os.linux.networking)
    • Re: bridge callbacks in if_ed.c?
      ... > Gleb Smirnoff wrote: ... > That depends on how many systems are behind the bridge. ... >> driver, it must pass its frames to Ethernet stack ... > packet is arrving double in the upper half? ...
      (freebsd-hackers)
    • Re: bridge callbacks in if_ed.c?
      ... > Gleb Smirnoff wrote: ... > That depends on how many systems are behind the bridge. ... >> driver, it must pass its frames to Ethernet stack ... > packet is arrving double in the upper half? ...
      (freebsd-net)