Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 May 2004 21:56:18 +0200
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        naddy@mips.inka.de (Christian Weisgerber)
Cc:        freebsd-arch@freebsd.org
Subject:   Re: ether_crc32_[bl]e() 
Message-ID:  <98761.1085946978@critter.freebsd.dk>
In-Reply-To: Your message of "Sun, 30 May 2004 18:42:11 -0000." <c9d9u3$o6k$1@kemoauc.mips.inka.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <c9d9u3$o6k$1@kemoauc.mips.inka.de>, Christian Weisgerber writes:
>NetBSD and OpenBSD have two helper functions in if_ethersubr.c
>
>ether_crc32_le(const u_int8_t *buf, size_t len)
>ether_crc32_be(const u_int8_t *buf, size_t len)
>
>that will calculate an ethernet CRC-32 in little endian/big endian
>fashion.
>
>These CRCs are used all over our network drivers, e.g. for setting
>up multicast hash filters.  Functions to calculate them are duplicated
>all over.  These could be factored out of some thirty drivers.
>NetBSD has done so, btw.
>
>The patch below adds the functions to if_ethersubr.c and, as an
>example, switches re(4) to make use of this.
>
>1. Do we want this?

In general for stuff like this, if you save more than a handful of
lines in more than a handful of drivers you can assume that we want it.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



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