From owner-freebsd-net@FreeBSD.ORG Mon Mar 6 18:47:45 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5A3F16A420 for ; Mon, 6 Mar 2006 18:47:44 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2B6043D49 for ; Mon, 6 Mar 2006 18:47:42 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.4/8.13.3) with ESMTP id k26IlZBZ059407; Mon, 6 Mar 2006 21:47:35 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.4/8.13.3/Submit) id k26IlVut059404; Mon, 6 Mar 2006 21:47:31 +0300 (MSK) (envelope-from yar) Date: Mon, 6 Mar 2006 21:47:31 +0300 From: Yar Tikhiy To: Christopher McGee Message-ID: <20060306184731.GD53752@comp.chem.msu.su> References: <440876F1.6050804@xecu.net> <20060304211526.GD3304@comp.chem.msu.su> <440C6A5C.2030003@xecu.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <440C6A5C.2030003@xecu.net> User-Agent: Mutt/1.5.9i Cc: freebsd-net@freebsd.org Subject: Re: Carp on vlan with em driver X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2006 18:47:45 -0000 On Mon, Mar 06, 2006 at 11:59:08AM -0500, Christopher McGee wrote: > Yar Tikhiy wrote: > > >On Fri, Mar 03, 2006 at 12:03:45PM -0500, Christopher McGee wrote: > > > > > >>Carp, vlans, and em is still not supported in 5.4 release, but I have > >>read about a patch that works. Can anyone point me in the right > >>direction. > >> > >> > > > >http://docs.freebsd.org/cgi/getmsg.cgi?fetch=25292+0+/usr/local/www/db/text/2005/freebsd-net/20050424.freebsd-net+raw > > > > > > > I have run this patch and when it asks for the file to be patched, I > specify /usr/src/sys/dev/em/if_em.c and I get the following output: > > File to patch: sys/dev/em/if_em.c > Patching file sys/dev/em/if_em.c using Plan A... > patch: **** malformed patch at line 23: @@ -1681,6 +1687,13 @@ > > Am I doing something wrong? The patch in the posting seems just broken by some mail software or whatever. Here's the diff from my local CVS I used to use in RELENG_5 almost a year ago. I have no idea if it will work for you. Be prepared to apply it by hand, should it fail to apply via patch. It's rather small though. -- Yar Index: if_em.c =================================================================== RCS file: /home/ncvs/freebsd/src/sys/dev/em/if_em.c,v retrieving revision 1.1.1.3 retrieving revision 1.4 diff -u -r1.1.1.3 -r1.4 --- if_em.c 19 May 2005 14:45:48 -0000 1.1.1.3 +++ if_em.c 19 May 2005 15:39:06 -0000 1.4 @@ -1666,6 +1666,10 @@ return; } +#ifdef DEV_CARP /* XXX */ +extern void (*vlan_link_state_p)(struct ifnet *, int); +#endif + static void em_print_link_status(struct adapter * adapter) { @@ -1685,6 +1689,8 @@ 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 @@ -1697,6 +1703,8 @@ 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 @@ -67,6 +68,11 @@ #ifdef INET #include #include + +#ifdef DEV_CARP +#include +#include +#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();