From owner-freebsd-net@freebsd.org Mon Sep 7 03:04:02 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23DB69CC973 for ; Mon, 7 Sep 2015 03:04:02 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDD80C09 for ; Mon, 7 Sep 2015 03:04:01 +0000 (UTC) (envelope-from artemb@gmail.com) Received: by oiev17 with SMTP id v17so37741571oie.1 for ; Sun, 06 Sep 2015 20:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iMenBMpKIG2PG6vb4HbXjXwUpkDsMydpQH97m45i8Ws=; b=P7Ebj0ms1IGlkY8TWai5S5EgIXFowI20CI/zTMG/uk4GrMPyus4hqKRffdvCSyfiw+ zu5EUpDmR3wZb7VxYya7Lnawkxng5tbEAzRVPQXJqHClCjxIR5Bq86AbN5o63vh9kod0 CgkojN7ndW30HaNKbKeRUGmHcq6MgH89mq00suFv56wc2QBJndRU3qxW8NdV0NZZWVz2 Yy93nGZieADZF7QKowb8mQQ+tbY5BFaGtSkIt2Rsym8t3OgcAnM/LSn5YNdfiJ73mCLL Rlpie/dPhHgjEQCE8NdOeTn2ejj8cRhpmkIiT7LtpF6UNyxmWIMGx2tPK3KVox+JZGo8 td2Q== MIME-Version: 1.0 X-Received: by 10.202.93.7 with SMTP id r7mr12605288oib.124.1441595041103; Sun, 06 Sep 2015 20:04:01 -0700 (PDT) Received: by 10.202.83.74 with HTTP; Sun, 6 Sep 2015 20:04:01 -0700 (PDT) In-Reply-To: <1441575111.13185.YahooMailBasic@web165005.mail.bf1.yahoo.com> References: <1441575111.13185.YahooMailBasic@web165005.mail.bf1.yahoo.com> Date: Sun, 6 Sep 2015 20:04:01 -0700 Message-ID: Subject: Re: Problem with receiving packets right after remote-interface is up From: Artem Belevich To: "M. V." Cc: "freebsd-net@freebsd.org" , Luigi Rizzo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 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, 07 Sep 2015 03:04:02 -0000 On Sun, Sep 6, 2015 at 2:31 PM, M. V. wrote: > > About disabling auto-negotiation and media options: > My interfaces didn't support master/slave option. I changed interface > media to both "1000BASET" and "100BASETX" instead of auto, but problem was > still there. but interestingly, when I changed receiver's media to > "10BASET" (other side was still auto) no packet-drop occurred (even when I > removed the delay between bringing up interface and sending packets). > > Even though 10/100/1000 Ethernet uses more or less same wires, the ways they transmit signals over the wire are *very* different. 10BaseT is very forgiving signal-integrity-wise, so bringing up the link is almost instantaneous if there's no autonegotiation. 1000Base-T, on the other hand, requires fair amount of time to measure electrical properties of the cable and adjust PHY parameters to compensate for them. That takes fair amount of time even if you have disabled autonegotiation. > I checked e1000 and em driver codes to find out what is driver doing > differently when we set media to 10BASET that makes my tests succeed, but > found nothing. Any ideas? > > It all happens on physical level. Driver usually has little control over that other than telling PHY to establish the link and controlling autonegotiation parameters, so 10BaseT and 1000Base-T will look roughly the same. > On Sun, 9/6/15, Artem Belevich wrote: > > It sounds to me like the problem is with your test setup. If > > your test requires no packet drops, then it implicitly > > assumes having established link and sending the packets > > right after the interface > > Unfortunately we can't change test setup. Spirent Test-Center device runs > the tests and gives up the detailed result about what happened, and these > drops cause most tests to FAIL at the beginning and doesn't continue. > >From what you've described, FreeBSD box's behavior appears to be normal. Did you talk to Spirent support? I would expect them to have a way to either avoid bringing physical link down, or delaying RX/TX until link is up. SmartBits and Ixia boxes I dealt with before used to have plenty of controls over their interfaces. I suspect Spirent does, too. --Artem