From owner-freebsd-net@freebsd.org Mon Sep 12 16:11: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 2AAA7BD73D7 for ; Mon, 12 Sep 2016 16:11:21 +0000 (UTC) (envelope-from emeric.poupon@stormshield.eu) Received: from work.stormshield.eu (gwlille.netasq.com [91.212.116.1]) (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 EB9A3AD5 for ; Mon, 12 Sep 2016 16:11:20 +0000 (UTC) (envelope-from emeric.poupon@stormshield.eu) Received: from work.stormshield.eu (localhost [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTPS id 5C55837609DB for ; Mon, 12 Sep 2016 18:09:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTP id 4E3823760B10 for ; Mon, 12 Sep 2016 18:09:03 +0200 (CEST) Received: from work.stormshield.eu ([127.0.0.1]) by localhost (work.stormshield.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id gFIdc4csJ4i3 for ; Mon, 12 Sep 2016 18:09:03 +0200 (CEST) Received: from work.stormshield.eu (localhost [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTP id 3BF0E37609DB for ; Mon, 12 Sep 2016 18:09:03 +0200 (CEST) Date: Mon, 12 Sep 2016 18:09:02 +0200 (CEST) From: Emeric POUPON To: freebsd-net@FreeBSD.org Message-ID: <1628370702.4125956.1473696542873.JavaMail.zimbra@stormshield.eu> Subject: Vlan offloaded checksums MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Thread-Topic: Vlan offloaded checksums Thread-Index: nIeEhzgJc4kRuEaIFI21+2qx32A8Ow== X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 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, 12 Sep 2016 16:11:21 -0000 Hello, I have a network driver that supports hardware checksums. Thanks to offset parameters, it also supports VLAN checksums. However, it does not handle hardware tagging (not sure the underlying network adapter can actually do it) Unfortunately, the VLAN hardware checksums seem to be done only if IFCAP_VLAN_HWTAGGING is set [1] I do not understand this assertion: if I force the propagation of the hardware checksuming only based on the IFCAP_VLAN_HWCSUM, it works fine with my driver. What do you think? Emeric [1]: In ./net/if_vlan.c, function vlan_capabilities : /* * If the parent interface can do checksum offloading * on VLANs, then propagate its hardware-assisted * checksumming flags. Also assert that checksum * offloading requires hardware VLAN tagging. */ if (p->if_capabilities & IFCAP_VLAN_HWCSUM) ifp->if_capabilities = p->if_capabilities & IFCAP_HWCSUM; if (p->if_capenable & IFCAP_VLAN_HWCSUM && p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; }