From owner-freebsd-net@FreeBSD.ORG Fri Oct 5 15:05:24 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58C2F1065670; Fri, 5 Oct 2012 15:05:24 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A1BC68FC16; Fri, 5 Oct 2012 15:05:22 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id jf20so1001264bkc.13 for ; Fri, 05 Oct 2012 08:05:16 -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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=QOmg5vPTVu4T01P1ZB9v7gI7QB2J2dZe+Byaf8XO9Co=; b=UstDc5IuGeULzlGsmFRYLb8VN2MDEidZBf/lJG+e6v5W8ajhn2FONXHupGVgLrUaDL qj6LpEO1yDCG7TQoBEz/J5vfbYgEhTIYXTJQfVpYIOWqdDiEBKNh186k06fUA/GtGCpN B2dBaVEH0+/LD6Y6Ku0OMijxjXuBXT6liVfNgs2ezH6gon+xK5cKhJIvAKQFmHY6cWyU Q+Zesp0g1gFMe+8ABv+JUhTFdLg/Uz5g7AyphHT4Y9I1DFTa/2MoDUcWOd7/m5ZyAgpp ayw8tM/Uge6n9uLhzmAVKyAf6Aim5KB6jWwOuaKBAxveCCaztvPYRXYePSJZyP7Hv+hV 7WqA== MIME-Version: 1.0 Received: by 10.205.127.146 with SMTP id ha18mr2974028bkc.130.1349449516054; Fri, 05 Oct 2012 08:05:16 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.204.143.148 with HTTP; Fri, 5 Oct 2012 08:05:16 -0700 (PDT) In-Reply-To: <20121005131228.GQ34622@glebius.int.ru> References: <20121005114716.GP34622@FreeBSD.org> <20121005131228.GQ34622@glebius.int.ru> Date: Fri, 5 Oct 2012 17:05:16 +0200 X-Google-Sender-Auth: ZSs9BbnZ8PLtjvM0IgUvyTUEdEg Message-ID: From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: net@freebsd.org Subject: Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 05 Oct 2012 15:05:24 -0000 On Fri, Oct 5, 2012 at 3:12 PM, Gleb Smirnoff wrote: > Ermal, > > On Fri, Oct 05, 2012 at 03:01:38PM +0200, Ermal Lu?i wrote: > E> it would be better to switch to net byte order allover rather than > E> trade one for the other. > E> This makes it even more tricky to understand the code than it is. > E> If you do the work its better to do the full thing in one shot and > E> switch to netbyte order. > > Please read carefully my description and patch. It creates a definite > points in stack where byte order is swapped. One point where it is > swapped into host, and one point where it is swapped back into net. > > Patch already narrows down the scope of host byte order in the stack, > host byte order is now between to definite points. If anyone ever wants > to switch entire stack to net byte order, let it be. Current patch is > just step in this direction. > > The fast forwarding path is already entirely in net byte order. Even > if run with ipfw and/or pf. > > E> speaking of pf(4) side of things please do not loose the VIMAGE calls! > > Yeah, can you explain please why do we need them here? The pfil hooks > are always run already in some defined VNET context, don't they? > from my testing at the time these were needed otherwise you will get issues. I do not remember the details but i put those there because were required. There is no overhead as well from leaving those there. > -- > Totus tuus, Glebius. -- Ermal