From owner-freebsd-arch@FreeBSD.ORG Fri Oct 29 17:49:25 2010 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05B291065670 for ; Fri, 29 Oct 2010 17:49:25 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9F48FC0A for ; Fri, 29 Oct 2010 17:49:24 +0000 (UTC) Received: by wwi18 with SMTP id 18so4409906wwi.1 for ; Fri, 29 Oct 2010 10:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=8v3U+DqVeF6j30XSSr3INEY/S+0z3F4hy3NHNwYBlT8=; b=uv4rFVe/OQANlKVOMdjwBdjJEpeshkueT7fPsQuT6ZXlKWDtl3mMpYc5w1pdAGZ7gZ 2T0laP6NGIJKWdcPg7CmIDm2Y5IKRyT814FaqW9FMnCbl97B7mqj5fH74wh3cJIbZxP8 0q0ku6aKaBpFCh8wgfEF83Vxl35EgsxCqZycQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=hHjRkoH7R4bYuefMz47oIHcEIQ6R5TWeC2hhKdGhMH6eBfnRhPpI4cmpdCEjR5iY+v 2SlwvWeHJ/DM7LJF1tajmTkZKXOqqf40eYRKBfTtNFJJ8/MU89ctIQpW7QfQUe8A/3JB wdzvJAmdfCpaHv05nMjeQuF0gOm5pzJP6a5NA= MIME-Version: 1.0 Received: by 10.216.36.84 with SMTP id v62mr790646wea.77.1288372789001; Fri, 29 Oct 2010 10:19:49 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.10.198 with HTTP; Fri, 29 Oct 2010 10:19:48 -0700 (PDT) In-Reply-To: References: Date: Fri, 29 Oct 2010 10:19:48 -0700 X-Google-Sender-Auth: CZDzs5SO2JGub_CLRJ80H7zc4D0 Message-ID: From: Garrett Cooper To: George Neville-Neil Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org Subject: Re: RFC: ARP Packet Queues X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 17:49:25 -0000 On Fri, Oct 29, 2010 at 6:42 AM, George Neville-Neil wrote: > Howdy, > > Please review the following patch against HEAD: > > http://people.freebsd.org/~gnn/head-arpqueue.diff > > This patch makes two changes to the ARP code: > > 1) It adds a sysctl configurable queue of packets that are held until an = ARP reply is received or > timed out. > > net.link.ether.inet.maxhold > > Having the queue addresses a problem in modern systems where programs tha= t use connectionless > protocols for communication will suffer from dropping many packets when t= hey start up or when > an ARP entry moves. > > 2) Makes the time we wait for an arp reply configurable via another sysct= l. > > net.link.ether.inet.wait > > The old, pre 8.0, ARP code would run the timer once per second. =A0The ne= w > ARP code sets a timeout of 20 seconds on each entry. =A0Neither value was= specified > in RFC 826. =A0As a matter of fact, RFC 826 had this to say about timeout= s: > > "It may be desirable to have table aging and/or timeouts. =A0The > implementation of these is outside the scope of this protocol." > > This new code does not change the default value of either the arpqueue (w= hich was > always 1 packet) nor does it change the new value of the ARP down timeout= . > > I have a different patch for 7, which I will propose after I can get this= in to > HEAD and MFC'd to 8. Hi George, I'm just curious so I took at look at the patch (although I'm not really good at reviewing this section of code). 1. This needs a tab after the #define for the macro: +#define V_arp_maxhold VNET(arp_maxhold) 2. Is the naming convention for these sysctls always net.link.ether imply arp, or is it another naming convention? 3. Is there a reason why packets_dropped is a signed quantity, i.e. int, not size_t, etc? The rest looks ok, but I could be missing some context, or a subtlety of some kind. I'll give this a shot on my new router box this weekend because it looks interesting. Thanks! -Garrett