From owner-freebsd-net@freebsd.org Sun Apr 24 03:01:36 2016 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 4AE47B112E4 for ; Sun, 24 Apr 2016 03:01:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E75D1DF5 for ; Sun, 24 Apr 2016 03:01:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3O31ZWh013447 for ; Sun, 24 Apr 2016 03:01:35 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 208985] DoS / heap overflow in bpf_stats_sysctl Date: Sun, 24 Apr 2016 03:01:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: csjp@sqrt.ca X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 03:01:36 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208985 csjp@sqrt.ca changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |csjp@sqrt.ca --- Comment #2 from csjp@sqrt.ca --- This thought had crossed my mind when I implemented this. This is one of the reasons I don't like the sysctl(2) interface for this sort of thing. It's a= lso subject to race conditions when the number of BPF descriptors change after = the size calculation but before we retrieve the data. The main reason I didn't bound check the size was for two reasons: the amou= nt of data to allocate is a function of the number of BPF descriptors that are allocated. There isn't a limit on this (outside of the file descriptor limitations). The second reason you point out, is this operation requires privilege. The reason I make the statement in the comment is because although by default o= nly root can open this device, it is possible (though not very likely) that the permissions were changed on the underlying BPF device node, resulting in a = BPF descriptor being created by somebody who wasn't root. I don't believe the patch as written is correct either, because there is no connection to this value and the number of descriptors which could be in us= e at the time the stats are retrieved. Having said that, I don't think its a bad idea to bounds check this value either. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-net@freebsd.org Sun Apr 24 07:03:24 2016 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 72691B195CA for ; Sun, 24 Apr 2016 07:03:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 633D916FB for ; Sun, 24 Apr 2016 07:03:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3O73O8W079856 for ; Sun, 24 Apr 2016 07:03:24 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 208985] DoS / heap overflow in bpf_stats_sysctl Date: Sun, 24 Apr 2016 07:03:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cturt@hardenedbsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 07:03:24 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208985 --- Comment #3 from CTurt --- Thanks for your response. I firmly believe any `malloc` with an unchecked size from userland to absolutely be a bug. As demonstrated by my PoC code, when accessible, this = can be used to at minimum panic a system. Even when accessible to root only, ha= ving a bug like this present makes the system slightly less stable, no matter how rarely it may occur. It shouldn't really matter what requirements the function has; it is always better to fix it to eliminate the possibility of this becoming critical in = the future if the code were ever to be altered. For example, you mention having interest in altering this code in the future such that under a rare circumstance, it would be accessible with normal user privileges. My original patch set an arbitrary upper limit, which may not be appropriat= e. However, if this limit is either increased or changed to be variable, I wou= ld suggest removing the `M_WAITOK` flag and returning an error for when the ca= ll fails instead. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-net@freebsd.org Sun Apr 24 11:33:21 2016 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 1DE72B1B5C3 for ; Sun, 24 Apr 2016 11:33:21 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id E60F71A13 for ; Sun, 24 Apr 2016 11:33:20 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 63CE2C44C; Sun, 24 Apr 2016 11:33:20 +0000 (UTC) Date: Sun, 24 Apr 2016 11:33:20 +0000 To: freebsd-net@freebsd.org From: "kristof (Kristof Provost)" Reply-to: D1944+325+8925873bdc96dfc2@reviews.freebsd.org Subject: [Differential] D1944: PF and VIMAGE fixes Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D1944: PF and VIMAGE fixes X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NDc2NzM0MzY4OTdiYThiNTU1MjY2ZDZmMTJiIFccrwA= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 11:33:21 -0000 kristof added inline comments. INLINE COMMENTS sys/netpfil/pf/pf_if.c:130 I don't understand why this is required. Surely if an ifnet lives in V_ifnet (so, lives in the current vnet) ifp->if_vnet is always going to be curvnet? sys/netpfil/pf/pf_if.c:141 Why add curvnet here? pfi_attach_ifnet_event doesn't use its argument. sys/netpfil/pf/pf_if.c:143 Same as above. sys/netpfil/pf/pf_if.c:151 Same as above. sys/netpfil/pf/pf_if.c:814 I believe this is correct, but should probably include adding an __unused annotation to arg, and removing the 'curvnet' argument from the EVENTHANDLER_REGISTER() call. REVISION DETAIL https://reviews.freebsd.org/D1944 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: nvass-gmx.com, bz, trociny, kristof, gnn, zec, rodrigc, glebius, eri Cc: ryan_timewasted.me, mmoll, javier_ovi_yahoo.com, farrokhi, julian, robak, freebsd-virtualization-list, freebsd-pf-list, freebsd-net-list From owner-freebsd-net@freebsd.org Sun Apr 24 21:00:25 2016 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 F2F3DB1B145 for ; Sun, 24 Apr 2016 21:00:25 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA73313DB for ; Sun, 24 Apr 2016 21:00:25 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3OL01a9027824 for ; Sun, 24 Apr 2016 21:00:25 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201604242100.u3OL01a9027824@kenobi.freebsd.org> From: bugzilla-noreply@FreeBSD.org To: freebsd-net@FreeBSD.org Subject: Problem reports for freebsd-net@FreeBSD.org that need special attention Date: Sun, 24 Apr 2016 21:00:25 +0000 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 21:00:26 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- In Progress | 193452 | Dell PowerEdge 210 II -- Kernel panic bce (broadc In Progress | 203422 | mpd/ppoe not working with re(4) with revision 285 New | 204438 | setsockopt() handling of kern.ipc.maxsockbuf limi New | 205592 | TCP processing in IPSec causes kernel panic New | 206053 | kqueue support code of netmap causes panic Open | 148807 | [panic] 8.1-RELEASE/10.1-STABLE "panic: sbdrop" a Open | 194485 | Userland cannot add IPv6 prefix routes Open | 194515 | Fatal Trap 12 Kernel with vimage Open | 199136 | [if_tap] Added down_on_close sysctl variable to t Open | 201694 | 10.2-BETA2 crashing when killing VIMAGE/VNET jail Open | 206544 | sendmsg(2) (sendto(2) too?) can fail with EINVAL; 11 problems total for which you should take action. From owner-freebsd-net@freebsd.org Mon Apr 25 06:18:31 2016 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 CF58EB1B537 for ; Mon, 25 Apr 2016 06:18:31 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (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 9A8BC1DF7 for ; Mon, 25 Apr 2016 06:18:31 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: by mail-io0-x234.google.com with SMTP id 2so174008616ioy.1 for ; Sun, 24 Apr 2016 23:18:31 -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; bh=aHqpGXXr/BWh34H5qTy6j7ckgsb0fKzt1P4Ku059YOc=; b=Dgx6F3cKDy13vPLxYQ7VdbCVbt0DB+lSDtnfblg7aZyF2w5ldBXMgtjHkQ3oqI0IW1 cL8xbL9O6gD9Ha9HT9eJN//xTuw3Ixm1LtlbS5ekK/RvdQ971IrFVGK9pD7gvlMbalM+ EfbcJJ+gAudNFfbudl5CYxq/ozkwYsRy6cwVXT5UBsvrRcRCfACUWWahnTIb+SronQJM Clwcw3hqwNqpUT0LvX40D7aU7nYfAcp8ZtSFw7+hbjhgxhcejHG55L0lQm4CmuCizOsy /OJIm73jSLOsiLnGr5DN6RmZNiZDuouf1TicVqMnanX3upkWrfl3ETSvyqaDOdw4EoAg Y+Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=aHqpGXXr/BWh34H5qTy6j7ckgsb0fKzt1P4Ku059YOc=; b=IDlzMB2n0iDZxJZWD4pQdZBrrmO40KHjB0UA86Ug43bnWEFbkHZj4R1j2wMHbsMbov Wjsc1C+iOXWrXTUfi2Lwh392alsIA3fF/kuVetpJ9oGcCmWaRXNhUi5eWNkDw59K8Vkm +X/Gd/6Nos1qVNGD7Lf0H40ASzT5s4qNY1DafPHhL8Kremesidokhgna1xpQT+MWFWxF M57KCMFR4OP53H3tQahetcXzEH3bQQe5AtLg3yWsbhm2706mEnYEcBp4GIrqMOt9uVN1 2vYAzZ8EqwDIdy9fQd6/e6MrDv6iACbaGr0raJPSYcb/rlNAVMzNLzM+hMzYzPAtjXwg ABFQ== X-Gm-Message-State: AOPr4FVAmwFH+7tH6at/bDZ5r30KcIW8MqGNayXB9WIdtDaigGBdOwvRrI6k4P1J8oPxk5opPSZdz6g5nuAF3w== MIME-Version: 1.0 X-Received: by 10.107.198.69 with SMTP id w66mr30097402iof.178.1461565111099; Sun, 24 Apr 2016 23:18:31 -0700 (PDT) Received: by 10.107.156.132 with HTTP; Sun, 24 Apr 2016 23:18:30 -0700 (PDT) In-Reply-To: References: <2C78DBCF-26F2-44D0-A45E-6EE8918648EA@netapp.com> Date: Mon, 25 Apr 2016 01:18:30 -0500 Message-ID: Subject: Re: Issues with ixl(4) From: Dustin Marquess To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 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, 25 Apr 2016 06:18:31 -0000 So I've done some more testing, and it's definitely some kind of interaction between ixl & lagg, and maybe even ix & lagg. It doesn't matter if lagg is using "lacp" or "loadbalance" (with the switch set appropriately), it happens on both. I did find out that statically adding an arp entry for the "bad hosts" fixes it, so it's something to do with ARP replies (tcpdump doesn't show it getting the ARP replies all of the time in the lagg). Pretty much exactly this problem: https://lists.freebsd.org/pipermail/freebsd-net/2015-June/042593.html Except that fix is already in the code. I going all the way back to r294499 of -CURRENT and that didn't change it. I also tried 10.3, but that immediately panics on the Intel-based ixl machine. I'll see if I can get the AMD-based ix machine to boot 10.3 for testing. -Dustin On Thu, Apr 21, 2016 at 4:52 PM, K. Macy wrote: > > > On Wednesday, April 20, 2016, Dustin Marquess wrote: >> >> I tried backing out that change and everything worked for a few minutes >> and then started acting up again. Then I notice Sean Bruno's "TCP Packets >> Drop!!!" email about LACP. I disabled LACP on the switch side and then >> changed the lagg config from "lacp" to "roundrobin", and so far so good. On >> the switch side it looks like member ports were randomly bounding in the >> LACP bundle, and when I'd tcpdump an interface I wouldn't see anything until >> another LACP&LLDP packet came in. >> >> So something seems to be broken with lagg's LACP support recently. The >> good news is I don't think the route caching is causing this problem. I'll >> put it back in and retest to make sure though. >> > > > Glad to hear I was in error. > -M > >> >> Thanks for the help! >> -Dustin >> >> On Tue, Apr 19, 2016 at 6:15 PM, K. Macy wrote: >>> >>> On Mon, Apr 18, 2016 at 10:45 PM, Eggert, Lars wrote: >>> > I haven't played with lagg+vlan+bridge, but I briefly evaluated XL710 >>> > boards last year >>> > (https://lists.freebsd.org/pipermail/freebsd-net/2015-October/043584.html) >>> > and saw very poor throughputs and latencies even in very simple setups. As >>> > far as I could figure it out, TSO/LRO wasn't being performed (although >>> > enabled) and so I ran into packet-rate issues. >>> > >>> > I basically gave up and went with a different vendor. FWIW, the XL710 >>> > boards in the same machines booted into Linux performed fine. >>> > >>> >>> FWIW, NFLX sees performance close to that of cxgbe (by far the best >>> maintained, best performing FreeBSD 40G driver) with an iflib >>> converted driver. The iflib updated driver will be imported by 11 but >>> won't become the default driver until 11.1 for wont of QA resources at >>> Intel. >>> >>> -M >> >> > From owner-freebsd-net@freebsd.org Mon Apr 25 20:54:17 2016 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 B5834B1C8C7 for ; Mon, 25 Apr 2016 20:54:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A64B619A2 for ; Mon, 25 Apr 2016 20:54:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3PKsHV6028166 for ; Mon, 25 Apr 2016 20:54:17 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 208910] if_bridge does not work properly with vlans and VIMAGE Date: Mon, 25 Apr 2016 20:54:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: shawn@debnath.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 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, 25 Apr 2016 20:54:17 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208910 --- Comment #2 from Shawn Debnath --- Per kp@, current patch by delphij is not a proper fix for the issue (see review). I am going to dig deeper to try to find the root cause for two iss= ues I am running into, which according to kp@ are unrelated but would be good to hunt down: 1) why the bridge is not accepting and retaining the mac address of the fir= st interface attached to it. 2) why the bridge is unable to disable capabilities on the parent interface (likely IFCAP_LRO, but could be others as well). Regardless, kernel shouldn't be exposing all of SIOCSIFCAP to the parent interface. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-net@freebsd.org Mon Apr 25 21:39:44 2016 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 6EBAAB1C27F for ; Mon, 25 Apr 2016 21:39:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F2B91EC5 for ; Mon, 25 Apr 2016 21:39:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3PLdiOa008405 for ; Mon, 25 Apr 2016 21:39:44 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 208910] if_bridge does not work properly with vlans and VIMAGE Date: Mon, 25 Apr 2016 21:39:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: kp@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 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, 25 Apr 2016 21:39:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208910 Kristof Provost changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kp@freebsd.org --- Comment #3 from Kristof Provost --- (In reply to Shawn Debnath from comment #2) To clarify, my main objection to the patch at the moment is that we don't understand what it fixes and why. It's possible that it is actually the correct way to fix things (although I have some concerns w.r.t. vnet, but that's a different discussion). --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-net@freebsd.org Tue Apr 26 15:59:08 2016 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 3C014B1D96A for ; Tue, 26 Apr 2016 15:59:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C45419A3 for ; Tue, 26 Apr 2016 15:59:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QFx8T4038714 for ; Tue, 26 Apr 2016 15:59:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 206581] bxe_ioctl_nvram handler is faulty Date: Tue, 26 Apr 2016 15:59:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: needs-qa, patch, security X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: sbruno@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: mfc-stable9? mfc-stable10? X-Bugzilla-Changed-Fields: bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 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, 26 Apr 2016 15:59:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206581 Sean Bruno changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Open |In Progress CC| |sbruno@FreeBSD.org --- Comment #6 from Sean Bruno --- Maintainer deleted this code in revision https://svnweb.freebsd.org/base?view=3Drevision&revision=3D298496 This ticket can be closed when the MFC period to 10 expires. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-net@freebsd.org Wed Apr 27 02:04:51 2016 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 DFB96B1DC03 for ; Wed, 27 Apr 2016 02:04:51 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id A487912DA for ; Wed, 27 Apr 2016 02:04:51 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id E9124D73C; Wed, 27 Apr 2016 02:04:50 +0000 (UTC) Date: Wed, 27 Apr 2016 02:04:50 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFcgHkI= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_af705a28c77926c0763ef92b314b0ba6" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:04:52 -0000 --b1_af705a28c77926c0763ef92b314b0ba6 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit sepherosa_gmail.com updated the summary for this revision. sepherosa_gmail.com updated this revision to Diff 15642. CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D5872?vs=14968&id=15642 REVISION DETAIL https://reviews.freebsd.org/D5872 AFFECTED FILES sys/netinet/tcp_output.c CHANGE DETAILS diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1545,9 +1545,10 @@ tp->t_softerror = error; return (error); case ENOBUFS: - if (!tcp_timer_active(tp, TT_REXMT) && + if ((len > 0 || (flags & (TH_SYN | TH_FIN))) && + !tcp_timer_active(tp, TT_REXMT) && !tcp_timer_active(tp, TT_PERSIST)) - tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); + panic("neither rexmt nor persist timer is set"); tp->snd_cwnd = tp->t_maxseg; return (0); case EMSGSIZE: EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl --b1_af705a28c77926c0763ef92b314b0ba6 Content-Type: text/x-patch; charset=utf-8; name="D5872.15642.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D5872.15642.patch" ZGlmZiAtLWdpdCBhL3N5cy9uZXRpbmV0L3RjcF9vdXRwdXQuYyBiL3N5cy9uZXRpbmV0L3RjcF9v dXRwdXQuYwotLS0gYS9zeXMvbmV0aW5ldC90Y3Bfb3V0cHV0LmMKKysrIGIvc3lzL25ldGluZXQv dGNwX291dHB1dC5jCkBAIC0xNTQ1LDkgKzE1NDUsMTAgQEAKIAkJCXRwLT50X3NvZnRlcnJvciA9 IGVycm9yOwogCQkJcmV0dXJuIChlcnJvcik7CiAJCWNhc2UgRU5PQlVGUzoKLQkgICAgICAgICAg ICAgICAgaWYgKCF0Y3BfdGltZXJfYWN0aXZlKHRwLCBUVF9SRVhNVCkgJiYKKwkJCWlmICgobGVu ID4gMCB8fCAoZmxhZ3MgJiAoVEhfU1lOIHwgVEhfRklOKSkpICYmCisJCQkgICAgIXRjcF90aW1l cl9hY3RpdmUodHAsIFRUX1JFWE1UKSAmJgogCQkJICAgICF0Y3BfdGltZXJfYWN0aXZlKHRwLCBU VF9QRVJTSVNUKSkKLQkgICAgICAgICAgICAgICAgICAgICAgICB0Y3BfdGltZXJfYWN0aXZhdGUo dHAsIFRUX1JFWE1ULCB0cC0+dF9yeHRjdXIpOworCQkJCXBhbmljKCJuZWl0aGVyIHJleG10IG5v ciBwZXJzaXN0IHRpbWVyIGlzIHNldCIpOwogCQkJdHAtPnNuZF9jd25kID0gdHAtPnRfbWF4c2Vn OwogCQkJcmV0dXJuICgwKTsKIAkJY2FzZSBFTVNHU0laRToKCg== --b1_af705a28c77926c0763ef92b314b0ba6-- From owner-freebsd-net@freebsd.org Wed Apr 27 02:09:24 2016 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 8E342B1DCE9 for ; Wed, 27 Apr 2016 02:09:24 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 6717A146E for ; Wed, 27 Apr 2016 02:09:24 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id C2818DBFA; Wed, 27 Apr 2016 02:09:23 +0000 (UTC) Date: Wed, 27 Apr 2016 02:09:23 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: <0f002fdd5bd167a82c517508b26d009b@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFcgH1M= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:09:24 -0000 sepherosa_gmail.com added a comment. In https://reviews.freebsd.org/D5872#128542, @mike-karels.net wrote: > btw, I think the line to set the snd_cwnd should remain for now, until something replaces it. ENOBUFS signals local congestion. Well, resetting the cwnd can be unfair for the connections encounters the ENOBUFS, since the underlying hardware can be flooded by other connections. So I'd remove that cwnd resetting upon ENOBUFS. We can open another discussion after fixing this issue first. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Wed Apr 27 08:22:00 2016 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 CF7DCB1C55E for ; Wed, 27 Apr 2016 08:22:00 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id AA71412F0 for ; Wed, 27 Apr 2016 08:22:00 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id AD74AC15E; Wed, 27 Apr 2016 08:21:59 +0000 (UTC) Date: Wed, 27 Apr 2016 08:21:59 +0000 To: freebsd-net@freebsd.org From: "mike-karels.net (Mike Karels)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: <80f21bc425d0d07dac5e0b5733c471e2@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFcgdqc= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 08:22:00 -0000 mike-karels.net added a comment. I disagree; congestion is congestion, not "congestion for everyone but me". I'd prefer to leave the cwnd change until it is replaced by something more modern. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Wed Apr 27 08:37:13 2016 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 073EFB1CB3E for ; Wed, 27 Apr 2016 08:37:13 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id C81B11BA5 for ; Wed, 27 Apr 2016 08:37:12 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id D522EC758; Wed, 27 Apr 2016 08:37:11 +0000 (UTC) Date: Wed, 27 Apr 2016 08:37:11 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: <0816d5d4d4f59b777cd9a31a83d80a88@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFcgejc= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 08:37:13 -0000 sepherosa_gmail.com added a comment. In https://reviews.freebsd.org/D5872#130173, @mike-karels.net wrote: > I disagree; congestion is congestion, not "congestion for everyone but me". I'd prefer to leave the cwnd change until it is replaced by something more modern. We probably can leave the cwnd resetting to later rexmt timeout or possible later fast retransmit (I think fast retransmit could kick in under some cases, if ENOBUFS happened); instead of resetting the cwnd immediately upon ENOBUFS. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Wed Apr 27 08:45:17 2016 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 E3FBDB1CE59 for ; Wed, 27 Apr 2016 08:45:17 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id A76621118 for ; Wed, 27 Apr 2016 08:45:17 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 30F29CB44; Wed, 27 Apr 2016 08:45:17 +0000 (UTC) Date: Wed, 27 Apr 2016 08:45:17 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_3c36fcb12a942e73e7363a95e239b569" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 08:45:18 -0000 --b1_3c36fcb12a942e73e7363a95e239b569 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit sepherosa_gmail.com created this revision. sepherosa_gmail.com added reviewers: network, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, hiren. sepherosa_gmail.com added a subscriber: freebsd-net-list. Herald added a reviewer: transport. REVISION DETAIL https://reviews.freebsd.org/D6120 AFFECTED FILES sys/netinet/tcp_syncache.c CHANGE DETAILS diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -127,7 +127,8 @@ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *, struct syncache_head *, int); +static int syncache_respond(struct syncache *, struct syncache_head *, int, + const struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -457,7 +458,7 @@ free(s, M_TCPLOG); } - syncache_respond(sc, sch, 1); + syncache_respond(sc, sch, 1, NULL); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -1307,7 +1308,7 @@ s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc, sch, 1) == 0) { + if (syncache_respond(sc, sch, 1, m) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1474,7 +1475,7 @@ /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc, sch, 0) == 0) { + if (syncache_respond(sc, sch, 0, m) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1505,7 +1506,8 @@ } static int -syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked) +syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked, + const struct mbuf *m0) { struct ip *ip = NULL; struct mbuf *m; @@ -1686,6 +1688,10 @@ M_SETFIB(m, sc->sc_inc.inc_fibnum); m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) { + m->m_pkthdr.flowid = m0->m_pkthdr.flowid; + M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); + } #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, transport, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, hiren Cc: freebsd-net-list --b1_3c36fcb12a942e73e7363a95e239b569 Content-Type: text/x-patch; charset=utf-8; name="D6120.15647.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D6120.15647.patch" ZGlmZiAtLWdpdCBhL3N5cy9uZXRpbmV0L3RjcF9zeW5jYWNoZS5jIGIvc3lzL25ldGluZXQvdGNw X3N5bmNhY2hlLmMKLS0tIGEvc3lzL25ldGluZXQvdGNwX3N5bmNhY2hlLmMKKysrIGIvc3lzL25l dGluZXQvdGNwX3N5bmNhY2hlLmMKQEAgLTEyNyw3ICsxMjcsOCBAQAogc3RhdGljIHZvaWQJIHN5 bmNhY2hlX2Ryb3Aoc3RydWN0IHN5bmNhY2hlICosIHN0cnVjdCBzeW5jYWNoZV9oZWFkICopOwog c3RhdGljIHZvaWQJIHN5bmNhY2hlX2ZyZWUoc3RydWN0IHN5bmNhY2hlICopOwogc3RhdGljIHZv aWQJIHN5bmNhY2hlX2luc2VydChzdHJ1Y3Qgc3luY2FjaGUgKiwgc3RydWN0IHN5bmNhY2hlX2hl YWQgKik7Ci1zdGF0aWMgaW50CSBzeW5jYWNoZV9yZXNwb25kKHN0cnVjdCBzeW5jYWNoZSAqLCBz dHJ1Y3Qgc3luY2FjaGVfaGVhZCAqLCBpbnQpOworc3RhdGljIGludAkgc3luY2FjaGVfcmVzcG9u ZChzdHJ1Y3Qgc3luY2FjaGUgKiwgc3RydWN0IHN5bmNhY2hlX2hlYWQgKiwgaW50LAorCQkgICAg Y29uc3Qgc3RydWN0IG1idWYgKik7CiBzdGF0aWMgc3RydWN0CSBzb2NrZXQgKnN5bmNhY2hlX3Nv Y2tldChzdHJ1Y3Qgc3luY2FjaGUgKiwgc3RydWN0IHNvY2tldCAqLAogCQkgICAgc3RydWN0IG1i dWYgKm0pOwogc3RhdGljIHZvaWQJIHN5bmNhY2hlX3RpbWVvdXQoc3RydWN0IHN5bmNhY2hlICpz Yywgc3RydWN0IHN5bmNhY2hlX2hlYWQgKnNjaCwKQEAgLTQ1Nyw3ICs0NTgsNyBAQAogCQkJZnJl ZShzLCBNX1RDUExPRyk7CiAJCX0KIAotCQlzeW5jYWNoZV9yZXNwb25kKHNjLCBzY2gsIDEpOwor CQlzeW5jYWNoZV9yZXNwb25kKHNjLCBzY2gsIDEsIE5VTEwpOwogCQlUQ1BTVEFUX0lOQyh0Y3Bz X3NjX3JldHJhbnNtaXR0ZWQpOwogCQlzeW5jYWNoZV90aW1lb3V0KHNjLCBzY2gsIDApOwogCX0K QEAgLTEzMDcsNyArMTMwOCw3IEBACiAJCQkgICAgcywgX19mdW5jX18pOwogCQkJZnJlZShzLCBN X1RDUExPRyk7CiAJCX0KLQkJaWYgKHN5bmNhY2hlX3Jlc3BvbmQoc2MsIHNjaCwgMSkgPT0gMCkg eworCQlpZiAoc3luY2FjaGVfcmVzcG9uZChzYywgc2NoLCAxLCBtKSA9PSAwKSB7CiAJCQlzYy0+ c2NfcnhtaXRzID0gMDsKIAkJCXN5bmNhY2hlX3RpbWVvdXQoc2MsIHNjaCwgMSk7CiAJCQlUQ1BT VEFUX0lOQyh0Y3BzX3NuZGFja3MpOwpAQCAtMTQ3NCw3ICsxNDc1LDcgQEAKIAkvKgogCSAqIERv IGEgc3RhbmRhcmQgMy13YXkgaGFuZHNoYWtlLgogCSAqLwotCWlmIChzeW5jYWNoZV9yZXNwb25k KHNjLCBzY2gsIDApID09IDApIHsKKwlpZiAoc3luY2FjaGVfcmVzcG9uZChzYywgc2NoLCAwLCBt KSA9PSAwKSB7CiAJCWlmIChWX3RjcF9zeW5jb29raWVzICYmIFZfdGNwX3N5bmNvb2tpZXNvbmx5 ICYmIHNjICE9ICZzY3MpCiAJCQlzeW5jYWNoZV9mcmVlKHNjKTsKIAkJZWxzZSBpZiAoc2MgIT0g JnNjcykKQEAgLTE1MDUsNyArMTUwNiw4IEBACiB9CiAKIHN0YXRpYyBpbnQKLXN5bmNhY2hlX3Jl c3BvbmQoc3RydWN0IHN5bmNhY2hlICpzYywgc3RydWN0IHN5bmNhY2hlX2hlYWQgKnNjaCwgaW50 IGxvY2tlZCkKK3N5bmNhY2hlX3Jlc3BvbmQoc3RydWN0IHN5bmNhY2hlICpzYywgc3RydWN0IHN5 bmNhY2hlX2hlYWQgKnNjaCwgaW50IGxvY2tlZCwKKyAgICBjb25zdCBzdHJ1Y3QgbWJ1ZiAqbTAp CiB7CiAJc3RydWN0IGlwICppcCA9IE5VTEw7CiAJc3RydWN0IG1idWYgKm07CkBAIC0xNjg2LDYg KzE2ODgsMTAgQEAKIAogCU1fU0VURklCKG0sIHNjLT5zY19pbmMuaW5jX2ZpYm51bSk7CiAJbS0+ bV9wa3RoZHIuY3N1bV9kYXRhID0gb2Zmc2V0b2Yoc3RydWN0IHRjcGhkciwgdGhfc3VtKTsKKwlp ZiAobTAgIT0gTlVMTCAmJiBNX0hBU0hUWVBFX0dFVChtMCkgIT0gTV9IQVNIVFlQRV9OT05FKSB7 CisJCW0tPm1fcGt0aGRyLmZsb3dpZCA9IG0wLT5tX3BrdGhkci5mbG93aWQ7CisJCU1fSEFTSFRZ UEVfU0VUKG0sIE1fSEFTSFRZUEVfR0VUKG0wKSk7CisJfQogI2lmZGVmIElORVQ2CiAJaWYgKHNj LT5zY19pbmMuaW5jX2ZsYWdzICYgSU5DX0lTSVBWNikgewogCQltLT5tX3BrdGhkci5jc3VtX2Zs YWdzID0gQ1NVTV9UQ1BfSVBWNjsKCg== --b1_3c36fcb12a942e73e7363a95e239b569-- From owner-freebsd-net@freebsd.org Wed Apr 27 14:56:32 2016 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 35C76B1E491 for ; Wed, 27 Apr 2016 14:56:32 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 04E6E1226 for ; Wed, 27 Apr 2016 14:56:32 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 3FAFFD281; Wed, 27 Apr 2016 14:56:31 +0000 (UTC) Date: Wed, 27 Apr 2016 14:56:31 +0000 To: freebsd-net@freebsd.org From: "jtl (Jonathan T. Looney)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFcg0x8= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 14:56:32 -0000 jtl added inline comments. INLINE COMMENTS sys/netinet/tcp_output.c:1551 In my opinion, this does //not// need to be a panic. A KASSERT() should be sufficient. Also, this is not the re-usable macro which Lawrence suggested. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Wed Apr 27 15:11:07 2016 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 532B9B1E80D for ; Wed, 27 Apr 2016 15:11:07 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 2C7F41D06 for ; Wed, 27 Apr 2016 15:11:07 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id A6B30E2B1; Wed, 27 Apr 2016 15:11:06 +0000 (UTC) Date: Wed, 27 Apr 2016 15:11:06 +0000 To: freebsd-net@freebsd.org From: "sbruno (Sean Bruno)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFcg1oo= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 15:11:07 -0000 sbruno accepted this revision. sbruno added a reviewer: sbruno. REVISION DETAIL https://reviews.freebsd.org/D6120 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, transport, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, hiren, sbruno Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Wed Apr 27 18:41:43 2016 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 91CD8B1EED6 for ; Wed, 27 Apr 2016 18:41:43 +0000 (UTC) (envelope-from zclaudio@bsd.com.br) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 23D971D3E for ; Wed, 27 Apr 2016 18:41:42 +0000 (UTC) (envelope-from zclaudio@bsd.com.br) Received: by mail-wm0-x244.google.com with SMTP id r12so15834572wme.0 for ; Wed, 27 Apr 2016 11:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=mime-version:date:message-id:subject:from:to; bh=GqvQGOlRyBcFFuQVKephw/fypKpOjfDucdF5U173FNQ=; b=B/V1HGzUTm19eqomqbHevWOHDLTivMhp/5PBJlN5F5JYjSuiLXbh7lTM6tkfa6X3l0 qYk8PgzYqIUcv7CR1q2NuTpenaQKxibaOy9Q7BrYtvp0nLDvyVfRYrHq/XvZJ3h0qeFA hlphWHQvRMblO499jCzfvhpedL9iISBLr1GS8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=GqvQGOlRyBcFFuQVKephw/fypKpOjfDucdF5U173FNQ=; b=Pt7yzRgzV6SPoiPXQbPBe8dhmOzGYgQ2q++6xA6wRrm/U4H8mwbSKYyxogdYwKa01b KOx+ftT0S6qQFU+uCbbkM8nyFeMaw5r1fUIfk2Xqi1jY4caKSEuTFKtiUyKmr6DL+7gP vie0nj1TlRkNd9PKkGne1I9o6IG6kqE71EEvDp5ZSP3vd2wsG5suOXlggkjqCnn2uu53 bbDzb7CXenKx6jEvSxaTM668w+oUnQXhxxZzLB4+eRxxZGuF/ylXut2hfaSV2QXGmzC1 Ub/o+e6NNl5Jj8BRqDw78XAH1WesmuHeyNW3BdPZsY/b+7zQ5kJMejKI3oqX/DH98rL3 irAQ== X-Gm-Message-State: AOPr4FXRZjztQzAsr5C70tNVzNtDGBfLT2glSdgZ4eptrM1k2pubsbwTyPgA91YSv6rt1/uE23m+90V1cmhhzg== MIME-Version: 1.0 X-Received: by 10.194.2.130 with SMTP id 2mr10746416wju.77.1461782500930; Wed, 27 Apr 2016 11:41:40 -0700 (PDT) Received: by 10.28.183.131 with HTTP; Wed, 27 Apr 2016 11:41:40 -0700 (PDT) Date: Wed, 27 Apr 2016 15:41:40 -0300 Message-ID: Subject: Regression? VLAN packet drop after upgrading from r281235 From: =?UTF-8?Q?Z=C3=A9_Claudio_Pastore?= To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 18:41:43 -0000 Hello, On a BGP border router I help manage, we run FreeBSD 10.1-STABLE, version r281235 and it works fine for several years now. We have around 4Gbit/s and 1.8Mpps routed on peak while per port interface we peak at 300Kpps. Our quality metrics are measured with: ping -s 1472 -i 0.1 As well as iperf bidirecional. This metric is similar to what Speedy Test and SIMET tests are done and our customers reference. Systems working w/o problem: - 10.1-STABLE / r281235 Systems tested with drops: - 10.2-STABLE / r292035M - 10.3-STABLE / r298705 - 11.0-CURRENT / r295683 (downloaded snapshot from ftp.freebsd.org) - 11.0-CURRENT Melifaro Routing Branch / r297731M While testing, when errors happen I can see output errs on the vlan port on the output from "netstat -w1 -I vlan6" input vlan6 output packets errs idrops bytes packets errs bytes colls 1 0 0 66 30557 2 33310968 0 1 0 0 105 31458 3 33912219 0 2 0 0 2954 32001 8 34983986 0 1 0 0 1512 33150 6 35942558 0 1 0 0 1512 33654 4 37311862 0 1 0 0 1512 34825 3 38213793 0 3 0 0 1683 35376 4 39488912 0 5 0 0 7280 32423 3 35551869 0 Problems may happen under high load (~200Kpps) or low load (~30Kpps) on a vlan port. The observed frame loss never happens on untagged ports, only vlan related. The observed loss happens with packets sized 900 bytes and above but noticeably loss rate is higher with packets close to 1400 (1472 is my reference size). Loss rate on all listed systems different from r281235 is 9-19% with ping(1) and iperf, while it's 0% on r281235. First I believed it to be a Intel driver error on systems newer than 10.1. My reference card are dual port 82599EB 10-Gigabit SFI/SFP+ Network Connection (2x2 on x8 PCIe bus, total 4x10G). But yesterday I replaced Intel by Chelsio T5 and the problem is still exactly the same, so it's not related to card vendor. I always test the very same hardware, I have two SSD drives in this router, one for the 10.1 which just runs fine and the other disk to test the various versions of FreeBSD. Only minor loader and sysctl confs are tweaked: kern.hz=2000 net.inet.ip.redirect=1 # do not send IP redirects net.inet.ip.accept_sourceroute=0 # drop source routed packets since they ca net.inet.ip.sourceroute=0 # if source routed packets are accepted th net.inet.tcp.drop_synfin=1 # SYN/FIN packets get dropped on initial c net.inet.udp.blackhole=1 # drop udp packets destined for closed soc net.inet.tcp.blackhole=2 # drop tcp packets destined for closed por security.bsd.see_other_uids=0 Can anyone suggest what might be a fix/tuning for this behavior? Was there any relevant change on vlan code from particular revisions close to the one I run on 10.1 and later which would lead to such a big difference? From owner-freebsd-net@freebsd.org Wed Apr 27 20:28:10 2016 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 D2AFAB1E87B for ; Wed, 27 Apr 2016 20:28:10 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 8F4721701 for ; Wed, 27 Apr 2016 20:28:10 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id u185so66928778iod.3 for ; Wed, 27 Apr 2016 13:28:10 -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; bh=1Ev3mqoNtbMx651f/aw1YebPiLUzK1rhSBDWK4R53Wc=; b=j6mLQX2AYuSRR6TF7u5Fk4q+MK8bfDfKopYRXxVwHTsuqeIsW9cp0ZZSBHuZ/1jeEh 48u0tlLNbJcwd5G7rVe+ywMktaxamNnA0yVSn+tAuPrdxl4q5P+MEuNsH9Fd+kRMF7h0 S7Y0KF9C7F0ngg7E01rcZzSP0h5DTXqim6j33dmXSWnAvKGHfVQGsyLoLsWGthhU8Q60 aioDcfBzme6n1bUb8JnHJnbanVkzPGVZbDydOfxD6PTrx79COWhRDIIertS+vJoyMMpc 7AuQH9+8CUudnVZ+zLBKCKieT0MbwBBHnklxovEv+ZF1V8PnkhUcN8bEkbdI2r7sUF1E yXKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=1Ev3mqoNtbMx651f/aw1YebPiLUzK1rhSBDWK4R53Wc=; b=FuY/bjEo7AjnDIUv7WOf0E2S1s7mM11ZdF76EPjHFYvE+RrkbsehHLndjm/pThpIfr WvcLQoAxHMMMR4OK2pCjMJu9wUVRMHYcAQFZWU0j2XJXdegogf1qimlPdFZwY6OPrIaN q5K7Eg2iXhEc+Orm2550IiNEees6//SFyh7hLNxyQNpWB/DlrMjQ1ZzkltbdFN5pFbQm iNUL0lpJpDeU43Br6zeZlpvPrOpgqEfzKBqCZerXlLyLR//gp7/8PJ7RQpMQpPiUKjwl yVW2BT5QO66FyZeK1DZrbMbGrdEiX2uwCvRVSzJ5vKovI/gLjszVTxijEoqPSpBDXrN6 D19Q== X-Gm-Message-State: AOPr4FUZIBpCR2aTCOupWyIrpD3afsjs8/jIh/SBIbTljNGqzWogB9lhqNdFtq3K5wL5yrKjsu206rpRGXg01A== MIME-Version: 1.0 X-Received: by 10.107.159.137 with SMTP id i131mr12122828ioe.29.1461788889959; Wed, 27 Apr 2016 13:28:09 -0700 (PDT) Received: by 10.107.133.65 with HTTP; Wed, 27 Apr 2016 13:28:09 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 Apr 2016 16:28:09 -0400 Message-ID: Subject: Re: Regression? VLAN packet drop after upgrading from r281235 From: Ryan Stone To: =?UTF-8?Q?Z=C3=A9_Claudio_Pastore?= Cc: freebsd-net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 20:28:10 -0000 >From a quick look at the vlan code, I can identify a few cases that might cause that counter to increment: 1) Error from the underlying ixgbe device. Does "netstat -dI ix0" show that the driver has been dropping packets? 2) Link down events on the underlying NIC. I believe that link flaps will be logged to /var/log/messages and dmesg; do you see anything there that might correspond to the time of the packet drops? 3) If VLAN_HWTAGGING is disabled through ifconfig on the port, then in theory a low memory event could cause the packet to be dropped. Does "netstat -m" show that "requests for mbufs denied" increasing? On Wed, Apr 27, 2016 at 2:41 PM, Z=C3=A9 Claudio Pastore wrote: > Hello, > > On a BGP border router I help manage, we run FreeBSD 10.1-STABLE, > version r281235 and it works fine for several years now. > > We have around 4Gbit/s and 1.8Mpps routed on peak while per port interfac= e > we peak at 300Kpps. > > Our quality metrics are measured with: > > ping -s 1472 -i 0.1 > > As well as iperf bidirecional. > > This metric is similar to what Speedy Test and SIMET tests are done and o= ur > customers reference. > > Systems working w/o problem: > - 10.1-STABLE / r281235 > > Systems tested with drops: > - 10.2-STABLE / r292035M > - 10.3-STABLE / r298705 > - 11.0-CURRENT / r295683 (downloaded snapshot from ftp.freebsd.org) > - 11.0-CURRENT Melifaro Routing Branch / r297731M > > While testing, when errors happen I can see output errs on the vlan port = on > the output from "netstat -w1 -I vlan6" > > input vlan6 output > packets errs idrops bytes packets errs bytes colls > 1 0 0 66 30557 2 33310968 0 > 1 0 0 105 31458 3 33912219 0 > 2 0 0 2954 32001 8 34983986 0 > 1 0 0 1512 33150 6 35942558 0 > 1 0 0 1512 33654 4 37311862 0 > 1 0 0 1512 34825 3 38213793 0 > 3 0 0 1683 35376 4 39488912 0 > 5 0 0 7280 32423 3 35551869 0 > > Problems may happen under high load (~200Kpps) or low load (~30Kpps) on a > vlan port. The observed frame loss never happens on untagged ports, only > vlan related. The observed loss happens with packets sized 900 bytes and > above but noticeably loss rate is higher with packets close to 1400 (1472 > is my reference size). > > Loss rate on all listed systems different from r281235 is 9-19% with > ping(1) and iperf, while it's 0% on r281235. > > First I believed it to be a Intel driver error on systems newer than 10.1= . > My reference card are dual port 82599EB 10-Gigabit SFI/SFP+ Network > Connection (2x2 on x8 PCIe bus, total 4x10G). But yesterday I replaced > Intel by Chelsio T5 and the problem is still exactly the same, so it's no= t > related to card vendor. > > I always test the very same hardware, I have two SSD drives in this route= r, > one for the 10.1 which just runs fine and the other disk to test the > various versions of FreeBSD. > > Only minor loader and sysctl confs are tweaked: > > kern.hz=3D2000 > net.inet.ip.redirect=3D1 # do not send IP redirects > net.inet.ip.accept_sourceroute=3D0 # drop source routed packets sinc= e > they ca > net.inet.ip.sourceroute=3D0 # if source routed packets are > accepted th > net.inet.tcp.drop_synfin=3D1 # SYN/FIN packets get dropped on > initial c > net.inet.udp.blackhole=3D1 # drop udp packets destined for > closed soc > net.inet.tcp.blackhole=3D2 # drop tcp packets destined for > closed por > security.bsd.see_other_uids=3D0 > > Can anyone suggest what might be a fix/tuning for this behavior? Was ther= e > any relevant change on vlan code from particular revisions close to the o= ne > I run on 10.1 and later which would lead to such a big difference? > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@freebsd.org Wed Apr 27 21:10:28 2016 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 D352CB1F4DF for ; Wed, 27 Apr 2016 21:10:28 +0000 (UTC) (envelope-from zclaudio@bsd.com.br) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 688EC1193 for ; Wed, 27 Apr 2016 21:10:28 +0000 (UTC) (envelope-from zclaudio@bsd.com.br) Received: by mail-wm0-x229.google.com with SMTP id g17so10308621wme.1 for ; Wed, 27 Apr 2016 14:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=zdrnmyaT8BMxsbjCao77cF14Clsf1nUgZDmCcpK+5NU=; b=VzG0FTCTUHCbVW5ORKbRH9Hy7q+KAF4GYymLtd+bRPJuIRQ4JkhLgASKadFTGALl7R nRkXl8AiMpt8majdqsgqd38K7hjvRJOuMH9kO1tWd82Zvag48HIKc3UQ+oI62qxSHuCn zcVSJo3euUEko3XKqUhWH6+Sf0I5WkaR3M/Nw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=zdrnmyaT8BMxsbjCao77cF14Clsf1nUgZDmCcpK+5NU=; b=g3uj5/Gq03NdqndaydBw2mZZBrQQrz1YokZma7kCkMLYyvIY/FuyP8WoM7e5lI/2sz pJeaFk0Q5pGMQD9EB9ftW4KZiRf5npXGSAEqxZerr77Lbf/bP4xgmu+xMaVvjArsSvcx XDxfR7xA6CPnSh3sY1MiDjUxAkq2SSZ4TuKbC+OOexBuW+pstsChyj3bpVUJuNPlzGAf WE1JyZXauI39PyPv2U1LhRctnohasAtOq7VnH9e3CxDXfg8asHWNqRPZVj4iCazWyhk4 sd9oSTm6FsSxW/82yE/TTBidX1HJNW8Zn7yaZroPC6xp8B3MMuYfLB/Wjucaq6RrTyEo tVmQ== X-Gm-Message-State: AOPr4FUbo47/P0lUblNhjDAKm+DjghiGJi0laIssDX7RykiQuxPQFUIFrYara343lh28gxBAHcw4DkklNuLX2g== MIME-Version: 1.0 X-Received: by 10.194.82.168 with SMTP id j8mr12952228wjy.37.1461791426992; Wed, 27 Apr 2016 14:10:26 -0700 (PDT) Received: by 10.28.183.131 with HTTP; Wed, 27 Apr 2016 14:10:26 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 Apr 2016 18:10:26 -0300 Message-ID: Subject: Re: Regression? VLAN packet drop after upgrading from r281235 From: =?UTF-8?Q?Z=C3=A9_Claudio_Pastore?= To: Ryan Stone Cc: freebsd-net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 21:10:28 -0000 Hello Ryan, 2016-04-27 17:28 GMT-03:00 Ryan Stone : > From a quick look at the vlan code, I can identify a few cases that might > cause that counter to increment: > > 1) Error from the underlying ixgbe device. Does "netstat -dI ix0" show > that the driver has been dropping packets? > No, it does not increase drop counters on ix port, only on the vlan device. > > 2) Link down events on the underlying NIC. I believe that link flaps wil= l > be logged to /var/log/messages and dmesg; do you see anything there that > might correspond to the time of the packet drops? > No, dmesg is clean, only a couple down/up link when I actually did disconnect the port, and no other message on /var/log/messages that grabs my attention. > > 3) If VLAN_HWTAGGING is disabled through ifconfig on the port, then in > theory a low memory event could cause the packet to be dropped. Does > "netstat -m" show that "requests for mbufs denied" increasing? > Here is the ifconfig -v output for the vlan6 on the 10.1-STABLE system vlan6: flags=3D8843 metric 0 mtu 15= 00 options=3D303 ether a0:36:9f:2a:6d:ae inet6 fe80::a236:9fff:fe2a:6dae%vlan6 prefixlen 64 scopeid 0x19 inet6 2804:1054:bad:b1fe::1 prefixlen 64 nd6 options=3D21 media: Ethernet autoselect (10Gbase-SR ) status: active vlan: 3005 parent interface: ix3 groups: vlan And here it is on the 10.3-STABLE system, I dont know why the only difference is no options were printed on the newer system, everything else is the same. vlan6: flags=3D8843 metric 0 mtu 15= 00 ether a0:36:9f:2a:6d:ae inet6 fe80::a236:9fff:fe2a:6dae%vlan6 prefixlen 64 scopeid 0x19 inet6 2804:1054:bad:b1fe::1 prefixlen 64 nd6 options=3D21 media: Ethernet autoselect (10Gbase-SR ) status: active vlan: 3005 parent interface: ix3 groups: vlan This is the netstat -m output when system has packet loss. Denied and delayed counters are zeroed. % netstat -m 12365/21040/33405 mbufs in use (current/cache/total) 12310/14530/26840/505076 mbuf clusters in use (current/cache/total/max) 12310/14508 mbuf+clusters out of packet secondary zone in use (current/cache) 0/225/225/252538 4k (page size) jumbo clusters in use (current/cache/total/max) 0/0/0/74826 9k jumbo clusters in use (current/cache/total/max) 0/0/0/42089 16k jumbo clusters in use (current/cache/total/max) 27711K/35220K/62931K bytes allocated to network (current/cache/total) 0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters) 0/0/0 requests for mbufs delayed (mbufs/clusters/mbuf+clusters) 0/0/0 requests for jumbo clusters delayed (4k/9k/16k) 0/0/0 requests for jumbo clusters denied (4k/9k/16k) 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile > > On Wed, Apr 27, 2016 at 2:41 PM, Z=C3=A9 Claudio Pastore > wrote: > >> Hello, >> >> On a BGP border router I help manage, we run FreeBSD 10.1-STABLE, >> version r281235 and it works fine for several years now. >> >> We have around 4Gbit/s and 1.8Mpps routed on peak while per port interfa= ce >> we peak at 300Kpps. >> >> Our quality metrics are measured with: >> >> ping -s 1472 -i 0.1 >> >> As well as iperf bidirecional. >> >> This metric is similar to what Speedy Test and SIMET tests are done and >> our >> customers reference. >> >> Systems working w/o problem: >> - 10.1-STABLE / r281235 >> >> Systems tested with drops: >> - 10.2-STABLE / r292035M >> - 10.3-STABLE / r298705 >> - 11.0-CURRENT / r295683 (downloaded snapshot from ftp.freebsd.org) >> - 11.0-CURRENT Melifaro Routing Branch / r297731M >> >> While testing, when errors happen I can see output errs on the vlan port >> on >> the output from "netstat -w1 -I vlan6" >> >> input vlan6 output >> packets errs idrops bytes packets errs bytes colls >> 1 0 0 66 30557 2 33310968 0 >> 1 0 0 105 31458 3 33912219 0 >> 2 0 0 2954 32001 8 34983986 0 >> 1 0 0 1512 33150 6 35942558 0 >> 1 0 0 1512 33654 4 37311862 0 >> 1 0 0 1512 34825 3 38213793 0 >> 3 0 0 1683 35376 4 39488912 0 >> 5 0 0 7280 32423 3 35551869 0 >> >> Problems may happen under high load (~200Kpps) or low load (~30Kpps) on = a >> vlan port. The observed frame loss never happens on untagged ports, only >> vlan related. The observed loss happens with packets sized 900 bytes and >> above but noticeably loss rate is higher with packets close to 1400 (147= 2 >> is my reference size). >> >> Loss rate on all listed systems different from r281235 is 9-19% with >> ping(1) and iperf, while it's 0% on r281235. >> >> First I believed it to be a Intel driver error on systems newer than 10.= 1. >> My reference card are dual port 82599EB 10-Gigabit SFI/SFP+ Network >> Connection (2x2 on x8 PCIe bus, total 4x10G). But yesterday I replaced >> Intel by Chelsio T5 and the problem is still exactly the same, so it's n= ot >> related to card vendor. >> >> I always test the very same hardware, I have two SSD drives in this >> router, >> one for the 10.1 which just runs fine and the other disk to test the >> various versions of FreeBSD. >> >> Only minor loader and sysctl confs are tweaked: >> >> kern.hz=3D2000 >> net.inet.ip.redirect=3D1 # do not send IP redirects >> net.inet.ip.accept_sourceroute=3D0 # drop source routed packets sin= ce >> they ca >> net.inet.ip.sourceroute=3D0 # if source routed packets are >> accepted th >> net.inet.tcp.drop_synfin=3D1 # SYN/FIN packets get dropped on >> initial c >> net.inet.udp.blackhole=3D1 # drop udp packets destined for >> closed soc >> net.inet.tcp.blackhole=3D2 # drop tcp packets destined for >> closed por >> security.bsd.see_other_uids=3D0 >> >> Can anyone suggest what might be a fix/tuning for this behavior? Was the= re >> any relevant change on vlan code from particular revisions close to the >> one >> I run on 10.1 and later which would lead to such a big difference? >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> > > From owner-freebsd-net@freebsd.org Thu Apr 28 01:25:44 2016 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 3D111B1EB62 for ; Thu, 28 Apr 2016 01:25:44 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 159BD14D1 for ; Thu, 28 Apr 2016 01:25:44 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id A2721D5A1; Thu, 28 Apr 2016 01:25:43 +0000 (UTC) Date: Thu, 28 Apr 2016 01:25:43 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: <50480d684fd80f34866f73f499e73d6b@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFchZpc= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 01:25:44 -0000 sepherosa_gmail.com added inline comments. INLINE COMMENTS sys/netinet/tcp_output.c:1551 It's what I am testing w/, since I need non-INVARIANT kernel to generate enough traffic to make ENOBUFS happen. We can change it into KASSERT, however, I am wondering should we just use "if (__predict_false(...)) panic" here? Missing timeout here can obviously causing issues for data/SYN/FIN. I will wrap this code segment into a macro (change it into KASSERT is fine w/ me) after more testing. I think the code segment is fine now; we just need to inverse the logic, if we choose to use KASSERT. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Thu Apr 28 03:30:39 2016 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 B3E35B1F9EB for ; Thu, 28 Apr 2016 03:30:39 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 78577173F for ; Thu, 28 Apr 2016 03:30:39 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id AE3CFD2CE; Thu, 28 Apr 2016 03:30:38 +0000 (UTC) Date: Thu, 28 Apr 2016 03:30:38 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6137+325+f015369c65104c2f@reviews.freebsd.org Subject: [Differential] D6137: tcp/lro: Refactor the free/active list operation. Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , Thread-Topic: D6137: tcp/lro: Refactor the free/active list operation. X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk Thread-Index: ZDQ3OTAzM2ZhZTk0ODRmZGQwZGYxNDFlY2Zj MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_9224c4cda1a9d45d20fecae5fbdb2c16" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 03:30:39 -0000 --b1_9224c4cda1a9d45d20fecae5fbdb2c16 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit sepherosa_gmail.com created this revision. sepherosa_gmail.com added reviewers: network, gallatin, rrs, adrian, delphij, glebius, hselasky, np, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com. sepherosa_gmail.com added a subscriber: freebsd-net-list. Herald added a reviewer: transport. REVISION SUMMARY Ease more work concerning active list, e.g. hash table etc. REVISION DETAIL https://reviews.freebsd.org/D6137 AFFECTED FILES sys/netinet/tcp_lro.c EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, transport, gallatin, rrs, adrian, delphij, glebius, hselasky, np, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com Cc: freebsd-net-list --b1_9224c4cda1a9d45d20fecae5fbdb2c16 Content-Type: text/x-patch; charset=utf-8; name="D6137.15684.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D6137.15684.patch" ZGlmZiAtLWdpdCBhL3N5cy9uZXRpbmV0L3RjcF9scm8uYyBiL3N5cy9uZXRpbmV0L3RjcF9scm8u YwotLS0gYS9zeXMvbmV0aW5ldC90Y3BfbHJvLmMKKysrIGIvc3lzL25ldGluZXQvdGNwX2xyby5j CkBAIC02OSw2ICs2OSwzOSBAQAogCiBzdGF0aWMgdm9pZAl0Y3BfbHJvX3J4X2RvbmUoc3RydWN0 IGxyb19jdHJsICpsYyk7CiAKK3N0YXRpYyBfX2lubGluZSB2b2lkCit0Y3BfbHJvX2FjdGl2ZV9p bnNlcnQoc3RydWN0IGxyb19jdHJsICpsYywgc3RydWN0IGxyb19lbnRyeSAqbGUpCit7CisKKwlM SVNUX0lOU0VSVF9IRUFEKCZsYy0+bHJvX2FjdGl2ZSwgbGUsIG5leHQpOworfQorCitzdGF0aWMg X19pbmxpbmUgdm9pZAordGNwX2xyb19hY3RpdmVfcmVtb3ZlKHN0cnVjdCBscm9fZW50cnkgKmxl KQoreworCisJTElTVF9SRU1PVkUobGUsIG5leHQpOworfQorCitzdGF0aWMgX19pbmxpbmUgc3Ry dWN0IGxyb19lbnRyeSAqCit0Y3BfbHJvX2VudHJ5X2dldChzdHJ1Y3QgbHJvX2N0cmwgKmxjKQor eworCXN0cnVjdCBscm9fZW50cnkgKmxlOworCisJbGUgPSBMSVNUX0ZJUlNUKCZsYy0+bHJvX2Zy ZWUpOworCWlmIChsZSA9PSBOVUxMKQorCQlyZXR1cm4gKE5VTEwpOworCUxJU1RfUkVNT1ZFKGxl LCBuZXh0KTsKKwlyZXR1cm4gKGxlKTsKK30KKworc3RhdGljIF9faW5saW5lIHZvaWQKK3RjcF9s cm9fZW50cnlfcHV0KHN0cnVjdCBscm9fY3RybCAqbGMsIHN0cnVjdCBscm9fZW50cnkgKmxlKQor eworCisJTElTVF9JTlNFUlRfSEVBRCgmbGMtPmxyb19mcmVlLCBsZSwgbmV4dCk7Cit9CisKIGlu dAogdGNwX2xyb19pbml0KHN0cnVjdCBscm9fY3RybCAqbGMpCiB7CkBAIC0xMjksNyArMTYyLDcg QEAKIAogCS8qIGZyZWUgYWN0aXZlIG1idWZzLCBpZiBhbnkgKi8KIAl3aGlsZSAoKGxlID0gTElT VF9GSVJTVCgmbGMtPmxyb19hY3RpdmUpKSAhPSBOVUxMKSB7Ci0JCUxJU1RfUkVNT1ZFKGxlLCBu ZXh0KTsKKwkJdGNwX2xyb19hY3RpdmVfcmVtb3ZlKGxlKTsKIAkJbV9mcmVlbShsZS0+bV9oZWFk KTsKIAl9CiAKQEAgLTIzNCw3ICsyNjcsNyBAQAogCXN0cnVjdCBscm9fZW50cnkgKmxlOwogCiAJ d2hpbGUgKChsZSA9IExJU1RfRklSU1QoJmxjLT5scm9fYWN0aXZlKSkgIT0gTlVMTCkgewotCQlM SVNUX1JFTU9WRShsZSwgbmV4dCk7CisJCXRjcF9scm9fYWN0aXZlX3JlbW92ZShsZSk7CiAJCXRj cF9scm9fZmx1c2gobGMsIGxlKTsKIAl9CiB9CkBAIC0yNTIsNyArMjg1LDcgQEAKIAl0aW1ldmFs c3ViKCZ0diwgdGltZW91dCk7CiAJTElTVF9GT1JFQUNIX1NBRkUobGUsICZsYy0+bHJvX2FjdGl2 ZSwgbmV4dCwgbGVfdG1wKSB7CiAJCWlmICh0aW1ldmFsY21wKCZ0diwgJmxlLT5tdGltZSwgPj0p KSB7Ci0JCQlMSVNUX1JFTU9WRShsZSwgbmV4dCk7CisJCQl0Y3BfbHJvX2FjdGl2ZV9yZW1vdmUo bGUpOwogCQkJdGNwX2xyb19mbHVzaChsYywgbGUpOwogCQl9CiAJfQpAQCAtMzQ4LDcgKzM4MSw3 IEBACiAJbGMtPmxyb19xdWV1ZWQgKz0gbGUtPmFwcGVuZF9jbnQgKyAxOwogCWxjLT5scm9fZmx1 c2hlZCsrOwogCWJ6ZXJvKGxlLCBzaXplb2YoKmxlKSk7Ci0JTElTVF9JTlNFUlRfSEVBRCgmbGMt Pmxyb19mcmVlLCBsZSwgbmV4dCk7CisJdGNwX2xyb19lbnRyeV9wdXQobGMsIGxlKTsKIH0KIAog c3RhdGljIGludApAQCAtNjIwLDE2ICs2NTMsMTYgQEAKIAogCQkvKiBGbHVzaCBub3cgaWYgYXBw ZW5kaW5nIHdpbGwgcmVzdWx0IGluIG92ZXJmbG93LiAqLwogCQlpZiAobGUtPnBfbGVuID4gKGxj LT5scm9fbGVuZ3RoX2xpbSAtIHRjcF9kYXRhX2xlbikpIHsKLQkJCUxJU1RfUkVNT1ZFKGxlLCBu ZXh0KTsKKwkJCXRjcF9scm9fYWN0aXZlX3JlbW92ZShsZSk7CiAJCQl0Y3BfbHJvX2ZsdXNoKGxj LCBsZSk7CiAJCQlicmVhazsKIAkJfQogCiAJCS8qIFRyeSB0byBhcHBlbmQgdGhlIG5ldyBzZWdt ZW50LiAqLwogCQlpZiAoX19wcmVkaWN0X2ZhbHNlKHNlcSAhPSBsZS0+bmV4dF9zZXEgfHwKIAkJ ICAgICh0Y3BfZGF0YV9sZW4gPT0gMCAmJiBsZS0+YWNrX3NlcSA9PSB0aC0+dGhfYWNrKSkpIHsK IAkJCS8qIE91dCBvZiBvcmRlciBwYWNrZXQgb3IgZHVwbGljYXRlIEFDSy4gKi8KLQkJCUxJU1Rf UkVNT1ZFKGxlLCBuZXh0KTsKKwkJCXRjcF9scm9fYWN0aXZlX3JlbW92ZShsZSk7CiAJCQl0Y3Bf bHJvX2ZsdXNoKGxjLCBsZSk7CiAJCQlyZXR1cm4gKFRDUF9MUk9fQ0FOTk9UKTsKIAkJfQpAQCAt NjYyLDcgKzY5NSw3IEBACiAJCQkgKiBiZSBmdXJ0aGVyIGRlbGF5ZWQuCiAJCQkgKi8KIAkJCWlm IChsZS0+YXBwZW5kX2NudCA+PSBsYy0+bHJvX2Fja2NudF9saW0pIHsKLQkJCQlMSVNUX1JFTU9W RShsZSwgbmV4dCk7CisJCQkJdGNwX2xyb19hY3RpdmVfcmVtb3ZlKGxlKTsKIAkJCQl0Y3BfbHJv X2ZsdXNoKGxjLCBsZSk7CiAJCQl9CiAJCQlyZXR1cm4gKDApOwpAQCAtNjg2LDIyICs3MTksMjEg QEAKIAkJICogb3ZlcmZsb3csIHByby1hY3RpdmVseSBmbHVzaCBub3cuCiAJCSAqLwogCQlpZiAo bGUtPnBfbGVuID4gKGxjLT5scm9fbGVuZ3RoX2xpbSAtIGxjLT5pZnAtPmlmX210dSkpIHsKLQkJ CUxJU1RfUkVNT1ZFKGxlLCBuZXh0KTsKKwkJCXRjcF9scm9fYWN0aXZlX3JlbW92ZShsZSk7CiAJ CQl0Y3BfbHJvX2ZsdXNoKGxjLCBsZSk7CiAJCX0gZWxzZQogCQkJZ2V0bWljcm90aW1lKCZsZS0+ bXRpbWUpOwogCiAJCXJldHVybiAoMCk7CiAJfQogCiAJLyogVHJ5IHRvIGZpbmQgYW4gZW1wdHkg c2xvdC4gKi8KLQlpZiAoTElTVF9FTVBUWSgmbGMtPmxyb19mcmVlKSkKKwlsZSA9IHRjcF9scm9f ZW50cnlfZ2V0KGxjKTsKKwlpZiAobGUgPT0gTlVMTCkKIAkJcmV0dXJuIChUQ1BfTFJPX05PX0VO VFJJRVMpOwogCiAJLyogU3RhcnQgYSBuZXcgc2VnbWVudCBjaGFpbi4gKi8KLQlsZSA9IExJU1Rf RklSU1QoJmxjLT5scm9fZnJlZSk7Ci0JTElTVF9SRU1PVkUobGUsIG5leHQpOwotCUxJU1RfSU5T RVJUX0hFQUQoJmxjLT5scm9fYWN0aXZlLCBsZSwgbmV4dCk7CisJdGNwX2xyb19hY3RpdmVfaW5z ZXJ0KGxjLCBsZSk7CiAJZ2V0bWljcm90aW1lKCZsZS0+bXRpbWUpOwogCiAJLyogU3RhcnQgZmls bGluZyBpbiBkZXRhaWxzLiAqLwoK --b1_9224c4cda1a9d45d20fecae5fbdb2c16-- From owner-freebsd-net@freebsd.org Thu Apr 28 05:21:39 2016 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 D5D6AB1F2D8 for ; Thu, 28 Apr 2016 05:21:39 +0000 (UTC) (envelope-from arvorebemgrande@gmail.com) Received: from mail-oi0-x241.google.com (mail-oi0-x241.google.com [IPv6:2607:f8b0:4003:c06::241]) (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 948831DEE for ; Thu, 28 Apr 2016 05:21:39 +0000 (UTC) (envelope-from arvorebemgrande@gmail.com) Received: by mail-oi0-x241.google.com with SMTP id w198so7085408oiw.2 for ; Wed, 27 Apr 2016 22:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=hlLLlfDWqgZ9mXTxMaGpukoJQ/JtsPO2plyZbhd0FCI=; b=LO0uUugf68AJHRvzFy6a9++bKqzAifHnhEYFzq9afbq6/DcVVcNVachba3l9Ah+3Kh chfq6CCh+dJAZO4F8eK8lZ7igGyfgsTOej6bxd5nlf4l2W/TckPvjf9aM7eru6JStZh6 TQFrPu+1mkBhQLVmsTKrzM977F5V96g30bn3WkFZbhvJXbkDyIvNNbsO4WHXnhG1cb4x I4744gMekfNQ3+ryfe+XBctAV4vfeQILYb6IjxWKHHKHW7QQOQDDfz5q133YNZiy0l57 ssgHLMpt6y+/57qgIZSyJSks1N9sD5F/fVWv3J0DTB86tvqpd7q0afvOE5mywDGrEC6/ Soxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=hlLLlfDWqgZ9mXTxMaGpukoJQ/JtsPO2plyZbhd0FCI=; b=WfXstdUpyYebADgc9oCXI/NuG9QFzkWenIzP3hBmkaqxDHXMv0toT/CGDixzIgQmBQ CAGFDFlAp9OY51x7mn+F7AOBXAXYs3nhcXYsN/6z2biVeIiqQfYVzgiyvZfk9/O0ScYv TqbCc/3Mug6hWWZkNQWUAqDiP+84moS5ik02ld0FeT/zjg4juNuEDO6h2m7wvI80cD3x uBn3FaTtN0joLcwKo4Lw0YmMf/r7iyPjRRLD2XEo1u5wcZknfBb8RZrPdX4EZFNA7d8r 0b3Ja7XUd7UJ+lNs+4FnApi9yNABnMI4bEY5pgUhifUlH3z7TP6+GBts1VOd4bMR3C9E ZRnA== X-Gm-Message-State: AOPr4FW99lWeVJv/+2ggw6Ex+if3KZ8rKN6FYMnLyVhvOE79ihaYnaGe6jZ3Fguiwt0x3rC8GIPHCJr00cU1JQ== MIME-Version: 1.0 X-Received: by 10.202.207.205 with SMTP id f196mr4886241oig.142.1461820899068; Wed, 27 Apr 2016 22:21:39 -0700 (PDT) Received: by 10.202.72.12 with HTTP; Wed, 27 Apr 2016 22:21:39 -0700 (PDT) Date: Thu, 28 Apr 2016 02:21:39 -0300 Message-ID: Subject: Working divert socket example prog? From: lpa lpa To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 05:21:39 -0000 Do anyone have a working example code of a divert loop program? I tried building this one[1] but it seems to be for FreeBSD 5 and won't build on latest system. I want to make simple measurement of pps rate for a packet traveling inside a divert socket and getting reinjected back while printing some logs. However I am not a coder :( Thank you. [1]https://github.com/DianeRay/divert-loop/tree/master/divert-loop --=20 Mais que uma ONG. Uma convic=C3=A7=C3=A3o. From owner-freebsd-net@freebsd.org Thu Apr 28 15:19:02 2016 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 ED92AB1FD55 for ; Thu, 28 Apr 2016 15:19:02 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id C639817C7 for ; Thu, 28 Apr 2016 15:19:02 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 6D9E8CAB7; Thu, 28 Apr 2016 15:19:02 +0000 (UTC) Date: Thu, 28 Apr 2016 15:19:02 +0000 To: freebsd-net@freebsd.org From: "gallatin (Andrew Gallatin)" Reply-to: D6137+325+f015369c65104c2f@reviews.freebsd.org Subject: [Differential] D6137: tcp/lro: Refactor the free/active list operation. Message-ID: <5a62357bc12a09453564ba3ff2bc34b5@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , Thread-Topic: D6137: tcp/lro: Refactor the free/active list operation. X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: ZDQ3OTAzM2ZhZTk0ODRmZGQwZGYxNDFlY2ZjIFciKeY= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 15:19:03 -0000 gallatin added a comment. The tcp_lro_entry_get() abstraction adds an extra compare to the critical path (the compare against NULL in the function itself, in addition to the same compare in the main routine). At least it does at the C level. Have you verified that the compiler is smart enough to continue to use a single compare? If this adds an extra compare to the actual executed code, then I object. REVISION DETAIL https://reviews.freebsd.org/D6137 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, transport, rrs, adrian, delphij, glebius, hselasky, np, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, gallatin Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Thu Apr 28 15:42:11 2016 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 58E4EB1F3B7 for ; Thu, 28 Apr 2016 15:42:11 +0000 (UTC) (envelope-from admin196@u196.ccbjwi.com) Received: from u196.ccbjwi.com (u196.ccbjwi.com [154.16.127.196]) by mx1.freebsd.org (Postfix) with ESMTP id 17F9614EE for ; Thu, 28 Apr 2016 15:42:09 +0000 (UTC) (envelope-from admin196@u196.ccbjwi.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=ccbjwi; d=u196.ccbjwi.com; h=Date:From:To:Subject:Message-ID:Mime-Version:Content-Type; i=admin196@u196.ccbjwi.com; bh=iLIScoykV1+yJm9kasDkS31CWuI=; b=KA79wKu3++6OIeDDCtAQiB5yBRnk6Nz5fc6z3MbX68sELlHhWTeEqRmQCHVOsvT96f1MtTv0YxX8 Dpn3c/r+x/g8VscfuUx5MyY/MpTsTGQcHpjd8qPLzWCB3ubiDrg0G0Y0hH7EQgbEdU7dMQTyekyq t37ZPKKH5Hbc7ZtkDuc= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=ccbjwi; d=u196.ccbjwi.com; b=hOvcPLIEmFL1q1I98OdmrhHvVlGlQYzEwx/qZvzSby13UxYPM+qyCRtpG53/8876U+3xV5n0Vd+v 1+i7j61ySKWSaW3yuXvjhVo73Y7evOK0R0t+yYNWCUvZH5+Fy2OG272JSi79PJShmBSSuic6V4aM kfYsY0Ls9inmAMakujQ=; Date: Thu, 28 Apr 2016 22:29:21 +0800 From: "Rayban" To: Subject: Rayban Sunglasses : Buy Now!Don't Miss Out ! Save Price 83% OFF! Cheap buy! buy! buy!Latest styles Message-ID: <20160428222929132603@u196.ccbjwi.com> X-mailer: Foxmail 6, 13, 102, 15 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 15:42:11 -0000 DQpIYXZpbmcgdHJvdWJsZSByZWFkaW5nIHRoaXMgZW1haWw/IFZpZXcgaXQgaW4geW91ciBicm93 c2VyLiBOb3QgaW50ZXJlc3RlZCBhbnltb3JlPyBVbnN1YnNjcmliZSBpbnN0YW50bHkuDQpIT01F IFNVTkdMQVNTRVMgRVlFR0xBU1NFUyBDVVNUT01JWkUgQ09OVEFDVCBVUyBMT0dJTiANCldFTENP TUUgVE8gUkFZQkFOIE9VVExFVCBTVE9SRSEgDQoNClJBWUJBTiBTVE9SRSANCg0KRVZFUllUSElO RyBVUCBUTyANCjgyJU9GRiANClNIT1AgTk9XIA0KDQoNCkJVWSBNT1JFIFNBVkUgTU9SRSANCg0K T3VyIHByb21pc2VzOg0KDQoNCi0gRnJlZSBkZWxpdmVyeSBhbmQgcmV0dXJucyB3aXRoIG5vIG1p bmltdW0gc3BlbmQNCg0KLSAxMDAgZGF5cyB0byByZXR1cm4gb3IgZXhjaGFuZ2UgYW4gaXRlbQ0K DQotIFNhbWUtZGF5IGRpc3BhdGNoIGZvciBvcmRlcnMgcGxhY2VkIGJlZm9yZSA3IERheXMuKg0K DQotIENvbXBsZXRlIHNlY3VyaXR5IHdpdGggMTAwJSBzZWN1cmUgb3JkZXIgcHJvY2Vzc2luZw0K DQotID5DdXN0b21lciBzYXRpc2ZhY3Rpb24gaXMgb3VyIHRvcCBwcmlvcml0eSANCg0KKlR3ZW50 eS1mb3VyIGhvdXJzIGEgZGF5LCBkZXBlbmRlbnQgdXBvbiBwYXltZW50IHZhbGlkYXRpb24NCg0K KlNlZSB0ZXJtcyBhbmQgY29uZGl0aW9ucyANCg0KDQoNCg0KQ29weXJpZ2h0IEAgMjAwOS0yMDE2 IFJheWJhbiBTdW5nbGFzc2VzLiBBbGwgUmlnaHRzIFJlc2VydmVkLiA= From owner-freebsd-net@freebsd.org Thu Apr 28 17:23:25 2016 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 5EBC4B1FA17 for ; Thu, 28 Apr 2016 17:23:25 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 367DB16CF for ; Thu, 28 Apr 2016 17:23:25 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id A8271E356; Thu, 28 Apr 2016 17:23:24 +0000 (UTC) Date: Thu, 28 Apr 2016 17:23:24 +0000 To: freebsd-net@freebsd.org From: "rrs (Randall Stewart)" Reply-to: D6137+325+f015369c65104c2f@reviews.freebsd.org Subject: [Differential] D6137: tcp/lro: Refactor the free/active list operation. Message-ID: <0929e532b3fadcaffc25940fabb4393c@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , Thread-Topic: D6137: tcp/lro: Refactor the free/active list operation. X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: ZDQ3OTAzM2ZhZTk0ODRmZGQwZGYxNDFlY2ZjIFciRww= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 17:23:25 -0000 rrs added a comment. It would be worth checking the assembly output.. if it truly inlines it then it should probably only do one compare.. but worth checking... REVISION DETAIL https://reviews.freebsd.org/D6137 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, transport, adrian, delphij, glebius, hselasky, np, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, gallatin, rrs Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Thu Apr 28 18:13:46 2016 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 B0317B1F5D2 for ; Thu, 28 Apr 2016 18:13:46 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (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 7613312C0 for ; Thu, 28 Apr 2016 18:13:46 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id r187so11860230pfr.2 for ; Thu, 28 Apr 2016 11:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=v7qIfXum5wPwD1B2cCR6W02rnLmmmhwDlVzoKlmKPBM=; b=kzuyEsdQh43+7p92GuZ81tA2vp6Xmyer0cazdlJixgtM4O0J/jex7H0xc3X+I1Stb7 OYeHfXiKWvGVZkrtzpxoQE7vOC/Jn2FAIZLgKWChOkbyZsQ3MXJR09D5xp8QSVRMaY0c gCohpZKEH6e/gGeRYQs8gT0PCuzzQ7gkzXsbhiyhi8qAqTjdr3QER99lq7myPy3iIVr/ YCO6IE9SpX0AxXcp83eb7rYF/R1XTWm1LRa9iT63hR/C4/xI6c11s9dfDuLAH/YHfw+j wPycZlHGQblZh2pydb3Dg4HvGHKLSNCjEvW5j8tfdadXNorrrkjIPjTngchTgpg+KlIr 9lWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=v7qIfXum5wPwD1B2cCR6W02rnLmmmhwDlVzoKlmKPBM=; b=KHazrRmRkNg8Wmolw3yjAQTf63hEhsD/OHSJIwahJLLYMsA01WUQgVVC1c/RIDWRBL glWXDyPe9q8usMhSVmLtrVewmq3HN0KNavOFrzzbQNNZ25DwoZ4obxtfJ1rwdvbkXJIb DDEW1Cvq6Z0Jh8mWQsj1IsBaWCW22qyEtyVwRqk/VfoEtejx+qh/GnHxryNGZ44npKqr C80SvnAn+9QvBaEN1pj/rSyrsDhApwfBk6vo4n1QTGC0li4Lds3256seRYAwRLYJriwb rHZrS9pYvtAlLxYrvMh7ZZML9+Q+RYasAvxViQKK2AndZYHVb6jyX0HTCSoQ6J9N1Fqp ftIw== X-Gm-Message-State: AOPr4FXwa7Jq+yAOIrrixRBEdAF2ZuIqp71KiVMY+qdtTB9o6tk+obsZlPWaMzgW9zkLFA== X-Received: by 10.98.80.150 with SMTP id g22mr22610072pfj.132.1461867225970; Thu, 28 Apr 2016 11:13:45 -0700 (PDT) Received: from ?IPv6:2620:83:8001:24::1:567? ([2620:83:8001:24::1:567]) by smtp.googlemail.com with ESMTPSA id we8sm17051889pac.29.2016.04.28.11.13.45 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2016 11:13:45 -0700 (PDT) To: freebsd-net@freebsd.org From: bazzoola Subject: netmap overrun counters Message-ID: Date: Thu, 28 Apr 2016 11:13:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 18:13:46 -0000 Hi! Two questions: (1) Is there a way to know when netmap rx rings overrun? Most NIC drivers provide MPC (missed packet count) and sysctl for rx_overrun. I would like to know if my application is not reading as fast, i.e., no frames are being dropped. (2) What is the benefit of NETMAP_DO_RX_POLL? I do see the buffers being updated when I set this flag but 'tail' is not advancing unless I read. Bazz From owner-freebsd-net@freebsd.org Thu Apr 28 18:35:11 2016 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 DE989B1FB58 for ; Thu, 28 Apr 2016 18:35:11 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::22e]) (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 B02AD1E88 for ; Thu, 28 Apr 2016 18:35:11 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pa0-x22e.google.com with SMTP id r5so35581249pag.1 for ; Thu, 28 Apr 2016 11:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=e5hXjG5saqtxqac2kHb+TORcINMEjZ2GgLZjfpF2nCE=; b=MgZ0CLeX2s0DSAwv0HAD32ahdD4NPjZJPw4YJXaf8F/8ozhjiB/zDTj4xVMYXcyHpM 7QoI5/zyChfbIbLjiUmYsMjlbE7jMkUzLO7E4OEDbtwN24Zw63AwTPnpTa3P3Bn3Q9vM Nqt8GGkwkILvmP1Fa10wZVqZAa4PlLczboDaVosMUSlLGuLW4lvAFO/NNJbZWwHhSEbn YhhsQECQK8iQDjUvJRV4sKpIWuWyGREdtl3vJDVhibGVh0cN5hE0xGppiIJoYNJQxnr2 s9jHaXNBRW3eAus2O3Udt3pFXu85USVbzBRs6MZW4vuTPScSmR3+phcAZSU2Z8iLmlaw tNDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=e5hXjG5saqtxqac2kHb+TORcINMEjZ2GgLZjfpF2nCE=; b=AUspEeczG34BvR9m1Bjws9uEauN3Sv4m/0pNITyHYXGI5ZNJepgiEyVFI0bziFnn5M csf+ApFxYY5t21NG0tVGgLGufa66XSfcaulzlp2X6nAWbwwnSfIZ4+ptxl7HZZ770FWX sgO872nVGAujJ0+qrz+eK/uBNunlUmvWwF8op51KNULkUN0WP9YwRTCv+g1pGLgwGTvH iHcw2JA26VrKjvX7xhrbCo4bIlakJ2Xh2MmeZAUdxvvuNiGF1JSMfBX/FC4y7ITDCZvU uAWyMDV17CXP6jDwhSOqXR9Q3Nx50VHjNfGA/5jHHXBPnkA2QXsjVs8o+L+yUxiKMCy8 /ZTQ== X-Gm-Message-State: AOPr4FVzJj+ikLklOQoG/soXlWHpsr8nMM12NFUiBzGIiavB9idB1JFLvvm9FgmmKzlyZg== X-Received: by 10.66.118.166 with SMTP id kn6mr22724195pab.33.1461868511159; Thu, 28 Apr 2016 11:35:11 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id 199sm16910694pfc.15.2016.04.28.11.35.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2016 11:35:09 -0700 (PDT) Sender: Navdeep Parhar Subject: Re: netmap overrun counters To: bazzoola , freebsd-net@freebsd.org References: From: Navdeep Parhar Message-ID: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> Date: Thu, 28 Apr 2016 11:35:08 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 18:35:12 -0000 On 04/28/2016 11:13, bazzoola wrote: > Hi! > > Two questions: > > (1) Is there a way to know when netmap rx rings overrun? Most NIC > drivers provide MPC (missed packet count) and sysctl for rx_overrun. > > I would like to know if my application is not reading as fast, i.e., no > frames are being dropped. A NIC's hardware counters don't distinguish between netmap or normal operation so you can monitor the existing sysctls for rx drops/overruns. Regards, Navdeep From owner-freebsd-net@freebsd.org Thu Apr 28 19:03:00 2016 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 9ECCCB1F467 for ; Thu, 28 Apr 2016 19:03:00 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) (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 71B6C1F24; Thu, 28 Apr 2016 19:03:00 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: by mail-pa0-x242.google.com with SMTP id vv3so11771528pab.0; Thu, 28 Apr 2016 12:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=0zEQUhbHS0B7KlxmpQ/fA13wimT/dRnaOkHBhFpQPRQ=; b=Rp3MHjROKlPwWYJJelxHx0PeIOPghOwfnjd1GwfcQXqJWi53IBUfUT5gZ6UhxBMZLE 8uM05wKOwfGRDCDFxNH1lQ3Xni9JiX/zRYwN2aU7Oa0bt3a5HN8HJZeTGFbX11WylbCD FePBpV+RBTYcNN7I1+L3HtW3oBU+J5xz221bDrl3+xjG7/hLRYFQXOh+dEXtUFtWPDXD JOlD19Fa7+OCrTpGyVelReOKcVibPxL7Uq1jog1Nu1l1xCz1RwwZcytWSHmW3Awu7FdO +m7/BVe4Xo3UEzKHXj6SzMan7udBMZ8wvlLs37JWemHrHCueO5GsFz2nOdW6FjKErY+w WxTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0zEQUhbHS0B7KlxmpQ/fA13wimT/dRnaOkHBhFpQPRQ=; b=kBhxhXTfzu3P3XQfZ09zNDMCfY5r7RzgE4/5JY4OFDsYJfh/RPXYNy9PW6Wct3CFZB MHEyj9a89tx9HUQnAZTruA15SJLbCaPmrfKNSIOj5iPmu3sy8BK4+hjQVsw9bfIK+U7b m4CxRhRlVhnSangW6/TZ5rX5DL+xXiASSVs9XHfkE3TUnFAlodDLJ54RiTrkiwuT+RhF jwA2mCVS3TQiykbde11QAF29zQyatvcoz+h2IoK7RT9oqHMhm3mQ6DdaoctPSNcmjgFJ i0jPH+7uiuhGuwJdSfxQwgyQDw4L5foSg2PFaup3LIDy8AbBihSXBqHF1hUmS0elIrqY h7zg== X-Gm-Message-State: AOPr4FWjV3gyXUFp+MXpLcOwUO+ecrZNOAyv7ifesFEi+Jfk8CxdxT7PcMEVzmG2xF/QZw== X-Received: by 10.66.180.111 with SMTP id dn15mr22604462pac.69.1461870180146; Thu, 28 Apr 2016 12:03:00 -0700 (PDT) Received: from ?IPv6:2620:83:8001:24::1:567? ([2620:83:8001:24::1:567]) by smtp.googlemail.com with ESMTPSA id d186sm17004808pfa.45.2016.04.28.12.02.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2016 12:02:59 -0700 (PDT) Subject: Re: netmap overrun counters To: Navdeep Parhar , freebsd-net@freebsd.org References: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> From: bazzoola Message-ID: <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> Date: Thu, 28 Apr 2016 12:02:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 19:03:00 -0000 On 04/28/2016 11:35 AM, Navdeep Parhar wrote: > On 04/28/2016 11:13, bazzoola wrote: >> Hi! >> >> Two questions: >> >> (1) Is there a way to know when netmap rx rings overrun? Most NIC >> drivers provide MPC (missed packet count) and sysctl for rx_overrun. >> >> I would like to know if my application is not reading as fast, i.e., no >> frames are being dropped. > > A NIC's hardware counters don't distinguish between netmap or normal > operation so you can monitor the existing sysctls for rx drops/overruns. > > Regards, > Navdeep > Navdeep, I am not asking about NIC's ring overrun. As you know netmap has its own rings. Is there a way to know if netmap's rx ring overrun? Thanks for your input. From owner-freebsd-net@freebsd.org Thu Apr 28 19:06:28 2016 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 54355B1FD58 for ; Thu, 28 Apr 2016 19:06:28 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 DA3D216DB for ; Thu, 28 Apr 2016 19:06:27 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id a17so1380199wme.0 for ; Thu, 28 Apr 2016 12:06:27 -0700 (PDT) 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-transfer-encoding; bh=gdXpyl3NeSTcvDVXCbjVwfZpLB4nOCXhSXaxbKfla58=; b=rod3hN6q+LuZraXGZ27ASwswpZOOA+rozxz069xjXMdIHz82iUzNZFq1sMT948RkhK 1cpuSG1tt6Ixm62a45K5dtpsXd2L9GGkqxrcgTZOOdzuXqkBj48KqtoQM2ncDyNPlQWa YvDCL0gNHeOWUJMw67fwdiogUPhEeHJGbFB2rPYrFFE9IvSIP5PixON/hoSv12So22+J N8t+e0d8OqZYkP3qVKRl3sxW4ja0sOlAgueYOFOJoEn/H6isvJ6apyX2wiTE5Gq0kIed mcATl8Q1PSIOVyfu2lY4IkvUv00+XnwfrFsUnpbn0zCi545iwMDIasvNIIkQW4aIIoAB LT4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=gdXpyl3NeSTcvDVXCbjVwfZpLB4nOCXhSXaxbKfla58=; b=Yhz+jv/JPfu0Ccz1NCcsZii9Bh6+ZPUuFNom1FbwnCehBOuvLur2V3HhZpNUlTw9m/ wMHtxQ+KotXYWGipZq1hyfCVR5oY+pC80kSps+JHWNqZi8CtNHYDzDnAM4cPCDBWpC90 0OefKQCBp7+G0dNr4I/25VpqrWTvJKS+eBClmSVzP9CokkCRHVDb1jbnOTZXyMg4NoAX vv8bigoa9Pcb7udPinT5LXunDIr4S1DQmHnO5bnOr7m3k7XiyawLg+M2/w5PuPCBUqrX oRwFdDzvEAv7QJEJvpeTfWygxKTr5EPEn/ctMFrfl0w5XziYApkuGsssS4Sb0AE09ObS 6OsQ== X-Gm-Message-State: AOPr4FXWrV/xFA4O/jnCtRJ4jqK7jv8Pz8I5f7gIPJMF9rpkZhFIP+qdOD2bYIBGBIViZ49WhNu4+OeKodK8uA== MIME-Version: 1.0 X-Received: by 10.194.78.235 with SMTP id e11mr17126801wjx.54.1461870385649; Thu, 28 Apr 2016 12:06:25 -0700 (PDT) Sender: ndenev@gmail.com Received: by 10.28.143.7 with HTTP; Thu, 28 Apr 2016 12:06:25 -0700 (PDT) In-Reply-To: References: Date: Thu, 28 Apr 2016 21:06:25 +0200 X-Google-Sender-Auth: OpizrGRqlKvmknJd1YM0LoFLGfc Message-ID: Subject: Re: Working divert socket example prog? From: Nikolay Denev To: lpa lpa Cc: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 19:06:28 -0000 Hi, Have you looked at the natd(8) source code? --Nikolay On Thu, Apr 28, 2016 at 7:21 AM, lpa lpa wrote: > Do anyone have a working example code of a divert loop program? > > I tried building this one[1] but it seems to be for FreeBSD 5 and won't > build on latest system. I want to make simple measurement of pps rate for= a > packet traveling inside a divert socket and getting reinjected back while > printing some logs. > > However I am not a coder :( > > Thank you. > > [1]https://github.com/DianeRay/divert-loop/tree/master/divert-loop > > -- > Mais que uma ONG. > Uma convic=C3=A7=C3=A3o. > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-net@freebsd.org Thu Apr 28 19:06:30 2016 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 C9102B1FD7C for ; Thu, 28 Apr 2016 19:06:30 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) (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 325B2176C; Thu, 28 Apr 2016 19:06:30 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id c126so107433141lfb.2; Thu, 28 Apr 2016 12:06:30 -0700 (PDT) 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; bh=B1zcKx6xBa1oCMPEqcho2d4jSkyIccJJoe3ZNj+x5k4=; b=L4Egcx5u+PV1EodMuD0eLZiui5XXGz0lX0jpVUm7MGxvqMBKrOJv9bh0JhBar9zEoi asFZ7DPjOOfJIg/QRWkiRkDBjG18aQTmecVr+vSLRhC2lKHxPWwIdpHFYl/0h4J4vZIo SD+xFALDSoTi7foRM4rSqqYDRYlO675uu0uK3bDcdtp7tLlYZTlr+qqe3KwB+Xf9qyEK bldEEcC7+x/VgHVuF5Sf5+FYjJYD3dV3krqb1/MtKemJ4kHrBCubCSaPxGyUWomIHzTF EP3aPlooQxD+fSpudg4m+S5JnKBHOva1ZgLWZIbHBbKqLnnnlH3sieDnCk/qp29oy2fF d+1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=B1zcKx6xBa1oCMPEqcho2d4jSkyIccJJoe3ZNj+x5k4=; b=X5IvYTZ6c9NU+usyaJ4sau5BKYg4sHSAXllUwyYj1RNUNzo3vDO2Bp63wNzIoQW8Ay 6nsaP6+Hq4tLmfyBc9LOPEm+/FXT1/h4kn5WACxKmIyMp/QjZyiuCVc5+kyFk0NLrget ZuAoPkaOMsIQ4ziOF3mhjQZPvksjOGHWWJ4/jp7Qy78QBYZkqiEbxOsehH5epuc/EYul FNx92uSKT4/aUTIWbE0W8/L9pR5n7m9Fk4ixxi3ZAX2RriWNDq2Bea+f2LXkTKnu2DOq u1gtsJOc92GMB4t6V+C24ivuisYgVFwWKkgPu5SBicsMvoQQrQ4cV0uXmM3BPvpRXGXm G3fg== X-Gm-Message-State: AOPr4FV37cSbGhBh1OGnD/BujzWfI2E9VvW1ElgwqdP8vYvkgayVHEpDqWHNV/f0+BvecU9DJhethIaVgLnr5Q== MIME-Version: 1.0 X-Received: by 10.25.145.149 with SMTP id t143mr6903976lfd.37.1461870388457; Thu, 28 Apr 2016 12:06:28 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.79.102 with HTTP; Thu, 28 Apr 2016 12:06:28 -0700 (PDT) In-Reply-To: <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> References: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> Date: Thu, 28 Apr 2016 21:06:28 +0200 X-Google-Sender-Auth: HtwcOlyO-6bIP7lccBsxcSzGJpc Message-ID: Subject: Re: netmap overrun counters From: Luigi Rizzo To: bazzoola Cc: Navdeep Parhar , "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 19:06:30 -0000 On Thursday, April 28, 2016, bazzoola wrote: > > > On 04/28/2016 11:35 AM, Navdeep Parhar wrote: > > On 04/28/2016 11:13, bazzoola wrote: > >> Hi! > >> > >> Two questions: > >> > >> (1) Is there a way to know when netmap rx rings overrun? Most NIC > >> drivers provide MPC (missed packet count) and sysctl for rx_overrun. > >> > >> I would like to know if my application is not reading as fast, i.e., no > >> frames are being dropped. > > > > A NIC's hardware counters don't distinguish between netmap or normal > > operation so you can monitor the existing sysctls for rx drops/overruns. > > > > Regards, > > Navdeep > > > > Navdeep, > > I am not asking about NIC's ring overrun. As you know netmap has its own > rings. Is there a way to know if netmap's rx ring overrun? Overruns by definition can only be counted by the NIC Cheers Luigi > > Thanks for your input. > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org > " > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+------------------------------- From owner-freebsd-net@freebsd.org Thu Apr 28 19:15:06 2016 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 413F9B203AB for ; Thu, 28 Apr 2016 19:15:06 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) (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 12AFF14CC; Thu, 28 Apr 2016 19:15:06 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: by mail-pa0-x244.google.com with SMTP id i5so10185097pag.3; Thu, 28 Apr 2016 12:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=2YJci7qlV4wYV9Ljybq+rMvyPFPsZYl0Vs461SM0Ruc=; b=kzOmUicTD9yWPBYU5Wk0vKLOe68bYUvVGk8sSLCNf4A6MhzT1d0SYGl+L+xqybF3s4 H/5INe0hMagJLJd/3mfgxZNm1BJGgP74MTGaI2vRH9d0zj4a1l3dSq7JYtbg7PsavXn1 LCinO82K6kldTZy7+AyHuzV9DslZIlUGgC4P4Vj9MbYkQ3QSK3gvfoZZlo4fS17XRvsu fPRVkwd9UmHh7lKRzZg1o51YEgXHJcJlcvTy/uGmSkMcnABNot5fYiGY7MxPSktuzdbF AUuwMiKyfE8N79Q0dveAfcBF3TQqvJEDMBIJb0AM8GyMOqab3zxbN0dDKNFnULdLcOuR EyPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2YJci7qlV4wYV9Ljybq+rMvyPFPsZYl0Vs461SM0Ruc=; b=H/06fwFGaYkX74SsGSgjbOQdtwDcPpZy9MPQ0bUg1isYDVOWKuXIL+wIOrBx7Ky/Jz hFPMm4VMLOhMCwgYsveVFzu1q7yLFy8pjNl1v6aFhbJ7vY52hOj9wKh/nDeqCYtdGtE9 awA4oBXQxtrLCv8qJnYbc88c3B7/noErF/vY4wT1QxfTC4Q1lNApHJMW0i6ZLyG4Zmye WEOiIIxoIz3ql0wQWouBGpBVwBwNlDCJtUJaMLtrjSty5ZnUaOsYFhTri4ACLx6JAR4h D7+jhYQ2OZJ4wAHt+PbiZIWIWh7786aPeSV+RHe70iLiWhJK9olo704ClOQM7gwDgoqc viFA== X-Gm-Message-State: AOPr4FU3u3DKkGa75fgu3O6/AGqO2spQUFzs2p2aMohQqE9rQqF3t9PoJNBcWqXzytivJA== X-Received: by 10.66.193.161 with SMTP id hp1mr23090525pac.9.1461870905697; Thu, 28 Apr 2016 12:15:05 -0700 (PDT) Received: from ?IPv6:2620:83:8001:24::1:567? ([2620:83:8001:24::1:567]) by smtp.googlemail.com with ESMTPSA id b64sm17057448pfa.48.2016.04.28.12.15.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2016 12:15:05 -0700 (PDT) Subject: Re: netmap overrun counters To: Luigi Rizzo References: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> Cc: Navdeep Parhar , "freebsd-net@freebsd.org" From: bazzoola Message-ID: Date: Thu, 28 Apr 2016 12:15:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 19:15:06 -0000 On 04/28/2016 12:06 PM, Luigi Rizzo wrote: > > > On Thursday, April 28, 2016, bazzoola > wrote: > > > > On 04/28/2016 11:35 AM, Navdeep Parhar wrote: > > On 04/28/2016 11:13, bazzoola wrote: > >> Hi! > >> > >> Two questions: > >> > >> (1) Is there a way to know when netmap rx rings overrun? Most NIC > >> drivers provide MPC (missed packet count) and sysctl for rx_overrun. > >> > >> I would like to know if my application is not reading as fast, > i.e., no > >> frames are being dropped. > > > > A NIC's hardware counters don't distinguish between netmap or normal > > operation so you can monitor the existing sysctls for rx > drops/overruns. > > > > Regards, > > Navdeep > > > > Navdeep, > > I am not asking about NIC's ring overrun. As you know netmap has its own > rings. Is there a way to know if netmap's rx ring overrun? > > > Overruns by definition can only be counted by the NIC > > Cheers > Luigi > > Luigi, I will rephrase the question to avoid the 'overrun' definition. (1) if my application is not reading fast enough is there a way to know if netmap's rx ring starts overwriting unread slots? Also, my section question was: (2) What is the benefit of NETMAP_DO_RX_POLL? I do see the slots being updated when I set this flag but 'tail' is not advancing unless I read. Basically, all I am trying to do is detect if frames are dropped in my application using netmap API. Thanks! B. From owner-freebsd-net@freebsd.org Thu Apr 28 19:28:36 2016 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 B9396B2079D for ; Thu, 28 Apr 2016 19:28:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (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 845281CEC; Thu, 28 Apr 2016 19:28:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id bi2so1608859igb.0; Thu, 28 Apr 2016 12:28:36 -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; bh=Ur/DmWcJA82S1kpQTUdH7UscoDZhnKm4yNxNQ5TmSf0=; b=cORb1ZQ7HxUyto+GfOBX2e0Afq1Uh5eZqI7CyXS88oaXHwFPZqiArbfGhxwaC9+eq0 UREsCCpsRSsEydxVr3tAnnWt7h/HiEROahF/kVG5O+9xLL/g9g2vJI/uj8kFhxaE2Vvm XR2x0nVDiZgoawLdXVfv74AWpoftFQYlfAb2ZyY/9vEVUEX+RZCGQFHH7mQ6v/aQQs4Y ApmTKHH/DgpdTlRkG8QnCikBTsRgxA2VaHcary8/+gG+Ke8LUYYgu81Byjg5+mg8HxEV /KbjG4kuDpNpOup+tFkLxWeQm4VTEiFE7bBGEsRQ/TrWhE0SMDY9dQTid7pyL4GpDmyU 6EoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Ur/DmWcJA82S1kpQTUdH7UscoDZhnKm4yNxNQ5TmSf0=; b=jRv0CGQ7bR9mZnHWk/3eVGGkWheGmpFdiJCUkUghUkSPNT6L3M0cRcAvnKyh3qUgt8 Dnw7Ku4hLOv37NL8pfTcN4462DdRxB2iQpWsGm5f3AeUHk+Ojg+cJZIZnDW7dkavNSGE JHefI5EvLDGiXysKKNLVbKrVeTY2uCOTUGIRlchEsyH4KFIt5g9VZSNvpgr+dB/Nt9uI QGjz+ob5UgFiQuevl4MB5HoQx1ABCQwE/n7rIhXRvVuNMt6SIHEdJrt6GP+vVLQUT/jQ TIt4Zm6l+2pSV2b0fifcK0apMNv8flH4ypxx7WqUyg/gQzldCVCe3kHewJuAaOcQL03M ekrw== X-Gm-Message-State: AOPr4FUTtb4uhFoa4NyF9LKDfELA+7esDudVShZXAJTvazpQU6Ui/VFgjRmWMsV9Fa8Gt1vdN+I3BZDnZknbMA== MIME-Version: 1.0 X-Received: by 10.50.224.139 with SMTP id rc11mr9563549igc.22.1461871714728; Thu, 28 Apr 2016 12:28:34 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Thu, 28 Apr 2016 12:28:34 -0700 (PDT) In-Reply-To: References: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> Date: Thu, 28 Apr 2016 12:28:34 -0700 Message-ID: Subject: Re: netmap overrun counters From: Adrian Chadd To: bazzoola Cc: Luigi Rizzo , "freebsd-net@freebsd.org" , Navdeep Parhar Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 19:28:36 -0000 It doesn't overwrite unread slots; it just hits the end and stops RX'ing (and is counted by the NIC as an RX overflow) until you've RX'ed some frames and told netmap what you've handed. -adrian From owner-freebsd-net@freebsd.org Thu Apr 28 20:15:20 2016 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 88D68B1F188 for ; Thu, 28 Apr 2016 20:15:20 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (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 DB1811332; Thu, 28 Apr 2016 20:15:19 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-lf0-x22c.google.com with SMTP id u64so96781337lff.3; Thu, 28 Apr 2016 13:15:19 -0700 (PDT) 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; bh=XPt8MNLFAhFKzaCsgd4nez1NTUaNp02YYAWwSDgdvPc=; b=h0BgC5VzmuIWy1njSO5jKM4OYRKUo178naQuv/bzJI8/BMmJVgUle7zAb3f93+JK8F Q5l7SjvoCWI5t1YU9ejiR1S3nXI5SUtKZlgC0ZYPwUflXh1cRKdJLTPYVR6M+mMl7LBP eQBu7IiVccJXP72dM1zEA+0AJimmyQvJj4SAo5UDFumixrcjnxxKJ5ryfe4+Q+jCRHXl Gf0QlX0Z+cGCyjJG0wtNDFrU8/4r38/iwCUF0FyLkcaZ5Tj+nAku1jdhrci671L0Lhvt +Ii2q1510op+IN+HQr0DaCRgPZIOXSWQV7HMgQm7A0BX+wOJ0xudyINXdNdY8qISZYgJ TEMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=XPt8MNLFAhFKzaCsgd4nez1NTUaNp02YYAWwSDgdvPc=; b=KSJfeYBhKH28g5wSB1I//PEBbniFk/2Iwod8OkSRZvvbeP+Rd09lHDvL0AUib4ZuMm IX/IrRwAfoQoqR7gLY2NNRTsIFxFfDtksLIWZrELkAqbC15LiTq1HtpafTXbaJE7eeWk XozrtfDPgMeAl6AtQQFEyFfrsdTjEki+6o7NgCeoy8ms5r8n1upuk7184YAODmVfNLkc v8f1PkSprJeRRyQi7Rdy9a9RRyTTtDBKW7LJNt8V+v4Ar/9eORLsGRSFthCGothJGyj9 ErVj0nDLu51THPfYg3eRaipipGp7bhirof7LS5gvzKHfhHg/d6JtlZvK0om35Iwo/2ua ft3Q== X-Gm-Message-State: AOPr4FVTQkaSxAmmKQY7gepSCdbDByKR+tqN/UmPK1R5Vk979mi99sDbL+s3+6L0+kxNhYmYxv+rouo2EaR3/w== MIME-Version: 1.0 X-Received: by 10.112.13.33 with SMTP id e1mr5953120lbc.79.1461874517515; Thu, 28 Apr 2016 13:15:17 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.79.102 with HTTP; Thu, 28 Apr 2016 13:15:17 -0700 (PDT) In-Reply-To: References: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> Date: Thu, 28 Apr 2016 22:15:17 +0200 X-Google-Sender-Auth: ejY72bkp3y-vzBpCnaAvYLWdHdI Message-ID: Subject: Re: netmap overrun counters From: Luigi Rizzo To: bazzoola Cc: Navdeep Parhar , "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 20:15:20 -0000 On Thu, Apr 28, 2016 at 9:15 PM, bazzoola wrote: > > > On 04/28/2016 12:06 PM, Luigi Rizzo wrote: > > > > > > On Thursday, April 28, 2016, bazzoola > > wrote: > > > > > > > > On 04/28/2016 11:35 AM, Navdeep Parhar wrote: > > > On 04/28/2016 11:13, bazzoola wrote: > > >> Hi! > > >> > > >> Two questions: > > >> > > >> (1) Is there a way to know when netmap rx rings overrun? Most NI= C > > >> drivers provide MPC (missed packet count) and sysctl for > rx_overrun. > > >> > > >> I would like to know if my application is not reading as fast, > > i.e., no > > >> frames are being dropped. > > > > > > A NIC's hardware counters don't distinguish between netmap or > normal > > > operation so you can monitor the existing sysctls for rx > > drops/overruns. > > > > > > Regards, > > > Navdeep > > > > > > > Navdeep, > > > > I am not asking about NIC's ring overrun. As you know netmap has it= s > own > > rings. Is there a way to know if netmap's rx ring overrun? > > > > > > Overruns by definition can only be counted by the NIC > > > > Cheers > > Luigi > > > > > > Luigi, > > I will rephrase the question to avoid the 'overrun' definition. > > (1) if my application is not reading fast enough is there a way to know > if netmap's rx ring starts overwriting unread slots? > =E2=80=8BThis never happens. When the ring is full the NIC stops writing packets to the buffers and drops them=E2=80=8B, counting them as overruns. Same as with the standard drivers. > Also, my section question was: > > (2) What is the benefit of NETMAP_DO_RX_POLL? I do see the slots being > updated when I set this flag but 'tail' is not advancing unless I read. > > please re-read the relevant part of the manual page: RECEIVE RINGS On receive rings, after a netmap system call, the slots in the range head... tail-1 contain received packets. User code should process the= m and advance head and cur past slots it wants to return to the kernel. cur may be moved further ahead if the user code wants to wait for more packets without returning all the previous slots to the kernel. At the next NIOCRXSYNC/select()/poll(), slots up to head-1 are returne= d to the kernel for further receives, and tail may advance to report new incoming packets. Below is an example of the evolution of an RX ring: after the syscall, there are some (h)eld and some (R)eceived slots head cur tail | | | v v v RX [..hhhhhhRRRRRRRR..........] user advances head and cur, releasing some slots and holding other= s head cur tail | | | v v v RX [..*****hhhRRRRRR...........] NICRXSYNC/poll()/select() recovers slots and reports new packets head cur tail | | | v v v RX [.......hhhRRRRRRRRRRRR....] tail advances if there are new packets _and_ can at most go one slot before head. At that point the buffer is full and the NIC starts dropping packets until your application consumes packets, advance=E2=80=8Bs head+cur and makes room so that the NIC can copy new packets to the buffers and the driver advances tail Basically, all I am trying to do is detect if frames are dropped in my > application using netmap API. > =E2=80=8Bwrong model :) netmap per se never drops packets because it does not run code. If your application does not read fast enough it is the NIC that drops packets, and counts them as overrun; netmap cannot know how many of them. If it is your application that drops packets, it is because it has read them so netmap cannot know that they have been dropped. I think you are misled by the way the kernel operates, where 1) the NIC stores packets in the ring, then 2) the kernel copies them in the socket buffer, and finally 3) the application reads from the socket buffer. With netmap there is no #2 cheers luigi From owner-freebsd-net@freebsd.org Thu Apr 28 21:53:27 2016 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 520FCB208D3 for ; Thu, 28 Apr 2016 21:53:27 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (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 219151C83; Thu, 28 Apr 2016 21:53:27 +0000 (UTC) (envelope-from bazzoola@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id r187so12359294pfr.2; Thu, 28 Apr 2016 14:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=8uhO92cUcw+FI3A21Rch0tbtPdNldY9MAj4vNrXkEeU=; b=uKrFKpwVe5vOWwGsUYnXd5gS0/Hietk9OvEimWG39fPaVv2yIy1HZhRP7iKB0VlVan QCFEb4r1kgLsb/xDz9l99XGQG21itCGLmJcLC/mUzE0Cox/koKBkXxcvcamt2twWGRhw eL6T0sQFgjXzOw8+xWCr7hwIUfoFPQrgSqwqtpD0HK/XKB4S2Tc5UbxK3l1rSTRRVXmf TDt7GVF96lyUlCXZWYI2hBa8v9gpsCn+Hd5OhOh2wOFXCk5C66+Sq4osCXTINtlsx7qh X8mj8pr8U2qAXgQRzw0XNrL+MiFyniGZcZIWuQ/MBDZZl02nSA7hWmvNOlIIA8TFPebg JIgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=8uhO92cUcw+FI3A21Rch0tbtPdNldY9MAj4vNrXkEeU=; b=jYsziXKNX7b/CyEf0zrTUdX2cfHzpXsaygtj3Ibtds+kZNmX/BeNJAJmV6Jhf5oFAg g/8a/siKt6ridSOWuRwxG1Sdd5nmWmvj8edOAY5U1+OgEWQkmnh8atKtuAYJN8CzTK8W 2posJoCzaTwhTy+n32xeLdBGoKR11Zxr0PxJ6YWdcViMn2K2UR1Mz93Mm1RHLuHIDkpN /OwERWN8S+BcnxrhkvP9WkmktNUWhfd2fudR4xwWaZaKNkNYXX3UxBTMcqpcHByTBKWr atY2UkEQnEHTU1H0QTeRl624IVJppPWcs5tAwsYosVbSGLqzRpXOU3zahtfe/aoMDlAe 2Hxg== X-Gm-Message-State: AOPr4FUUpdM8uzuV2qvGjHvr6Jw+1b1DaCDs4ZuPi2Jvb8OwxAf2YQ8sZTp4/1NiR6tElg== X-Received: by 10.98.83.65 with SMTP id h62mr24090701pfb.163.1461880406777; Thu, 28 Apr 2016 14:53:26 -0700 (PDT) Received: from ?IPv6:2620:83:8001:24::1:567? ([2620:83:8001:24::1:567]) by smtp.googlemail.com with ESMTPSA id 76sm17580196pfz.44.2016.04.28.14.53.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2016 14:53:26 -0700 (PDT) Subject: Re: netmap overrun counters To: Luigi Rizzo References: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> Cc: Navdeep Parhar , "freebsd-net@freebsd.org" From: bazzoola Message-ID: <1ea2e401-4b38-4277-a1d0-13b51e58d491@gmail.com> Date: Thu, 28 Apr 2016 14:53:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 21:53:27 -0000 Thanks Adrian, and thanks Luigi for the explanation: On 04/28/2016 01:15 PM, Luigi Rizzo wrote: > > please re-read the relevant part of the manual page: > > RECEIVE RINGS > On receive rings, after a netmap system call, the slots in the range > head... tail-1 contain received packets. User code should process them > and advance head and cur past slots it wants to return to the kernel. > cur may be moved further ahead if the user code wants to wait for more > packets without returning all the previous slots to the kernel. > > At the next NIOCRXSYNC/select()/poll(), slots up to head-1 are returned > to the kernel for further receives, and tail may advance to report new > incoming packets. > Below is an example of the evolution of an RX ring: > > after the syscall, there are some (h)eld and some (R)eceived slots > head cur tail > | | | > v v v > RX [..hhhhhhRRRRRRRR..........] > > user advances head and cur, releasing some slots and holding others > head cur tail > | | | > v v v > RX [..*****hhhRRRRRR...........] > > NICRXSYNC/poll()/select() recovers slots and reports new packets > head cur tail > | | | > v v v > RX [.......hhhRRRRRRRRRRRR....] > > > tail advances if there are new packets _and_ can at most go one > slot before head. At that point the buffer is full and the NIC > starts dropping packets until your application consumes packets, > advance​s head+cur and makes room so that the NIC can copy new > > packets to the buffers and the driver advances tail > > Basically, all I am trying to do is detect if frames are dropped in my > application using netmap API. > I am looking at https://www.freebsd.org/cgi/man.cgi?query=netmap&manpath=FreeBSD+11-current "Passing the NETMAP_DO_RX_POLL flag to NIOCREGIF updates receive rings even without read events" This means that even if I don't update cur/head pointers in my application then netmap will keep updating its rings. Is statement correct? If yes, how is this useful if tail doesn't increment. > > ​wrong model :) > netmap per se never drops packets because it does not run code. > > If your application does not read fast enough it is the NIC that > drops packets, and counts them as overrun; netmap cannot know > how many of them. I have a simple test (without NETMAP_DO_RX_POLL set), I send UDP packets with a known counter and monitor that counter in my netmap application. If there is a mismatch I know a packet was dropped. I also monitor sysctl em.0.overrun before and after I run the program and it stays 0. After around 20 seconds of of capturing frames (and storing them in memory), Swap kicks in (my program starts paging) and I detect the 1st dropped packet using my application. However, sysctl *overrun for em never reports drops. Should I look at a different stat? Thanks! B. From owner-freebsd-net@freebsd.org Thu Apr 28 22:34:02 2016 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 DE078B1D1C3 for ; Thu, 28 Apr 2016 22:34:02 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id B751B1087 for ; Thu, 28 Apr 2016 22:34:02 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 32A88D729; Thu, 28 Apr 2016 22:34:02 +0000 (UTC) Date: Thu, 28 Apr 2016 22:34:02 +0000 To: freebsd-net@freebsd.org From: "hiren (hiren panchasara)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: <31a4d8b767d029bed79956d9a34be6fb@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFcij9o= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 22:34:03 -0000 hiren accepted this revision. hiren added a comment. This revision has a positive review. I hope you'd write a bit more descriptive commit-log (not just 'what' but also 'why') for the change. Thanks a lot for your work! Cheers, Hiren INLINE COMMENTS sys/netinet/tcp_syncache.c:1507 Do you mind adding a line or two about what this function does in comments to improve readability? Thanks :-) REVISION DETAIL https://reviews.freebsd.org/D6120 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, sbruno, hiren, transport, network Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 01:14:45 2016 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 BF3EDB13CBD for ; Fri, 29 Apr 2016 01:14:45 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 96BBD17F2 for ; Fri, 29 Apr 2016 01:14:45 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id B221BCCD7; Fri, 29 Apr 2016 01:14:44 +0000 (UTC) Date: Fri, 29 Apr 2016 01:14:44 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFcitYQ= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:14:45 -0000 sepherosa_gmail.com added a comment. In https://reviews.freebsd.org/D6120#130786, @hiren wrote: > I hope you'd write a bit more descriptive commit-log (not just 'what' but also 'why') for the change. Thanks a lot for your work! OK :) REVISION DETAIL https://reviews.freebsd.org/D6120 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, sbruno, hiren, transport, network Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 01:15:17 2016 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 42CD7B13CFD for ; Fri, 29 Apr 2016 01:15:17 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 16C6618E1 for ; Fri, 29 Apr 2016 01:15:17 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id AD31ECD35; Fri, 29 Apr 2016 01:15:16 +0000 (UTC) Date: Fri, 29 Apr 2016 01:15:16 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: <70fa6a88280c2bf9f2401458b3a125d7@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFcitaQ= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:15:17 -0000 sepherosa_gmail.com added inline comments. INLINE COMMENTS sys/netinet/tcp_syncache.c:1507 OK, but as a different commit. REVISION DETAIL https://reviews.freebsd.org/D6120 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, sbruno, hiren, transport, network Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 01:19:10 2016 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 CBAABB13E2B for ; Fri, 29 Apr 2016 01:19:10 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 9BCBF1A45 for ; Fri, 29 Apr 2016 01:19:10 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id D53A6CE69; Fri, 29 Apr 2016 01:19:09 +0000 (UTC) Date: Fri, 29 Apr 2016 01:19:09 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6137+325+f015369c65104c2f@reviews.freebsd.org Subject: [Differential] D6137: tcp/lro: Refactor the free/active list operation. Message-ID: <5940e8d47a5a30d620595d7e2194e404@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D6137: tcp/lro: Refactor the free/active list operation. X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: ZDQ3OTAzM2ZhZTk0ODRmZGQwZGYxNDFlY2ZjIFcito0= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:19:10 -0000 sepherosa_gmail.com added a comment. In https://reviews.freebsd.org/D6137#130603, @gallatin wrote: > The tcp_lro_entry_get() abstraction adds an extra compare to the critical path (the compare against NULL in the function itself, in addition to the same compare in the main routine). At least it does at the C level. Have you verified that the compiler is smart enough to continue to use a single compare? > > If this adds an extra compare to the actual executed code, then I object. OK, I see your concern. I think instead of depending on the compiler, we probably just leave the original code for the free list unchanged :). REVISION DETAIL https://reviews.freebsd.org/D6137 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, transport, adrian, delphij, glebius, hselasky, np, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, gallatin, rrs Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 01:31:57 2016 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 1F081B2017F for ; Fri, 29 Apr 2016 01:31:57 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id E67991110 for ; Fri, 29 Apr 2016 01:31:56 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 83A56D561; Fri, 29 Apr 2016 01:31:56 +0000 (UTC) Date: Fri, 29 Apr 2016 01:31:56 +0000 To: freebsd-net@freebsd.org From: "lstewart (Lawrence Stewart)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: <54ec4b65e8299d6d3338fa0de4834240@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFciuYw= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:31:57 -0000 lstewart added a comment. In https://reviews.freebsd.org/D5872#130179, @sepherosa_gmail.com wrote: > We probably can leave the cwnd resetting to later rexmt timeout or possible later fast retransmit (I think fast retransmit could kick in under some cases, if ENOBUFS happened); instead of resetting the cwnd immediately upon ENOBUFS. Please leave the manipulation of cwnd as is so as to avoid conflating two different changes. The manipulation of cwnd on local drop has nothing to do with the subject of this particular change. Also, the patch we're reviewing here should be the commit candidate i.e. what will actually land in the tree. I understand that you need to test with something different than the commit candidate, but that should just be noted in the review description. We all need to see the final code as there are many subtleties here that require close attention from as many sets of eyes as possible. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Fri Apr 29 01:40:45 2016 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 28739B20389 for ; Fri, 29 Apr 2016 01:40:45 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id E6B371360 for ; Fri, 29 Apr 2016 01:40:44 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 4261CDB62; Fri, 29 Apr 2016 01:40:44 +0000 (UTC) Date: Fri, 29 Apr 2016 01:40:44 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: <61203690be93262c73401e765d755a38@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFciu5w= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:40:45 -0000 sepherosa_gmail.com added a comment. In https://reviews.freebsd.org/D5872#130805, @lstewart wrote: > In https://reviews.freebsd.org/D5872#130179, @sepherosa_gmail.com wrote: > > > We probably can leave the cwnd resetting to later rexmt timeout or possible later fast retransmit (I think fast retransmit could kick in under some cases, if ENOBUFS happened); instead of resetting the cwnd immediately upon ENOBUFS. > > > Please leave the manipulation of cwnd as is so as to avoid conflating two different changes. The manipulation of cwnd on local drop has nothing to do with the subject of this particular change. Yep, I am not going to delete the cwnd reset in this patch. > Also, the patch we're reviewing here should be the commit candidate i.e. what will actually land in the tree. I understand that you need to test with something different than the commit candidate, but that should just be noted in the review description. We all need to see the final code as there are many subtleties here that require close attention from as many sets of eyes as possible. This is what I am testing now. Since this path is not on a hot code path and we obviously don't want to have timers unset for data/FIN/SYN, can we just use the "if() panic" here? And another thing is abstract it as a macro. Maybe we just leave the macro abstraction to the next step? So, if both of following is true: - We agree to use "if() panic" here, instead of KASSERT - Do the macro abstraction in the next step Then the current patch is exactly what I want to put into the tree. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Fri Apr 29 02:02:20 2016 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 3B87DB20C0D for ; Fri, 29 Apr 2016 02:02:20 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id F1E841314 for ; Fri, 29 Apr 2016 02:02:19 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 654C2FFE9; Fri, 29 Apr 2016 02:02:19 +0000 (UTC) Date: Fri, 29 Apr 2016 02:02:19 +0000 To: freebsd-net@freebsd.org From: "lstewart (Lawrence Stewart)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFciwKs= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 02:02:20 -0000 lstewart added a comment. In https://reviews.freebsd.org/D5872#130806, @sepherosa_gmail.com wrote: > In https://reviews.freebsd.org/D5872#130805, @lstewart wrote: > > > In https://reviews.freebsd.org/D5872#130179, @sepherosa_gmail.com wrote: > > > > > We probably can leave the cwnd resetting to later rexmt timeout or possible later fast retransmit (I think fast retransmit could kick in under some cases, if ENOBUFS happened); instead of resetting the cwnd immediately upon ENOBUFS. > > > > > > Please leave the manipulation of cwnd as is so as to avoid conflating two different changes. The manipulation of cwnd on local drop has nothing to do with the subject of this particular change. > > > Yep, I am not going to delete the cwnd reset in this patch. errr, not sure if we're on the same page or not, but I am in strong agreement with Mike. Please leave the line "tp->snd_cwnd = tp->t_maxseg;" where it is and untouched i.e. don't delete or change it. >> Also, the patch we're reviewing here should be the commit candidate i.e. what will actually land in the tree. I understand that you need to test with something different than the commit candidate, but that should just be noted in the review description. We all need to see the final code as there are many subtleties here that require close attention from as many sets of eyes as possible. > > This is what I am testing now. Since this path is not on a hot code path and we obviously don't want to have timers unset for data/FIN/SYN, can we just use the "if() panic" here? No. This isn't a condition we should bring the whole machine down for. A rate limited log message would be appropriate so the admin knows there's a potential for hung connections, but I don't insist on this. > And another thing is abstract it as a macro. Maybe we just leave the macro abstraction to the next step? I don't see any good reason not to define and use the macro as part of this patch. It can then be used in follow up commits to check the other return points from the input and output processing paths. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Fri Apr 29 02:13:35 2016 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 6521FB20E2E for ; Fri, 29 Apr 2016 02:13:35 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 28C051967 for ; Fri, 29 Apr 2016 02:13:35 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 484D1C596; Fri, 29 Apr 2016 02:13:34 +0000 (UTC) Date: Fri, 29 Apr 2016 02:13:34 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D5872+325+9dea0574509cdbb3@reviews.freebsd.org Subject: [Differential] D5872: tcp: Don't prematurely drop receiving-only connections Message-ID: <2d1649184092ad858bee619e2631255b@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5872: tcp: Don't prematurely drop receiving-only connections X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: MmVmNzYzNzljOGQxMmM4MWI4MmNjYzcxMzczIFciw04= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 02:13:35 -0000 sepherosa_gmail.com added a comment. In https://reviews.freebsd.org/D5872#130813, @lstewart wrote: > In https://reviews.freebsd.org/D5872#130806, @sepherosa_gmail.com wrote: > > > In https://reviews.freebsd.org/D5872#130805, @lstewart wrote: > > > > > In https://reviews.freebsd.org/D5872#130179, @sepherosa_gmail.com wrote: > > > > > > > We probably can leave the cwnd resetting to later rexmt timeout or possible later fast retransmit (I think fast retransmit could kick in under some cases, if ENOBUFS happened); instead of resetting the cwnd immediately upon ENOBUFS. > > > > > > > > > Please leave the manipulation of cwnd as is so as to avoid conflating two different changes. The manipulation of cwnd on local drop has nothing to do with the subject of this particular change. > > > > > > Yep, I am not going to delete the cwnd reset in this patch. > > > errr, not sure if we're on the same page or not, but I am in strong agreement with Mike. Please leave the line "tp->snd_cwnd = tp->t_maxseg;" where it is and untouched i.e. don't delete or change it. > > >> Also, the patch we're reviewing here should be the commit candidate i.e. what will actually land in the tree. I understand that you need to test with something different than the commit candidate, but that should just be noted in the review description. We all need to see the final code as there are many subtleties here that require close attention from as many sets of eyes as possible. > > > > This is what I am testing now. Since this path is not on a hot code path and we obviously don't want to have timers unset for data/FIN/SYN, can we just use the "if() panic" here? > > No. This isn't a condition we should bring the whole machine down for. A rate limited log message would be appropriate so the admin knows there's a potential for hung connections, but I don't insist on this. > > > And another thing is abstract it as a macro. Maybe we just leave the macro abstraction to the next step? > > I don't see any good reason not to define and use the macro as part of this patch. It can then be used in follow up commits to check the other return points from the input and output processing paths. OK, I see, then I will post a new patch then, but after finishing testing the current one (as I said, I need to use non-INVARIANT kernel to trigger it). Thanks for the clarification. REVISION DETAIL https://reviews.freebsd.org/D5872 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, glebius, adrian, delphij, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, freebsd-net-list, lstewart, hiren, jtl, transport Cc: gnn, mike-karels.net, jtl From owner-freebsd-net@freebsd.org Fri Apr 29 02:29:19 2016 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 6139EB20F90 for ; Fri, 29 Apr 2016 02:29:19 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 2D53C1E97 for ; Fri, 29 Apr 2016 02:29:19 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 36BE4CC2C; Fri, 29 Apr 2016 02:29:18 +0000 (UTC) Date: Fri, 29 Apr 2016 02:29:18 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6137+325+f015369c65104c2f@reviews.freebsd.org Subject: [Differential] D6137: tcp/lro: Refactor the free/active list operation. Message-ID: <0d1539496ddac671f15754fca9887381@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , Thread-Topic: D6137: tcp/lro: Refactor the free/active list operation. X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: ZDQ3OTAzM2ZhZTk0ODRmZGQwZGYxNDFlY2ZjIFcixv4= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_0d1539496ddac671f15754fca9887381" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 02:29:19 -0000 --b1_0d1539496ddac671f15754fca9887381 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit sepherosa_gmail.com updated this revision to Diff 15725. sepherosa_gmail.com added a comment. Skip the free list operation, which may introduce extra cmp on hot code path CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D6137?vs=15684&id=15725 REVISION DETAIL https://reviews.freebsd.org/D6137 AFFECTED FILES sys/netinet/tcp_lro.c CHANGE DETAILS diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -69,6 +69,20 @@ static void tcp_lro_rx_done(struct lro_ctrl *lc); +static __inline void +tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_entry *le) +{ + + LIST_INSERT_HEAD(&lc->lro_active, le, next); +} + +static __inline void +tcp_lro_active_remove(struct lro_entry *le) +{ + + LIST_REMOVE(le, next); +} + int tcp_lro_init(struct lro_ctrl *lc) { @@ -129,7 +143,7 @@ /* free active mbufs, if any */ while ((le = LIST_FIRST(&lc->lro_active)) != NULL) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); m_freem(le->m_head); } @@ -234,7 +248,7 @@ struct lro_entry *le; while ((le = LIST_FIRST(&lc->lro_active)) != NULL) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } } @@ -252,7 +266,7 @@ timevalsub(&tv, timeout); LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { if (timevalcmp(&tv, &le->mtime, >=)) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } } @@ -620,16 +634,16 @@ /* Flush now if appending will result in overflow. */ if (le->p_len > (lc->lro_length_lim - tcp_data_len)) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); break; } /* Try to append the new segment. */ if (__predict_false(seq != le->next_seq || (tcp_data_len == 0 && le->ack_seq == th->th_ack))) { /* Out of order packet or duplicate ACK. */ - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); return (TCP_LRO_CANNOT); } @@ -662,7 +676,7 @@ * be further delayed. */ if (le->append_cnt >= lc->lro_ackcnt_lim) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } return (0); @@ -686,7 +700,7 @@ * overflow, pro-actively flush now. */ if (le->p_len > (lc->lro_length_lim - lc->ifp->if_mtu)) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } else getmicrotime(&le->mtime); @@ -701,7 +715,7 @@ /* Start a new segment chain. */ le = LIST_FIRST(&lc->lro_free); LIST_REMOVE(le, next); - LIST_INSERT_HEAD(&lc->lro_active, le, next); + tcp_lro_active_insert(lc, le); getmicrotime(&le->mtime); /* Start filling in details. */ EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, adrian, delphij, glebius, hselasky, np, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, transport, rrs, gallatin Cc: freebsd-net-list --b1_0d1539496ddac671f15754fca9887381 Content-Type: text/x-patch; charset=utf-8; name="D6137.15725.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D6137.15725.patch" ZGlmZiAtLWdpdCBhL3N5cy9uZXRpbmV0L3RjcF9scm8uYyBiL3N5cy9uZXRpbmV0L3RjcF9scm8u YwotLS0gYS9zeXMvbmV0aW5ldC90Y3BfbHJvLmMKKysrIGIvc3lzL25ldGluZXQvdGNwX2xyby5j CkBAIC02OSw2ICs2OSwyMCBAQAogCiBzdGF0aWMgdm9pZAl0Y3BfbHJvX3J4X2RvbmUoc3RydWN0 IGxyb19jdHJsICpsYyk7CiAKK3N0YXRpYyBfX2lubGluZSB2b2lkCit0Y3BfbHJvX2FjdGl2ZV9p bnNlcnQoc3RydWN0IGxyb19jdHJsICpsYywgc3RydWN0IGxyb19lbnRyeSAqbGUpCit7CisKKwlM SVNUX0lOU0VSVF9IRUFEKCZsYy0+bHJvX2FjdGl2ZSwgbGUsIG5leHQpOworfQorCitzdGF0aWMg X19pbmxpbmUgdm9pZAordGNwX2xyb19hY3RpdmVfcmVtb3ZlKHN0cnVjdCBscm9fZW50cnkgKmxl KQoreworCisJTElTVF9SRU1PVkUobGUsIG5leHQpOworfQorCiBpbnQKIHRjcF9scm9faW5pdChz dHJ1Y3QgbHJvX2N0cmwgKmxjKQogewpAQCAtMTI5LDcgKzE0Myw3IEBACiAKIAkvKiBmcmVlIGFj dGl2ZSBtYnVmcywgaWYgYW55ICovCiAJd2hpbGUgKChsZSA9IExJU1RfRklSU1QoJmxjLT5scm9f YWN0aXZlKSkgIT0gTlVMTCkgewotCQlMSVNUX1JFTU9WRShsZSwgbmV4dCk7CisJCXRjcF9scm9f YWN0aXZlX3JlbW92ZShsZSk7CiAJCW1fZnJlZW0obGUtPm1faGVhZCk7CiAJfQogCkBAIC0yMzQs NyArMjQ4LDcgQEAKIAlzdHJ1Y3QgbHJvX2VudHJ5ICpsZTsKIAogCXdoaWxlICgobGUgPSBMSVNU X0ZJUlNUKCZsYy0+bHJvX2FjdGl2ZSkpICE9IE5VTEwpIHsKLQkJTElTVF9SRU1PVkUobGUsIG5l eHQpOworCQl0Y3BfbHJvX2FjdGl2ZV9yZW1vdmUobGUpOwogCQl0Y3BfbHJvX2ZsdXNoKGxjLCBs ZSk7CiAJfQogfQpAQCAtMjUyLDcgKzI2Niw3IEBACiAJdGltZXZhbHN1YigmdHYsIHRpbWVvdXQp OwogCUxJU1RfRk9SRUFDSF9TQUZFKGxlLCAmbGMtPmxyb19hY3RpdmUsIG5leHQsIGxlX3RtcCkg ewogCQlpZiAodGltZXZhbGNtcCgmdHYsICZsZS0+bXRpbWUsID49KSkgewotCQkJTElTVF9SRU1P VkUobGUsIG5leHQpOworCQkJdGNwX2xyb19hY3RpdmVfcmVtb3ZlKGxlKTsKIAkJCXRjcF9scm9f Zmx1c2gobGMsIGxlKTsKIAkJfQogCX0KQEAgLTYyMCwxNiArNjM0LDE2IEBACiAKIAkJLyogRmx1 c2ggbm93IGlmIGFwcGVuZGluZyB3aWxsIHJlc3VsdCBpbiBvdmVyZmxvdy4gKi8KIAkJaWYgKGxl LT5wX2xlbiA+IChsYy0+bHJvX2xlbmd0aF9saW0gLSB0Y3BfZGF0YV9sZW4pKSB7Ci0JCQlMSVNU X1JFTU9WRShsZSwgbmV4dCk7CisJCQl0Y3BfbHJvX2FjdGl2ZV9yZW1vdmUobGUpOwogCQkJdGNw X2xyb19mbHVzaChsYywgbGUpOwogCQkJYnJlYWs7CiAJCX0KIAogCQkvKiBUcnkgdG8gYXBwZW5k IHRoZSBuZXcgc2VnbWVudC4gKi8KIAkJaWYgKF9fcHJlZGljdF9mYWxzZShzZXEgIT0gbGUtPm5l eHRfc2VxIHx8CiAJCSAgICAodGNwX2RhdGFfbGVuID09IDAgJiYgbGUtPmFja19zZXEgPT0gdGgt PnRoX2FjaykpKSB7CiAJCQkvKiBPdXQgb2Ygb3JkZXIgcGFja2V0IG9yIGR1cGxpY2F0ZSBBQ0su ICovCi0JCQlMSVNUX1JFTU9WRShsZSwgbmV4dCk7CisJCQl0Y3BfbHJvX2FjdGl2ZV9yZW1vdmUo bGUpOwogCQkJdGNwX2xyb19mbHVzaChsYywgbGUpOwogCQkJcmV0dXJuIChUQ1BfTFJPX0NBTk5P VCk7CiAJCX0KQEAgLTY2Miw3ICs2NzYsNyBAQAogCQkJICogYmUgZnVydGhlciBkZWxheWVkLgog CQkJICovCiAJCQlpZiAobGUtPmFwcGVuZF9jbnQgPj0gbGMtPmxyb19hY2tjbnRfbGltKSB7Ci0J CQkJTElTVF9SRU1PVkUobGUsIG5leHQpOworCQkJCXRjcF9scm9fYWN0aXZlX3JlbW92ZShsZSk7 CiAJCQkJdGNwX2xyb19mbHVzaChsYywgbGUpOwogCQkJfQogCQkJcmV0dXJuICgwKTsKQEAgLTY4 Niw3ICs3MDAsNyBAQAogCQkgKiBvdmVyZmxvdywgcHJvLWFjdGl2ZWx5IGZsdXNoIG5vdy4KIAkJ ICovCiAJCWlmIChsZS0+cF9sZW4gPiAobGMtPmxyb19sZW5ndGhfbGltIC0gbGMtPmlmcC0+aWZf bXR1KSkgewotCQkJTElTVF9SRU1PVkUobGUsIG5leHQpOworCQkJdGNwX2xyb19hY3RpdmVfcmVt b3ZlKGxlKTsKIAkJCXRjcF9scm9fZmx1c2gobGMsIGxlKTsKIAkJfSBlbHNlCiAJCQlnZXRtaWNy b3RpbWUoJmxlLT5tdGltZSk7CkBAIC03MDEsNyArNzE1LDcgQEAKIAkvKiBTdGFydCBhIG5ldyBz ZWdtZW50IGNoYWluLiAqLwogCWxlID0gTElTVF9GSVJTVCgmbGMtPmxyb19mcmVlKTsKIAlMSVNU X1JFTU9WRShsZSwgbmV4dCk7Ci0JTElTVF9JTlNFUlRfSEVBRCgmbGMtPmxyb19hY3RpdmUsIGxl LCBuZXh0KTsKKwl0Y3BfbHJvX2FjdGl2ZV9pbnNlcnQobGMsIGxlKTsKIAlnZXRtaWNyb3RpbWUo JmxlLT5tdGltZSk7CiAKIAkvKiBTdGFydCBmaWxsaW5nIGluIGRldGFpbHMuICovCgo= --b1_0d1539496ddac671f15754fca9887381-- From owner-freebsd-net@freebsd.org Fri Apr 29 02:34:40 2016 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 4BE88B200CE for ; Fri, 29 Apr 2016 02:34:40 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 18E9311BC for ; Fri, 29 Apr 2016 02:34:40 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 137F3CE63; Fri, 29 Apr 2016 02:34:39 +0000 (UTC) Date: Fri, 29 Apr 2016 02:34:39 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: <4d454d13373f272a9e39c621cf9e1190@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFciyD8= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 02:34:40 -0000 sepherosa_gmail.com updated the summary for this revision. REVISION DETAIL https://reviews.freebsd.org/D6120 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, network, transport, hiren, sbruno Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 03:32:06 2016 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 A4900B20F19 for ; Fri, 29 Apr 2016 03:32:06 +0000 (UTC) (envelope-from arvorebemgrande@gmail.com) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (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 6FC5B13C0 for ; Fri, 29 Apr 2016 03:32:06 +0000 (UTC) (envelope-from arvorebemgrande@gmail.com) Received: by mail-oi0-x229.google.com with SMTP id x201so105819622oif.3 for ; Thu, 28 Apr 2016 20:32:06 -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; bh=FPEu+zRsMvPL6app10lV6wR6baeQCL5GVWKRs39K8wk=; b=kw5s5n1jrNRZzo7mNvtxzpRqfgKgm2TMCc00HQUbAJgE5oyMmuWXV6lP8DJBF11GgO aO94rRoGeDk+K8V3PSfvZ85/7arDb15WbDxle9ox1bIKFt4GCMkpefABbr1e69sig4Wu WYgIUdWYHWEiRVxa6pmhzZj4QN+5fd0EED4g6uRFmPN6jHiEZDdTR/PdTgtYVhW8xZD5 KaS9NzuJJymr7DyM77Fashqv39Mzoy88tfaaVskK6PYw+NPZV0bSweZiB9iJQSHAtXz5 KKlWRkcZK9YftdlrMgcS0sDaiy+1ESeA7IwaqfsLaigQtQJGPZ1ZC8pR65DedeDB7jHN TgaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=FPEu+zRsMvPL6app10lV6wR6baeQCL5GVWKRs39K8wk=; b=QIbguXnROCkvrnhqncvE945N1cBRWj26MDLREKKqWj7GwjMbvOUL/S/vb3isP08YYM omFyR6eZfNr7I5sFsaziSI0fNsb/SgbgUQzaBqS8lZ1wJXvWDTyhPMUIT0JwASlQTVc4 fufWbN8WRZw257FCulKqLBW667mBqAk64OTsd4Drq+QWsGpy7GdqBC7R5T1AAju34xid T8WjRhBgmOFWbWce1WDElcRyv3r0MC+fyceqLJr3eoBqqAlNpHaql+qveh9310/+5qWo d7S3q1SmVsp2QiV9MhvGFX+pcndydl/U0zI+Ayix19eVrC2Du0sIuOA0nN/3dZ/VOEUI EbKA== X-Gm-Message-State: AOPr4FXr/zTsaxYWF1qY+woVzrBc9O7jra+xzk00CFUn7YFGcoFOYHTHEDLqJCjkCARYw3MzYLf73Dy2YITbYg== MIME-Version: 1.0 X-Received: by 10.202.89.68 with SMTP id n65mr7574616oib.138.1461900725726; Thu, 28 Apr 2016 20:32:05 -0700 (PDT) Received: by 10.202.72.12 with HTTP; Thu, 28 Apr 2016 20:32:05 -0700 (PDT) In-Reply-To: References: Date: Fri, 29 Apr 2016 00:32:05 -0300 Message-ID: Subject: Re: Working divert socket example prog? From: lpa lpa To: Nikolay Denev Cc: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 03:32:06 -0000 On Thu, Apr 28, 2016 at 4:06 PM, Nikolay Denev wrote: > Hi, > > Have you looked at the natd(8) source code? > yes but it's a complete application, it does a lot of stuff and I am not able to "clean" it up to become a simple divert application which reinjects packet so I can measure something. I was not able, so far, to make the mentioned divert-loop work, not breaking natd is a much longer step to a non programmer > > > --Nikolay > > On Thu, Apr 28, 2016 at 7:21 AM, lpa lpa > wrote: > > Do anyone have a working example code of a divert loop program? > > > > I tried building this one[1] but it seems to be for FreeBSD 5 and won't > > build on latest system. I want to make simple measurement of pps rate > for a > > packet traveling inside a divert socket and getting reinjected back whi= le > > printing some logs. > > > > However I am not a coder :( > > > > Thank you. > > > > [1]https://github.com/DianeRay/divert-loop/tree/master/divert-loop > > > > -- > > Mais que uma ONG. > > Uma convic=C3=A7=C3=A3o. > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > --=20 Mais que uma ONG. Uma convic=C3=A7=C3=A3o. From owner-freebsd-net@freebsd.org Fri Apr 29 07:04:13 2016 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 5ADCBB20294 for ; Fri, 29 Apr 2016 07:04:13 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id D27191A34; Fri, 29 Apr 2016 07:04:12 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 880837300A; Fri, 29 Apr 2016 09:09:35 +0200 (CEST) Date: Fri, 29 Apr 2016 09:09:35 +0200 From: Luigi Rizzo To: bazzoola Cc: "freebsd-net@freebsd.org" , Navdeep Parhar Subject: Re: netmap overrun counters Message-ID: <20160429070935.GB18860@onelab2.iet.unipi.it> References: <9fd88731-2cdf-a6da-4b4e-f97bb120696a@FreeBSD.org> <863506de-870e-0da4-81d3-6ab537feaa2b@gmail.com> <1ea2e401-4b38-4277-a1d0-13b51e58d491@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ea2e401-4b38-4277-a1d0-13b51e58d491@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 07:04:13 -0000 On Thu, Apr 28, 2016 at 02:53:25PM -0700, bazzoola wrote: > Thanks Adrian, and thanks Luigi for the explanation: > > On 04/28/2016 01:15 PM, Luigi Rizzo wrote: > > > > please re-read the relevant part of the manual page: > > > > RECEIVE RINGS > > On receive rings, after a netmap system call, the slots in the range > > head... tail-1 contain received packets. User code should process them > > and advance head and cur past slots it wants to return to the kernel. > > cur may be moved further ahead if the user code wants to wait for more > > packets without returning all the previous slots to the kernel. > > > > At the next NIOCRXSYNC/select()/poll(), slots up to head-1 are returned > > to the kernel for further receives, and tail may advance to report new > > incoming packets. > > Below is an example of the evolution of an RX ring: > > > > after the syscall, there are some (h)eld and some (R)eceived slots > > head cur tail > > | | | > > v v v > > RX [..hhhhhhRRRRRRRR..........] > > > > user advances head and cur, releasing some slots and holding others > > head cur tail > > | | | > > v v v > > RX [..*****hhhRRRRRR...........] > > > > NICRXSYNC/poll()/select() recovers slots and reports new packets > > head cur tail > > | | | > > v v v > > RX [.......hhhRRRRRRRRRRRR....] > > > > > > tail advances if there are new packets _and_ can at most go one > > slot before head. At that point the buffer is full and the NIC > > starts dropping packets until your application consumes packets, > > advance???s head+cur and makes room so that the NIC can copy new > > > > packets to the buffers and the driver advances tail > > > > Basically, all I am trying to do is detect if frames are dropped in my > > application using netmap API. > > > > I am looking at > https://www.freebsd.org/cgi/man.cgi?query=netmap&manpath=FreeBSD+11-current > > "Passing the NETMAP_DO_RX_POLL flag to NIOCREGIF updates receive rings > even without read events" > > This means that even if I don't update cur/head pointers in my > application then netmap will keep updating its rings. Is statement > correct? If yes, how is this useful if tail doesn't increment. your interpretation is not correct. Update the ring means that tai advances only up to the available space. If you don't update head/cur, then when the ring is full tail will stop there and the NIC will start dropping packets. > > > > > ???wrong model :) > > netmap per se never drops packets because it does not run code. > > > > If your application does not read fast enough it is the NIC that > > drops packets, and counts them as overrun; netmap cannot know > > how many of them. > > I have a simple test (without NETMAP_DO_RX_POLL set), I send UDP packets > with a known counter and monitor that counter in my netmap application. > If there is a mismatch I know a packet was dropped. > > I also monitor sysctl em.0.overrun before and after I run the program > and it stays 0. > > After around 20 seconds of of capturing frames (and storing them in > memory), Swap kicks in (my program starts paging) and I detect the 1st > dropped packet using my application. However, sysctl *overrun for em > never reports drops. Should I look at a different stat? I have no idea. This is NIC specific, there may be other stats that report the queue overflows. cheers luigi From owner-freebsd-net@freebsd.org Fri Apr 29 07:07:50 2016 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 2D14DB2033E for ; Fri, 29 Apr 2016 07:07:50 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 04FB01C88 for ; Fri, 29 Apr 2016 07:07:50 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 6E831FC3B; Fri, 29 Apr 2016 07:07:49 +0000 (UTC) Date: Fri, 29 Apr 2016 07:07:49 +0000 To: freebsd-net@freebsd.org From: "hselasky (Hans Petter Selasky)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: <3825973b7dc90602a87d6fb26b06b4c6@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFcjCEU= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 07:07:50 -0000 hselasky added a comment. Basically what you're doing is to loop back the flowid of the received packet - right? Maybe you could put that in a code comment. REVISION DETAIL https://reviews.freebsd.org/D6120 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, network, transport, hiren, sbruno Cc: hselasky, freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 07:16:01 2016 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 04BD6B20800 for ; Fri, 29 Apr 2016 07:16:01 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id D27C5119F for ; Fri, 29 Apr 2016 07:16:00 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 5C929C1E1; Fri, 29 Apr 2016 07:16:00 +0000 (UTC) Date: Fri, 29 Apr 2016 07:16:00 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: <457ae8dced7bb8dea5c47060a0467261@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFcjCjA= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 07:16:01 -0000 sepherosa_gmail.com added a comment. In https://reviews.freebsd.org/D6120#130844, @hselasky wrote: > Basically what you're doing is to loop back the flowid of the received packet - right? > > Maybe you could put that in a code comment. Yep, since we don't have inp to loopback the SYN's flowid here. So we use the SYN's flowid directly. OK, will add. REVISION DETAIL https://reviews.freebsd.org/D6120 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, network, transport, hiren, sbruno Cc: hselasky, freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 07:23:16 2016 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 0FC7EB20B70 for ; Fri, 29 Apr 2016 07:23:16 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id A1B6F1793 for ; Fri, 29 Apr 2016 07:23:15 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id E822DC5B0; Fri, 29 Apr 2016 07:23:14 +0000 (UTC) Date: Fri, 29 Apr 2016 07:23:14 +0000 To: freebsd-net@freebsd.org From: Phabricator Reply-to: D6120+325+33302b570a7b2b08@reviews.freebsd.org Subject: [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK Message-ID: <30d67e8c5c0bbc71659390a3ee2427fa@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , Thread-Topic: D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: NTJkNjUzMTU2YzllZDgwNGVmODYwN2NiNWY3IFcjC+I= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_30d67e8c5c0bbc71659390a3ee2427fa" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 07:23:16 -0000 --b1_30d67e8c5c0bbc71659390a3ee2427fa Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit This revision was automatically updated to reflect the committed changes. Closed by commit rS298769: tcp/syncache: Set flowid and hash type properly for SYN|ACK (authored by sephe). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D6120?vs=15647&id=15727#toc REPOSITORY rS FreeBSD src repository CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D6120?vs=15647&id=15727 REVISION DETAIL https://reviews.freebsd.org/D6120 AFFECTED FILES head/sys/netinet/tcp_syncache.c CHANGE DETAILS diff --git a/head/sys/netinet/tcp_syncache.c b/head/sys/netinet/tcp_syncache.c --- a/head/sys/netinet/tcp_syncache.c +++ b/head/sys/netinet/tcp_syncache.c @@ -127,7 +127,8 @@ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *, struct syncache_head *, int); +static int syncache_respond(struct syncache *, struct syncache_head *, int, + const struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -457,7 +458,7 @@ free(s, M_TCPLOG); } - syncache_respond(sc, sch, 1); + syncache_respond(sc, sch, 1, NULL); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -1307,7 +1308,7 @@ s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc, sch, 1) == 0) { + if (syncache_respond(sc, sch, 1, m) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1474,7 +1475,7 @@ /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc, sch, 0) == 0) { + if (syncache_respond(sc, sch, 0, m) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1505,7 +1506,8 @@ } static int -syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked) +syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked, + const struct mbuf *m0) { struct ip *ip = NULL; struct mbuf *m; @@ -1686,6 +1688,10 @@ M_SETFIB(m, sc->sc_inc.inc_fibnum); m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) { + m->m_pkthdr.flowid = m0->m_pkthdr.flowid; + M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); + } #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, network, transport, hiren, sbruno Cc: hselasky, freebsd-net-list --b1_30d67e8c5c0bbc71659390a3ee2427fa Content-Type: text/x-patch; charset=utf-8; name="D6120.15727.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D6120.15727.patch" ZGlmZiAtLWdpdCBhL2hlYWQvc3lzL25ldGluZXQvdGNwX3N5bmNhY2hlLmMgYi9oZWFkL3N5cy9u ZXRpbmV0L3RjcF9zeW5jYWNoZS5jCi0tLSBhL2hlYWQvc3lzL25ldGluZXQvdGNwX3N5bmNhY2hl LmMKKysrIGIvaGVhZC9zeXMvbmV0aW5ldC90Y3Bfc3luY2FjaGUuYwpAQCAtMTI3LDcgKzEyNyw4 IEBACiBzdGF0aWMgdm9pZAkgc3luY2FjaGVfZHJvcChzdHJ1Y3Qgc3luY2FjaGUgKiwgc3RydWN0 IHN5bmNhY2hlX2hlYWQgKik7CiBzdGF0aWMgdm9pZAkgc3luY2FjaGVfZnJlZShzdHJ1Y3Qgc3lu Y2FjaGUgKik7CiBzdGF0aWMgdm9pZAkgc3luY2FjaGVfaW5zZXJ0KHN0cnVjdCBzeW5jYWNoZSAq LCBzdHJ1Y3Qgc3luY2FjaGVfaGVhZCAqKTsKLXN0YXRpYyBpbnQJIHN5bmNhY2hlX3Jlc3BvbmQo c3RydWN0IHN5bmNhY2hlICosIHN0cnVjdCBzeW5jYWNoZV9oZWFkICosIGludCk7CitzdGF0aWMg aW50CSBzeW5jYWNoZV9yZXNwb25kKHN0cnVjdCBzeW5jYWNoZSAqLCBzdHJ1Y3Qgc3luY2FjaGVf aGVhZCAqLCBpbnQsCisJCSAgICBjb25zdCBzdHJ1Y3QgbWJ1ZiAqKTsKIHN0YXRpYyBzdHJ1Y3QJ IHNvY2tldCAqc3luY2FjaGVfc29ja2V0KHN0cnVjdCBzeW5jYWNoZSAqLCBzdHJ1Y3Qgc29ja2V0 ICosCiAJCSAgICBzdHJ1Y3QgbWJ1ZiAqbSk7CiBzdGF0aWMgdm9pZAkgc3luY2FjaGVfdGltZW91 dChzdHJ1Y3Qgc3luY2FjaGUgKnNjLCBzdHJ1Y3Qgc3luY2FjaGVfaGVhZCAqc2NoLApAQCAtNDU3 LDcgKzQ1OCw3IEBACiAJCQlmcmVlKHMsIE1fVENQTE9HKTsKIAkJfQogCi0JCXN5bmNhY2hlX3Jl c3BvbmQoc2MsIHNjaCwgMSk7CisJCXN5bmNhY2hlX3Jlc3BvbmQoc2MsIHNjaCwgMSwgTlVMTCk7 CiAJCVRDUFNUQVRfSU5DKHRjcHNfc2NfcmV0cmFuc21pdHRlZCk7CiAJCXN5bmNhY2hlX3RpbWVv dXQoc2MsIHNjaCwgMCk7CiAJfQpAQCAtMTMwNyw3ICsxMzA4LDcgQEAKIAkJCSAgICBzLCBfX2Z1 bmNfXyk7CiAJCQlmcmVlKHMsIE1fVENQTE9HKTsKIAkJfQotCQlpZiAoc3luY2FjaGVfcmVzcG9u ZChzYywgc2NoLCAxKSA9PSAwKSB7CisJCWlmIChzeW5jYWNoZV9yZXNwb25kKHNjLCBzY2gsIDEs IG0pID09IDApIHsKIAkJCXNjLT5zY19yeG1pdHMgPSAwOwogCQkJc3luY2FjaGVfdGltZW91dChz Yywgc2NoLCAxKTsKIAkJCVRDUFNUQVRfSU5DKHRjcHNfc25kYWNrcyk7CkBAIC0xNDc0LDcgKzE0 NzUsNyBAQAogCS8qCiAJICogRG8gYSBzdGFuZGFyZCAzLXdheSBoYW5kc2hha2UuCiAJICovCi0J aWYgKHN5bmNhY2hlX3Jlc3BvbmQoc2MsIHNjaCwgMCkgPT0gMCkgeworCWlmIChzeW5jYWNoZV9y ZXNwb25kKHNjLCBzY2gsIDAsIG0pID09IDApIHsKIAkJaWYgKFZfdGNwX3N5bmNvb2tpZXMgJiYg Vl90Y3Bfc3luY29va2llc29ubHkgJiYgc2MgIT0gJnNjcykKIAkJCXN5bmNhY2hlX2ZyZWUoc2Mp OwogCQllbHNlIGlmIChzYyAhPSAmc2NzKQpAQCAtMTUwNSw3ICsxNTA2LDggQEAKIH0KIAogc3Rh dGljIGludAotc3luY2FjaGVfcmVzcG9uZChzdHJ1Y3Qgc3luY2FjaGUgKnNjLCBzdHJ1Y3Qgc3lu Y2FjaGVfaGVhZCAqc2NoLCBpbnQgbG9ja2VkKQorc3luY2FjaGVfcmVzcG9uZChzdHJ1Y3Qgc3lu Y2FjaGUgKnNjLCBzdHJ1Y3Qgc3luY2FjaGVfaGVhZCAqc2NoLCBpbnQgbG9ja2VkLAorICAgIGNv bnN0IHN0cnVjdCBtYnVmICptMCkKIHsKIAlzdHJ1Y3QgaXAgKmlwID0gTlVMTDsKIAlzdHJ1Y3Qg bWJ1ZiAqbTsKQEAgLTE2ODYsNiArMTY4OCwxMCBAQAogCiAJTV9TRVRGSUIobSwgc2MtPnNjX2lu Yy5pbmNfZmlibnVtKTsKIAltLT5tX3BrdGhkci5jc3VtX2RhdGEgPSBvZmZzZXRvZihzdHJ1Y3Qg dGNwaGRyLCB0aF9zdW0pOworCWlmIChtMCAhPSBOVUxMICYmIE1fSEFTSFRZUEVfR0VUKG0wKSAh PSBNX0hBU0hUWVBFX05PTkUpIHsKKwkJbS0+bV9wa3RoZHIuZmxvd2lkID0gbTAtPm1fcGt0aGRy LmZsb3dpZDsKKwkJTV9IQVNIVFlQRV9TRVQobSwgTV9IQVNIVFlQRV9HRVQobTApKTsKKwl9CiAj aWZkZWYgSU5FVDYKIAlpZiAoc2MtPnNjX2luYy5pbmNfZmxhZ3MgJiBJTkNfSVNJUFY2KSB7CiAJ CW0tPm1fcGt0aGRyLmNzdW1fZmxhZ3MgPSBDU1VNX1RDUF9JUFY2OwoK --b1_30d67e8c5c0bbc71659390a3ee2427fa-- From owner-freebsd-net@freebsd.org Fri Apr 29 07:34:42 2016 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 8F0E7B20E4F for ; Fri, 29 Apr 2016 07:34:42 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5CA1FAD for ; Fri, 29 Apr 2016 07:34:42 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 703B2CB5B; Fri, 29 Apr 2016 07:34:41 +0000 (UTC) Date: Fri, 29 Apr 2016 07:34:41 +0000 To: freebsd-net@freebsd.org From: "sepherosa_gmail.com (Sepherosa Ziehau)" Reply-to: D6148+325+ea9e78ec8d498ebd@reviews.freebsd.org Subject: [Differential] D6148: tcp/syncache: Add comment for syncache_respond Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , Thread-Topic: D6148: tcp/syncache: Add comment for syncache_respond X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk Thread-Index: Y2FkNGI5OTYzNDYzYzgyNmZmMTk0MGY3OGYw MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_f358da633abeff90a6b0b3f25af87427" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 07:34:42 -0000 --b1_f358da633abeff90a6b0b3f25af87427 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit sepherosa_gmail.com created this revision. sepherosa_gmail.com added reviewers: network, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, hiren, sbruno, hselasky. sepherosa_gmail.com added a subscriber: freebsd-net-list. Herald added a reviewer: transport. REVISION SUMMARY Suggested by: hiren, hps REVISION DETAIL https://reviews.freebsd.org/D6148 AFFECTED FILES sys/netinet/tcp_syncache.c CHANGE DETAILS diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1505,6 +1505,10 @@ return (rv); } +/* + * Send SYN|ACK to the peer. Either in response to the peer's SYN, + * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL. + */ static int syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked, const struct mbuf *m0) @@ -1688,6 +1692,11 @@ M_SETFIB(m, sc->sc_inc.inc_fibnum); m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + /* + * If we have peer's SYN and it has a flowid, then let's assign it to + * our SYN|ACK. ip6_output() and ip_output() will not assign flowid + * to SYN|ACK due to lack of inp here. + */ if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) { m->m_pkthdr.flowid = m0->m_pkthdr.flowid; M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, transport, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, hiren, sbruno, hselasky Cc: freebsd-net-list --b1_f358da633abeff90a6b0b3f25af87427 Content-Type: text/x-patch; charset=utf-8; name="D6148.15728.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D6148.15728.patch" ZGlmZiAtLWdpdCBhL3N5cy9uZXRpbmV0L3RjcF9zeW5jYWNoZS5jIGIvc3lzL25ldGluZXQvdGNw X3N5bmNhY2hlLmMKLS0tIGEvc3lzL25ldGluZXQvdGNwX3N5bmNhY2hlLmMKKysrIGIvc3lzL25l dGluZXQvdGNwX3N5bmNhY2hlLmMKQEAgLTE1MDUsNiArMTUwNSwxMCBAQAogCXJldHVybiAocnYp OwogfQogCisvKgorICogU2VuZCBTWU58QUNLIHRvIHRoZSBwZWVyLiAgRWl0aGVyIGluIHJlc3Bv bnNlIHRvIHRoZSBwZWVyJ3MgU1lOLAorICogaS5lLiBtMCAhPSBOVUxMLCBvciB1cG9uIDNXSFMg QUNLIHRpbWVvdXQsIGkuZS4gbTAgPT0gTlVMTC4KKyAqLwogc3RhdGljIGludAogc3luY2FjaGVf cmVzcG9uZChzdHJ1Y3Qgc3luY2FjaGUgKnNjLCBzdHJ1Y3Qgc3luY2FjaGVfaGVhZCAqc2NoLCBp bnQgbG9ja2VkLAogICAgIGNvbnN0IHN0cnVjdCBtYnVmICptMCkKQEAgLTE2ODgsNiArMTY5Miwx MSBAQAogCiAJTV9TRVRGSUIobSwgc2MtPnNjX2luYy5pbmNfZmlibnVtKTsKIAltLT5tX3BrdGhk ci5jc3VtX2RhdGEgPSBvZmZzZXRvZihzdHJ1Y3QgdGNwaGRyLCB0aF9zdW0pOworCS8qCisJICog SWYgd2UgaGF2ZSBwZWVyJ3MgU1lOIGFuZCBpdCBoYXMgYSBmbG93aWQsIHRoZW4gbGV0J3MgYXNz aWduIGl0IHRvCisJICogb3VyIFNZTnxBQ0suICBpcDZfb3V0cHV0KCkgYW5kIGlwX291dHB1dCgp IHdpbGwgbm90IGFzc2lnbiBmbG93aWQKKwkgKiB0byBTWU58QUNLIGR1ZSB0byBsYWNrIG9mIGlu cCBoZXJlLgorCSAqLwogCWlmIChtMCAhPSBOVUxMICYmIE1fSEFTSFRZUEVfR0VUKG0wKSAhPSBN X0hBU0hUWVBFX05PTkUpIHsKIAkJbS0+bV9wa3RoZHIuZmxvd2lkID0gbTAtPm1fcGt0aGRyLmZs b3dpZDsKIAkJTV9IQVNIVFlQRV9TRVQobSwgTV9IQVNIVFlQRV9HRVQobTApKTsKCg== --b1_f358da633abeff90a6b0b3f25af87427-- From owner-freebsd-net@freebsd.org Fri Apr 29 12:34:54 2016 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 9879BB1FD19 for ; Fri, 29 Apr 2016 12:34:54 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09E231E05 for ; Fri, 29 Apr 2016 12:34:53 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id u3TCYUuS031329; Fri, 29 Apr 2016 22:34:31 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Fri, 29 Apr 2016 22:34:30 +1000 (EST) From: Ian Smith To: lpa lpa cc: Nikolay Denev , "freebsd-net@freebsd.org" Subject: Re: Working divert socket example prog? In-Reply-To: Message-ID: <20160429221202.J16195@sola.nimnet.asn.au> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 12:34:54 -0000 On Fri, 29 Apr 2016 00:32:05 -0300, lpa lpa wrote: > On Thu, Apr 28, 2016 at 4:06 PM, Nikolay Denev wrote: >> Hi, >> >> Have you looked at the natd(8) source code? > yes but it's a complete application, it does a lot of stuff and I am > not able to "clean" it up to become a simple divert application which > reinjects packet so I can measure something. I was not able, so far, > to make thementioned divert-loop work, not breaking natd is a much > longer step to a non programmer You could have a look at Mike Makonnen's ipfw-classifyd, which diverts packets with the intent of applying Linux L7 filters to traffic, then feeding matching packets via dummynet pipes, originally for throttling P2P applications and such. You don't need to be interested in what it does with packets to benefit from knowing how it works; it's maybe an order of magnitude simpler than natd; and it can return from divert to different ipfw rule numbers. This didn't become a port, not sure why, but maybe it might help you (though you'd still need some coding to make it useful for your needs): http://people.freebsd.org/~mtm/ipfw-classifyd.tar.bz2 cheers, Ian > On Thu, Apr 28, 2016 at 7:21 AM, lpa lpa > wrote: > > Do anyone have a working example code of a divert loop program? > > > > I tried building this one[1] but it seems to be for FreeBSD 5 and won't > > build on latest system. I want to make simple measurement of pps rate > for a > > packet traveling inside a divert socket and getting reinjected back while > > printing some logs. > > > > However I am not a coder :( > > > > Thank you. > > > > [1]https://github.com/DianeRay/divert-loop/tree/master/divert-loop From owner-freebsd-net@freebsd.org Fri Apr 29 13:18:10 2016 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 4F8C9B21687 for ; Fri, 29 Apr 2016 13:18:10 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:607c::16:b]) by mx1.freebsd.org (Postfix) with ESMTP id 29B9C108C for ; Fri, 29 Apr 2016 13:18:10 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 694BED281; Fri, 29 Apr 2016 13:18:09 +0000 (UTC) Date: Fri, 29 Apr 2016 13:18:09 +0000 To: freebsd-net@freebsd.org From: "gallatin (Andrew Gallatin)" Reply-to: D6137+325+f015369c65104c2f@reviews.freebsd.org Subject: [Differential] D6137: tcp/lro: Refactor the free/active list operation. Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , Thread-Topic: D6137: tcp/lro: Refactor the free/active list operation. X-Herald-Rules: <64> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: ZDQ3OTAzM2ZhZTk0ODRmZGQwZGYxNDFlY2ZjIFcjXxE= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 13:18:10 -0000 gallatin accepted this revision. gallatin added a comment. Thanks, I'm good w/this version REVISION DETAIL https://reviews.freebsd.org/D6137 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, network, adrian, delphij, glebius, hselasky, np, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, transport, rrs, gallatin Cc: freebsd-net-list From owner-freebsd-net@freebsd.org Fri Apr 29 14:47:24 2016 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 E59F9B20162 for ; Fri, 29 Apr 2016 14:47:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6B761EEC for ; Fri, 29 Apr 2016 14:47:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TElOEc091916 for ; Fri, 29 Apr 2016 14:47:24 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 208409] [PATCH] igb and ALTQ Date: Fri, 29 Apr 2016 14:47:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-BETA2 X-Bugzilla-Keywords: IntelNetworking, patch X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: sbruno@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 14:47:25 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208409 --- Comment #4 from Sean Bruno --- Eric: I'm going to commit this today. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-net@freebsd.org Fri Apr 29 17:06:16 2016 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 618F5B21AEF for ; Fri, 29 Apr 2016 17:06:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40F8D17B2 for ; Fri, 29 Apr 2016 17:06:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TH6FGi058837 for ; Fri, 29 Apr 2016 17:06:16 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 208409] [PATCH] igb and ALTQ Date: Fri, 29 Apr 2016 17:06:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-BETA2 X-Bugzilla-Keywords: IntelNetworking, patch X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: erj@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 17:06:16 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208409 --- Comment #5 from Eric Joyner --- (In reply to Sean Bruno from comment #4) Okay; this looks fine. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-net@freebsd.org Fri Apr 29 17:13:11 2016 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 A41CAB21CC5 for ; Fri, 29 Apr 2016 17:13:11 +0000 (UTC) (envelope-from web@axvisualpromocom.com) Received: from smtp1g32.consultorpc.com (smtp1g32.consultorpc.com [93.159.214.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D9B61B83 for ; Fri, 29 Apr 2016 17:13:10 +0000 (UTC) (envelope-from web@axvisualpromocom.com) Received: by smtp1g31.consultorpc.com id h4eb2c16r3gh for ; Fri, 29 Apr 2016 19:13:06 +0200 (envelope-from ) To: From: "web@axvisualpromocom.com" Reply-To: "web@axvisualpromocom.com" Date: Fri, 29 Apr 2016 19:12:56 +0200 Message-ID: <56580704060201060051530a05095157500754005702505557015a08570102500102030004015507045751570653@axalphaconsulting1_ip-zone_com-6> X-CcmId: 0419545b435151505f0812475a46080b05576a08421c4c0e5d566652595b5850505102050b0a0b0b Feedback-ID: 39235:39235-8:1:Mailrelay X-Report-Abuse: Please report abuse for this campaign here http://axalphaconsulting1.mailrelay-ii.com/ccm/abuse?a=39235&m=8&s=685896 X-OriginalSender: web@axvisualpromocom.com Subject: Descubre lo que esconden los datos MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 17:13:11 -0000 Descubre lo que ocultan los datos Qlik=C2=AE es una aplicaci=C3=B3n que utiliza la tecnolog=C3=ADa asociativa= para mostrar gr=C3=A1ficamente los datos de cualquier fuente, de forma int= uitiva, interactiva y muy sencilla. S=C3=B3lo con buscar una palabra o arrastrar y soltar el primer dato, el pr= ograma permite construir gr=C3=A1ficos r=C3=A1pidamente y descubrir informa= ci=C3=B3n que nunca hubieras visto mirando n=C3=BAmeros en una base de dato= s. Si utilizas Excel para presentar la informaci=C3=B3n, Qlik=C2=AE esuna h= erramienta mucho m=C3=A1s potente, r=C3=A1pida y visual.=20 =C2=A1Convi=C3=A9rtete en analista experto en tu propia empresa!=20 Axvisual Promocom Av. Garrigues 44 pl.1. 08820 El Prat de Llobregat (Barcelona). Tel. 93 372 = 90 60. web@axvisualpromocom.com From owner-freebsd-net@freebsd.org Sat Apr 30 13:50:48 2016 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 C7159B1FB71 for ; Sat, 30 Apr 2016 13:50:48 +0000 (UTC) (envelope-from admin005@m5.ccboqi.com) Received: from m5.ccboqi.com (m5.ccboqi.com [154.16.127.5]) by mx1.freebsd.org (Postfix) with ESMTP id 61DDD1C14 for ; Sat, 30 Apr 2016 13:50:47 +0000 (UTC) (envelope-from admin005@m5.ccboqi.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=ccboqi; d=m5.ccboqi.com; h=Date:From:To:Subject:Message-ID:Mime-Version:Content-Type; i=admin005@m5.ccboqi.com; bh=2PwFIuIAaZvuE6TUw1giBpv8pUQ=; b=WyKitLQCAWoXrD/uJn8jpW7WVdoEjy5JvIBJwrDzHy1yBsaabEn5xcKLsFKL3hKqB73IhPwEsL4R WQVM4axs1fQed7l12SDe3Pus6aQGUp5MNzfL/GlFgwZHFUZzA5Gni9P7IVKXD5rReNWY8IO4svZo RYK9b1ZWWimOZGyFSTE= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=ccboqi; d=m5.ccboqi.com; b=O51OAiHpTi0ykdC2cyrHJ3i392d4BoEmRP65XeduKzZq0O7y1KvmoZKQHsZF1/2nCQ61EeVrkITl 14QrzUeJQd0vpjbHzpcQmB05VrC2ZArrBccwuGlpLSAeoz7APuk7BpiC2OHGB/ccXpORMlpZiCtT +Jc3GCxZtbGAtZ5dyQI=; Date: Sat, 30 Apr 2016 21:40:33 +0800 From: "Rayban" To: Subject: Your great offer from Rayban Sunglasses Message-ID: <20160430214038650344@m5.ccboqi.com> X-mailer: Foxmail 6, 13, 102, 15 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 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, 30 Apr 2016 13:50:48 -0000 SGF2aW5nIHRyb3VibGUgcmVhZGluZyB0aGlzIGVtYWlsPyBWaWV3IGl0IGluIHlvdXIgYnJvd3Nl ci4gTm90IGludGVyZXN0ZWQgYW55bW9yZT8gVW5zdWJzY3JpYmUgaW5zdGFudGx5Lg0KbXlieG5h aW80NXdvNzdpanhuY3ZpMTJnZm43dmdhcGJsbHJpbjhrbmlyZmpicGZwNjYwdjA4dG5tbWxkands bHRnMHlvem95ZDJoamt1eXogDQpTVU5HTEFTU0VTRVlFR0xBU1NFU05FVyZIT1RDT05UQUNUIExP R0lODQoNCg0KcGZyc2l3eDV5Y3Zxb3VrMG95NnlicHRhZ3FmemxjdDczeXlkYjJ4d3ZzMWliZWd0 cnJkcGp6azlvN29hb2ZleGRhYnR6YWR2MGZhcHM4N2YgUkFZQkFODQpTVE9SRSBEaXNjb3VudCBS YXliYW4gU3VuZ2xhc3NlcyAkMjQuOTkgSnVzdCBUb2RheSANCkJ1eSBvdmVyIDQgcGFpcnMgdG8g ZW5qb3kgZnJlZSBzaGlwcGluZyANCg0Kb3duaXBpZWt1eQ0KODMgDQpFVkVSWVRISU5HIA0KJU9G RiANCg0KU0hPUCBOT1cgDQoNCg0KT3VyIHByb21pc2VzOg0KDQoNCi0gQnV5IG92ZXIgNCBwYWly cyBvZiB0byBlbmpveSBmcmVlIHNoaXBwaW5nIA0KDQotIDEwMCBkYXlzIHRvIHJldHVybiBvciBl eGNoYW5nZSBhbiBpdGVtDQoNCi0gU2FtZS1kYXkgZGlzcGF0Y2ggZm9yIG9yZGVycyBwbGFjZWQg YmVmb3JlIDcgRGF5cy4qDQoNCi0gQ29tcGxldGUgc2VjdXJpdHkgd2l0aCAxMDAlIHNlY3VyZSBv cmRlciBwcm9jZXNzaW5nDQoNCi0gQ3VzdG9tZXIgc2F0aXNmYWN0aW9uIGlzIG91ciB0b3AgcHJp b3JpdHkgDQoNCipUd2VudHktZm91ciBob3VycyBhIGRheSwgZGVwZW5kZW50IHVwb24gcGF5bWVu dCB2YWxpZGF0aW9uDQoNCipTZWUgdGVybXMgYW5kIGNvbmRpdGlvbnMgDQoNCg0KdmE4a3hweGR4 aHZ6NjF1MnI3NG8yZ3AzeDk3cTlqZGpodm5yc2UwNGN0bGhoam9qcnpnY3FicnBzeG02aGR2dWpp eWl1a3lycHI3ZW5peGMNCg0KDQpDb3B5cmlnaHQgQCAyMDA5LTIwMTYgUmF5YmFuIFN1bmdsYXNz ZXMuIEFsbCBSaWdodHMgUmVzZXJ2ZWQuIA==