RE: SOVLED: Problems with CARP, VLANs and em driver

eivind_at_stabbursmoen.no
Date: 04/18/05

  • Next message: Kris Kennaway: ""panic: trap: fast data access mmu miss" in m_copym"
    To: <eivind@stabbursmoen.no>, <net@freebsd.org>
    Date: Mon, 18 Apr 2005 22:47:06 +0200
    
    

    The vlan(4) device is not yet officially supported for carp(4). It works for
    NICs which talks to mii, but cards such as em(4) could get problems.

    Thanks to Max Laier, Gleb Smirnoff and Yar Tikhiy which supplied me the
    following patch. It solved my problem with CARP, VLANs and the em(4)
    driver.. thanks guys!

    Index: if_em.c
    ===================================================================
    RCS file: /home/ncvs/freebsd/src/sys/dev/em/if_em.c,v
    retrieving revision 1.1.1.2
    retrieving revision 1.3
    diff -u -r1.1.1.2 -r1.3
    --- if_em.c 20 Mar 2005 13:23:44 -0000 1.1.1.2
    +++ if_em.c 21 Mar 2005 12:23:02 -0000 1.3
    @@ -1666,9 +1666,15 @@
             return;
     }
     
    +#ifdef DEV_CARP /* XXX */
    +extern void (*vlan_link_state_p)(struct ifnet *, int); #endif
    +
     static void
     em_print_link_status(struct adapter * adapter) {
    + struct ifnet *ifp = &adapter->interface_data.ac_if;
    +
             if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU) {
                     if (adapter->link_active == 0) {
                             em_get_speed_and_duplex(&adapter->hw,
    @@ -1681,6 +1687,13 @@
                                     "Full Duplex" : "Half Duplex"));
                             adapter->link_active = 1;
                             adapter->smartspeed = 0;
    + ifp->if_link_state = LINK_STATE_UP;
    +#ifdef DEV_CARP
    + if (ifp->if_nvlans != 0)
    + (*vlan_link_state_p)(ifp, NOTE_LINKUP); /*
    XXX */
    + if (ifp->if_carp)
    + carp_carpdev_state(ifp->if_carp);
    +#endif
                     }
             } else {
                     if (adapter->link_active == 1) {
    @@ -1688,6 +1701,13 @@
                             adapter->link_duplex = 0;
                             printf("em%d: Link is Down\n", adapter->unit);
                             adapter->link_active = 0;
    + ifp->if_link_state = LINK_STATE_DOWN; #ifdef
    DEV_CARP
    + if (ifp->if_nvlans != 0)
    + (*vlan_link_state_p)(ifp, NOTE_LINKDOWN); /*
    XXX */
    + if (ifp->if_carp)
    + carp_carpdev_state(ifp->if_carp);
    +#endif
                     }
             }
     

    Index: if_vlan.c
    ===================================================================
    RCS file: /home/ncvs/freebsd/src/sys/net/if_vlan.c,v
    retrieving revision 1.1.1.2
    retrieving revision 1.2
    diff -u -r1.1.1.2 -r1.2
    --- if_vlan.c 20 Mar 2005 13:25:00 -0000 1.1.1.2
    +++ if_vlan.c 21 Mar 2005 12:23:06 -0000 1.2
    @@ -41,6 +41,7 @@
      * and ask it to send them.
      */
     
    +#include "opt_carp.h"
     #include "opt_inet.h"
     
     #include <sys/param.h>
    @@ -67,6 +68,11 @@
     #ifdef INET
     #include <netinet/in.h>
     #include <netinet/if_ether.h>
    +
    +#ifdef DEV_CARP
    +#include <netinet/in_var.h>
    +#include <netinet/ip_carp.h>
    +#endif
     #endif
     
     #define VLANNAME "vlan"
    @@ -822,6 +828,10 @@
                             ifv->ifv_if.if_link_state =
    ifv->ifv_p->if_link_state;
                             rt_ifmsg(&(ifv->ifv_if));
                             KNOTE_UNLOCKED(&ifp->if_klist, link);
    +#ifdef DEV_CARP
    + if (ifv->ifv_if.if_carp)
    + carp_carpdev_state(ifv->ifv_if.if_carp);
    +#endif
                     }
             }
             VLAN_UNLOCK();

    -----Original Message-----
    From: owner-freebsd-net@freebsd.org [mailto:owner-freebsd-net@freebsd.org]
    On Behalf Of Eivind Hestnes
    Sent: Sunday, April 17, 2005 4:02 PM
    To: net@freebsd.org
    Subject: Problems with CARP, VLANs and em driver

    Hi,

    I recently configured two FreeBSD 5.3 (with XL 3c905C NIC) boxes to act as
    one logic router (preemption) between multiple VLANs. The router
    has now been in production for four weeks (under heavy load, too), and I
    have not run into any problems what-so-ever. Failover is almost
    transparent, and the robustness is awesome. All in all, i'm very happy
    with CARP.

    But to provide more bandwidth to our users, I bought a Intel Pro 1000 MT
    (PWLA8490MT) to replace the 3Com 905c card in the master. With some
    hacking, I managed to get the Intel card to talk with the VLANs (had to
    disable VLAN hardware tagging, as this didn't work with promiscuous mode).

    The problem however, is that the CARP interfaces on the master does not
    change mode from INIT to MASTER with the Intel card installed. In other
    words; the master do not replace the slave.

    I have tried the 2.0.5 em driver from Intel (instead of the 1.7.35), but
    with no success. Is there some problems with the em driver and CARP,
    or must the master and slave have identical NICs?

    Regards,
    Eivind Hestnes

    _______________________________________________
    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"

    _______________________________________________
    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: Kris Kennaway: ""panic: trap: fast data access mmu miss" in m_copym"

    Relevant Pages

    • [PATCH 1/2] vga: implements VGA arbitration on Linux
      ... * Implements the VGA arbitration. ... * to go back to the system default card ... bit mask of resources to acquire and lock ...
      (Linux-Kernel)
    • Re: Questions about sis7012+snd_intel8x0 sound card problem
      ... > config my sound card, ... surround volume control and the master volume control ... amixer set Master 50 should also set master ... One caveat -- I'm not sure if the settings are ...
      (Debian-User)
    • Re: LoB Preview - So what are the next 29 cards to appear?
      ... Fabio Ciccone wrote: ... so I guess it's an Abombwe card ... Master, requiring Osebo. ... The inferior discipline does not seem to be ...
      (rec.games.trading-cards.jyhad)
    • Re: Madness Network + Rotschreck is too good!
      ... master is not beyond imagination, likewise a vote card). ... you're creating the card and the big worry is Rotschreck ... So, without the Guruhi kholo, it's a crap Parthenon. ...
      (rec.games.trading-cards.jyhad)
    • Re: USB file transfer to Cameras
      ... I have now have a new Vista PC on which I have installed Camedia ... Master, but I find that the file transfer function no longer works. ... have a Sweex card reader which will read the Olympus 128MB XD card. ... is very slow to display the little icons for each picture. ...
      (uk.comp.homebuilt)