From owner-freebsd-net@FreeBSD.ORG Sat Jan 4 22:45:54 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87662EA3; Sat, 4 Jan 2014 22:45:54 +0000 (UTC) Received: from mail-qc0-x231.google.com (mail-qc0-x231.google.com [IPv6:2607:f8b0:400d:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1446217C6; Sat, 4 Jan 2014 22:45:54 +0000 (UTC) Received: by mail-qc0-f177.google.com with SMTP id m20so16060033qcx.8 for ; Sat, 04 Jan 2014 14:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=AJXuc/x/qKfXCCM36at2pa7tO7xJymXqROB2KDqcgmY=; b=kGWeb7r9h/h8FjtjUUGsFZRFzfMKiFGR4F0QJIyjAneeZ0mN49wAgHLgyS8Cvh+PHQ PT8ggPBtUi+7vfqqzh+z4wLepFIEx08G14q1PCa8LvKJ0X33xb+1btAtFprMwQBuzwAW lNuXKZuJWgsAuapv8yKSttlpNkCp2V6w0kw6ITYgcyswxf9t981Ur5i3tAHHmlNrKvsg qiXVDHq0N/YYXmBWOja/3MhbogjK3/YgF0eXys0BdEzzVaoLEQuKbzn4tr48gQfUaWHT pKV69LT+Aq4gRfmPGPvUs7xvhsqOiBOdr6Zlt/YbU4htkSXWFBfwOhZNzJA+CLoPbs8Q Q2lA== MIME-Version: 1.0 X-Received: by 10.49.38.37 with SMTP id d5mr168316539qek.17.1388875553213; Sat, 04 Jan 2014 14:45:53 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Sat, 4 Jan 2014 14:45:53 -0800 (PST) In-Reply-To: References: <521B9C2A-EECC-4412-9F68-2235320EF324@lurchi.franken.de> <201312131326.28952.jhb@freebsd.org> <201312131717.10863.jhb@freebsd.org> <0BC9D25E-639A-4305-A51A-222AE645152C@lurchi.franken.de> Date: Sat, 4 Jan 2014 14:45:53 -0800 X-Google-Sender-Auth: o1Oum4gJl8bE9JRJxyq0SMTAuOo Message-ID: Subject: Re: A small fix for if_em.c, if_igb.c, if_ixgbe.c From: Adrian Chadd To: Michael Tuexen , Jack Vogel Content-Type: text/plain; charset=ISO-8859-1 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: Sat, 04 Jan 2014 22:45:54 -0000 hi, Happy New Year all. If noone objects, I'm going to commit Michael's patch to -HEAD in the next couple of days, with some extra comments explaining why things are the way they are. We can then flesh out the comments and API documentation about this stuff. Thanks! -a On 16 December 2013 19:25, Adrian Chadd wrote: > On 16 December 2013 13:04, Michael Tuexen > wrote: >> On Dec 16, 2013, at 9:15 PM, Adrian Chadd wrote: >> >>> On 16 December 2013 12:06, Michael Tuexen >>> wrote: >>> >>>>> 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). >>> >>> If there's a queuing layer in the middle then we can't know that for >>> certain. If the driver can't transmit the frame (eg it fails because >>> of collisions, for example) then again, we can't know that for >>> certain. >>> >>> What we can only know is that it was either queued and may or may not >>> make it on the wire, or it wasn't queued/transmitted and it definitely >>> _won't_ make it on the wire. >> Correct. And I'm only interested in the "it wasn't queued/transmitted >> and it definitely _won't_ make it on the wire." part. >> So I would need something like >> >> if_transmit() returns an error only if it wasn't queued/transmitted >> and it definitely _won't_ make it on the wire. >> >> Acceptable for you? > > Sounds like the same thing to me, so yes. :) > > > > -a