From nobody Mon Nov 15 03:37:45 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6A687185BDFB; Mon, 15 Nov 2021 03:37:53 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsvz50wl2z3tZP; Mon, 15 Nov 2021 03:37:53 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 1AF3bjgM007379 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 14 Nov 2021 19:37:45 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 1AF3bjU1007378; Sun, 14 Nov 2021 19:37:45 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Sun, 14 Nov 2021 19:37:45 -0800 From: Gleb Smirnoff To: Emmanuel Vadot , Ian Lepore Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 44aae623ab85 - main - Add ETHER_ALIGN support to ng_device(4). Message-ID: References: <202111141239.1AECdLrA069026@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202111141239.1AECdLrA069026@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4Hsvz50wl2z3tZP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi, On Sun, Nov 14, 2021 at 12:39:21PM +0000, Emmanuel Vadot wrote: E> Author: Ian Lepore E> AuthorDate: 2021-11-09 14:34:06 +0000 E> Commit: Emmanuel Vadot E> CommitDate: 2021-11-14 12:37:41 +0000 E> E> Add ETHER_ALIGN support to ng_device(4). E> E> This adds a new ng_device command, NGM_DEVICE_ETHERALIGN, which has no E> associated args. After the command arrives, the device begins adjusting all E> packets sent out its hook to have ETHER_ALIGN bytes of padding at the E> beginning of the packet. The ETHER_ALIGN padding is added only when E> running on an architecture that requires strict alignment of IP headers E> (based on the __NO_STRICT_ALIGNMENT macro, which is only #define'd on E> x86 as of this writing). E> E> This also adds ascii <-> binary command translation to ng_device, both for E> the existing NGM_DEVICE_GET_DEVNAME and the new ETHERALIGN command. E> E> This also gives a name to every ng_device node when it is constructed, using E> the cdev device name (ngd0, ngd1, etc). This makes it easier to address E> command msgs to the device using ngctl(8). Since early days of netgraph there were plans to make data link types on hooks. For example, for ng_ether or ng_eiface that would be hardcoded to Ethernet. Other more generic nodes like ng_socket or ng_device would be able to see peer's DLT and make their own decisions on that. Or even netgraph itself would be able to enforce alignment. Hopefully some day somebody will find time for that. P.S. Also very curios to hear how ng_device is used in practice. I always looked at it as at a test/experiment node type. -- Gleb Smirnoff