From owner-freebsd-current@FreeBSD.ORG Mon Jun 30 18:02:51 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A324955F; Mon, 30 Jun 2014 18:02:51 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B007236C; Mon, 30 Jun 2014 18:02:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8BBC9B917; Mon, 30 Jun 2014 14:02:50 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: Fix Emulex "oce" driver in CURRENT Date: Mon, 30 Jun 2014 14:02:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201406301402.42119.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 30 Jun 2014 14:02:50 -0400 (EDT) Cc: delphij@freebsd.org, Luigi Rizzo , Stefano Garzarella X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 18:02:51 -0000 On Monday, June 30, 2014 12:36:22 pm Stefano Garzarella wrote: > Hello, > I had problems during some experiments with Emulex and "oce" driver in > CURRENT. > I found several bugs in the "oce" driver and this patch fixes them. > > - oce_multiq_start(): if the link is down returns ENXIO without consuming > the mbuf. > A trivial fix is to remove the initial error check, since > oce_multiq_transmit() which is > called next handles the link down situation correctly. > - oce_multiq_transmit(): there is an extra call to drbr_enqueue() causing > the > mbuf to be enqueued twice when the NIC's queue is full. > - oce_multiq_transmit(): same problem fixed recently in ixgbe (r267187) and > other drivers: > if the mbuf is enqueued, the proper return value is 0 > > This patch has been reviewed by luigi (in cc). > > If someone could have a look on this and give me some feedback it would be > great. I think these sound fine, but I've cc'd Xin Li (delphij@) who has worked with folks at Emulex to maintain this driver. He is probably the best person to review this. > Regards, > Stefano Garzarella > > > > diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c > index 70d6393..af57491 100644 > --- a/sys/dev/oce/oce_if.c > +++ b/sys/dev/oce/oce_if.c > @@ -563,9 +563,6 @@ oce_multiq_start(struct ifnet *ifp, struct mbuf *m) > int queue_index = 0; > int status = 0; > > - if (!sc->link_status) > - return ENXIO; > - > if ((m->m_flags & M_FLOWID) != 0) > queue_index = m->m_pkthdr.flowid % sc->nwqs; > > @@ -1274,7 +1271,6 @@ oce_multiq_transmit(struct ifnet *ifp, struct mbuf > *m, struct oce_wq *wq) > drbr_putback(ifp, br, next); > wq->tx_stats.tx_stops ++; > ifp->if_drv_flags |= IFF_DRV_OACTIVE; > - status = drbr_enqueue(ifp, br, next); > } > break; > } > @@ -1285,7 +1281,7 @@ oce_multiq_transmit(struct ifnet *ifp, struct mbuf > *m, struct oce_wq *wq) > ETHER_BPF_MTAP(ifp, next); > } > > - return status; > + return 0; > } > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > -- John Baldwin