From owner-freebsd-net@FreeBSD.ORG Tue Dec 17 03:25:29 2013 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 0FD18600; Tue, 17 Dec 2013 03:25:29 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99C1C1119; Tue, 17 Dec 2013 03:25:28 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id x13so4534633qcv.1 for ; Mon, 16 Dec 2013 19:25:27 -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=PybMX1TbeJNCpk9/eN1Qz5WvIt8FXyNEWt5yDmxCi3U=; b=X6zZP9sIkk5hmZ3i103A6LzHcJcyfarW2jOs1rslJxWxto1pF6YV/KJycaNE5dhXQV nvov32DmnkpwyYezWzCWFeqUJ2kC81tg7zwK0KNjtFJ2AFB/I5BIGcDW/NejIqVcAwCO Asswj4TBNfn0ELR3oBTGbaibQF9p5UTVpxNAcRC2K2dQ9Aj5gglYC2MCF8srTTjwqWBq 2QeUB+ProKqW80AlPASJ8gk8guk1rzsErz43Q7v4lyEfCrypYUhgwl/nQqpeSF6vXgjd SynB8t0yw1pA85f5cjXfpMhjpd9Jxmc59WqwAgNRLvUab+66fz+yWowpo/O2XJ+wzJ4W L1Hw== MIME-Version: 1.0 X-Received: by 10.229.56.200 with SMTP id z8mr38579851qcg.1.1387250727824; Mon, 16 Dec 2013 19:25:27 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Mon, 16 Dec 2013 19:25:27 -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: Mon, 16 Dec 2013 19:25:27 -0800 X-Google-Sender-Auth: PRrz0AzVKBqUZz0ezbCYfu1exOk Message-ID: Subject: Re: A small fix for if_em.c, if_igb.c, if_ixgbe.c From: Adrian Chadd To: Michael Tuexen 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: Tue, 17 Dec 2013 03:25:29 -0000 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