Date: Sat, 19 Apr 2014 15:17:23 +0400 From: Andrew Rybchenko <Andrew.Rybchenko@oktetlabs.ru> To: aurfalien <aurfalien@gmail.com>, freebsd-net@freebsd.org Subject: Re: Solarflare LACP bug? Message-ID: <53525B43.9050602@oktetlabs.ru> In-Reply-To: <2818B48D-3A2E-416A-875D-36DFD982D58A@gmail.com> References: <2818B48D-3A2E-416A-875D-36DFD982D58A@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------080705090505090908040007 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Hi, On 04/16/2014 11:00 PM, aurfalien wrote: > Hi, > > I’ve a Solarflare SFN5162F dual port 10Gb ethernet adapter. > > While the card works fine as individual ports, upon configuring LACP the machine suddenly reboots. > > Here are my commands; > > ifconfig sfxge0 up > ifconfig sfxge1 up > ifconfig lagg0 create > * ifconfig lagg0 up laggproto lacp laggport sfxge0 laggport sfxge1 10.0.10.99/16 > > * This is were the system reboots. please, find patch attached. It solves the problem for me. I'll discuss it with Solarflare and then submit patch to be pushed to subversion. Regards, Andrew. > I believe this to be a bug, should i post this on freebsd-bugs@freebsd.org > > The only thing in /var/crash is minfree. > > - aurf > > "Janitorial Services" --------------080705090505090908040007 Content-Type: text/x-patch; name="sfxge-lag-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sfxge-lag-fix.patch" sfxge: check that port is started when MAC filter is set MAC filter set may be called without softc_lock held in the case of SIOCADDMULTI and SIOCDELMULTI ioctls. ioctl handler checks IFF_DRV_RUNNING flag which implies port started, but it is not guaranteed to remain. softc_lock shared lock can't be held in the case of these ioctls processing, since it results in failure where kernel complains that non-sleepable lock is held in sleeping thread. Both problems are repeatable on LAG with LACP proto bring up. Submitted by: Andrew Rybchenko <Andrew.Rybchenko at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. diff -r 8dc01b10eb64 sys/dev/sfxge/sfxge_port.c --- a/sys/dev/sfxge/sfxge_port.c Tue Apr 15 10:32:43 2014 +0100 +++ b/sys/dev/sfxge/sfxge_port.c Sat Apr 19 14:49:46 2014 +0400 @@ -357,10 +357,21 @@ struct sfxge_port *port = &sc->port; int rc; - KASSERT(port->init_state == SFXGE_PORT_STARTED, ("port not started")); - mtx_lock(&port->lock); - rc = sfxge_mac_filter_set_locked(sc); + /* + * The function may be called without softc_lock held in the + * case of SIOCADDMULTI and SIOCDELMULTI ioctls. ioctl handler + * checks IFF_DRV_RUNNING flag which implies port started, but + * it is not guaranteed to remain. softc_lock shared lock can't + * be held in the case of these ioctls processing, since it + * results in failure where kernel complains that non-sleepable + * lock is held in sleeping thread. Both problems are repeatable + * on LAG with LACP proto bring up. + */ + if (port->init_state == SFXGE_PORT_STARTED) + rc = sfxge_mac_filter_set_locked(sc); + else + rc = 0; mtx_unlock(&port->lock); return rc; } --------------080705090505090908040007--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53525B43.9050602>