Date: Tue, 21 Dec 2010 13:32:16 +0600 From: Eugene Grosbein <egrosbein@rdtc.ru> To: Shtorm <admin@shtorm.com> Cc: net@freebsd.org Subject: Re: lagg/lacp poor traffic distribution Message-ID: <4D105800.2070808@rdtc.ru> In-Reply-To: <1292844095.1917.136.camel@stormi> References: <4D0CFEFF.3000902@rdtc.ru> <1292844095.1917.136.camel@stormi>
next in thread | previous in thread | raw e-mail | index | archive | help
On 20.12.2010 17:21, Shtorm wrote: > I had this problem with igb driver, and I found, that lagg selects > outgoing interface based on packet header flowid field if M_FLOWID field > is set. And in the igb driver code flowid is set as > > #if __FreeBSD_version >= 800000 > <------><------><------>rxr->fmp->m_pkthdr.flowid = que->msix; > <------><------><------>rxr->fmp->m_flags |= M_FLOWID; > #endif > > The same thing in em driver with MULTIQUEUE > > That does not give enough number of flows to balance traffic well, so I > commented check in if_lagg.c > > lagg_lb_start(struct lagg_softc *sc, struct mbuf *m) > { > <------>struct lagg_lb *lb = (struct lagg_lb *)sc->sc_psc; > <------>struct lagg_port *lp = NULL; > <------>uint32_t p = 0; > > //<---->if (m->m_flags & M_FLOWID) > //<----><------>p = m->m_pkthdr.flowid; > //<---->else > > and with this change I have much better load distribution across interfaces. > > Hope it helps. > I've made new sysctl net.link.lagg.use_flows to enable/disable this code in run time and disabled it. No change. --- if_lagg.c.orig 2010-12-20 22:53:21.000000000 +0600 +++ if_lagg.c 2010-12-20 22:57:50.000000000 +0600 @@ -168,6 +168,11 @@ &lagg_failover_rx_all, 0, "Accept input from any interface in a failover lagg"); +static int lagg_use_flows = 1; +SYSCTL_INT(_net_link_lagg, OID_AUTO, use_flows, CTLFLAG_RW, + &lagg_use_flows, 1, + "Use flows for load sharing"); + static int lagg_modevent(module_t mod, int type, void *data) { @@ -1666,7 +1671,7 @@ struct lagg_port *lp = NULL; uint32_t p = 0; - if (m->m_flags & M_FLOWID) + if (lagg_use_flows && (m->m_flags & M_FLOWID)) p = m->m_pkthdr.flowid; else p = lagg_hashmbuf(m, lb->lb_key);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D105800.2070808>