From owner-freebsd-net@FreeBSD.ORG Mon Dec 16 20:06:50 2013 Return-Path: Delivered-To: freebsd-net@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 2FDF0F0; Mon, 16 Dec 2013 20:06:50 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B42EB15E3; Mon, 16 Dec 2013 20:06:49 +0000 (UTC) Received: from [192.168.1.200] (p508F0515.dip0.t-ipconnect.de [80.143.5.21]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 440E81C0C0692; Mon, 16 Dec 2013 21:06:46 +0100 (CET) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: A small fix for if_em.c, if_igb.c, if_ixgbe.c From: Michael Tuexen In-Reply-To: Date: Mon, 16 Dec 2013 21:06:46 +0100 Content-Transfer-Encoding: 7bit Message-Id: <0BC9D25E-639A-4305-A51A-222AE645152C@lurchi.franken.de> References: <521B9C2A-EECC-4412-9F68-2235320EF324@lurchi.franken.de> <201312131326.28952.jhb@freebsd.org> <201312131717.10863.jhb@freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1510) Cc: Yong-Hyeon Pyun , FreeBSD Net , John-Mark Gurney , Jack F Vogel , John Baldwin X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 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, 16 Dec 2013 20:06:50 -0000 On Dec 16, 2013, at 8:36 PM, Adrian Chadd wrote: > On 13 December 2013 14:17, John Baldwin wrote: > >>> Anyone using if_start() failing as "the frame i just queued failed to >>> transmit" is broken and well, we should just replace it with >>> if_transmit(). >> >> Hmm, I was a bit wrong. Driver if_start routines return void, so they >> only failed if the IFQ filled up completely. In that case, I think it is >> fine to move forward with what you want (only return an error for failures >> involving the packet passed to if_transmit), but I don't think we should >> hange if_transmit drivers to just always return 0. > > i agree. if_transmit() should return 0 only if: > > * the driver queued it internally and intends to try transmitting it later; > * the driver directly dispatched the frame to the hardware. > > If it failed to do either of the above, it should return an error. > > How's that sound? That sounds good. However, The transport layer is interested in the case where if_transmit() returns a non-zero value. Does your statement imply: if_transmit() returns a non-zero value only if the packet will not make it on the wire (for example, it failed to queue it). Best regards Michael > > > -a >