From owner-freebsd-net@FreeBSD.ORG Mon Jul 5 15:17:08 2004 Return-Path: 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 0C87116A4CE for ; Mon, 5 Jul 2004 15:17:08 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2733843D5C for ; Mon, 5 Jul 2004 15:17:07 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i65FE6Ui030046 for freebsd-net@freebsd.org.checked; (8.12.8/vak/2.1) Mon, 5 Jul 2004 19:14:06 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i65FBJrv029925; (8.12.8/vak/2.1) Mon, 5 Jul 2004 19:11:19 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <40E96F82.4040007@cronyx.ru> Date: Mon, 05 Jul 2004 19:10:58 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Roman Kurakin References: <20040703173945.GW97102@empiric.dek.spc.org> <40E7D291.6010002@cronyx.ru> In-Reply-To: <40E7D291.6010002@cronyx.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit cc: pak cc: rea@mbslab.kiae.ru cc: freebsd-net@freebsd.org Subject: Re: kern/57100: disable hardware checksums when using bridge(4). X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 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, 05 Jul 2004 15:17:08 -0000 Hi, Just one more idea. We may add some sysctl option like bridge.froce_hw_checksum. rik Roman Kurakin wrote: > Also: > http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/67823 > It was send by my friend, and his server runs with this patch. > I guess that it should be idential to what you send here. If not > you may contact him and ask to try your one. > > By the way, I thought that should be better solution. For > example, why not to tag packets if they already checksumed > or not? > > rik > > Bruce M Simpson: > >> Here is a somewhat improved patch for tweaking the behaviour of the >> bridge >> code with respect to disabling the hardware-assist-checksum features of >> driver instances which are members of the bridge. >> >> I don't make use of the bridge code so I'd appreciate it if others >> who do >> could test this patch. >> >> To disable *all* capabilities, setting >> net.link.ether.bridge.hwassmask to >> 0 should suffice. >> >> Regards, >> BMS >> >> >> ------------------------------------------------------------------------ >> >> This patch implements a sysctl MIB variable, >> net.link.ether.bridge.hwassmask, >> which may be used to specify a bitmask which is applied to each member >> interface of a bridge to selectively disable interface hardware assist >> capabilities, and provides finer run-time control over such behaviour. >> >> Index: bridge.c >> =================================================================== >> RCS file: /home/ncvs/src/sys/net/bridge.c,v >> retrieving revision 1.79 >> diff -u -p -r1.79 bridge.c >> --- bridge.c 15 Jun 2004 23:57:41 -0000 1.79 >> +++ bridge.c 3 Jul 2004 17:33:47 -0000 >> @@ -204,6 +204,10 @@ SYSCTL_NODE(_net_link_ether, OID_AUTO, b >> static char bridge_version[] = "031224"; >> SYSCTL_STRING(_net_link_ether_bridge, OID_AUTO, version, CTLFLAG_RD, >> bridge_version, 0, "software version"); >> +static u_long bridge_hwassmask = 0xFFFFFFFFUL; >> +SYSCTL_ULONG(_net_link_ether_bridge, OID_AUTO, hwassmask, CTLFLAG_RW, >> + &bridge_hwassmask, 0, >> + "Mask to apply to if_hwassist field for bridge interfaces"); >> >> #define BRIDGE_DEBUG >> #ifdef BRIDGE_DEBUG >> @@ -391,6 +395,7 @@ bridge_off(void) >> >> if ( b->flags & IFF_BDG_PROMISC ) { >> ifpromisc(ifp, 0); >> + ifp->if_hwassist = b->hwassist; >> b->flags &= ~(IFF_BDG_PROMISC|IFF_MUTE) ; >> DPRINTF(("%s: %s promisc OFF if_flags 0x%x " >> "bdg_flags 0x%x\n", __func__, ifp->if_xname, >> @@ -433,6 +438,8 @@ bridge_on(void) >> if_up(ifp); >> } >> if ( !(b->flags & IFF_BDG_PROMISC) ) { >> + b->hwassist = ifp->if_hwassist; >> + ifp->if_hwassist &= bridge_hwassmask; >> (void) ifpromisc(ifp, 1); >> b->flags |= IFF_BDG_PROMISC ; >> DPRINTF(("%s: %s promisc ON if_flags 0x%x bdg_flags 0x%x\n", >> Index: bridge.h >> =================================================================== >> RCS file: /home/ncvs/src/sys/net/bridge.h,v >> retrieving revision 1.12 >> diff -u -p -r1.12 bridge.h >> --- bridge.h 15 Nov 2002 00:00:14 -0000 1.12 >> +++ bridge.h 3 Jul 2004 17:26:44 -0000 >> @@ -48,6 +48,7 @@ struct bdg_softc { >> #define IFF_MUTE 0x0002 /* mute this if for bridging. */ >> #define IFF_USED 0x0004 /* use this if for bridging. */ >> struct cluster_softc *cluster; >> + u_long hwassist; /* saved ifp->if_hwassist field */ >> } ; >> >> extern struct bdg_softc *ifp2sc; >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> 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" > >