From owner-freebsd-net@FreeBSD.ORG Mon Dec 16 20:15:42 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 92A2746B; Mon, 16 Dec 2013 20:15:42 +0000 (UTC) Received: from mail-qe0-x236.google.com (mail-qe0-x236.google.com [IPv6:2607:f8b0:400d:c02::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 29A1F16C2; Mon, 16 Dec 2013 20:15:42 +0000 (UTC) Received: by mail-qe0-f54.google.com with SMTP id cy11so4406205qeb.27 for ; Mon, 16 Dec 2013 12:15:41 -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=BYo/O6nsZMrOTzP3jOXp9XItoTBPo/gf0Owk5IxeTH8=; b=E2f0GglbEz54mlNRFd2cdZ1Ny65d63+CdoMcbizXeaFJpBnnLbiDXxjqcVqGLlBqbL EmW8ez4s57yVqi2qDTf2sVc9i5h7hKTlbUhJntAJQhOJYiJVGJCjgy4D5nuqWTvWKlXQ xziAf9me8qjkfxSK9Myjwiz65ainZ7xGLKNAv+yxEwsILPUgJZPdM4WEkgaA/6rCHzij pe1SAxSBP8qX/Gv2mJb6ZSTCfegabtbrqVPFgnGN6RFwzQZ9mZ38AkN8UHHWNhjv8eWW iXyBRBebALI/cg/fygbwyseF1oNHFGSjA1St6Q9MOF+hKJ9zKXUIoAdrjcVKJKVWJYCv EbAg== MIME-Version: 1.0 X-Received: by 10.224.89.73 with SMTP id d9mr36541909qam.5.1387224941296; Mon, 16 Dec 2013 12:15:41 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Mon, 16 Dec 2013 12:15:41 -0800 (PST) In-Reply-To: <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> <0BC9D25E-639A-4305-A51A-222AE645152C@lurchi.franken.de> Date: Mon, 16 Dec 2013 12:15:41 -0800 X-Google-Sender-Auth: 9JUMG5_e_s90ZzhisfRLV7vCyOI 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: Mon, 16 Dec 2013 20:15:42 -0000 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. -a