Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2016 18:09:02 +0200 (CEST)
From:      Emeric POUPON <emeric.poupon@stormshield.eu>
To:        freebsd-net@FreeBSD.org
Subject:   Vlan offloaded checksums
Message-ID:  <1628370702.4125956.1473696542873.JavaMail.zimbra@stormshield.eu>

next in thread | raw e-mail | index | archive | help
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;
    }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1628370702.4125956.1473696542873.JavaMail.zimbra>