Re: ether_crc32_[bl]e()

From: Poul-Henning Kamp (phk_at_phk.freebsd.dk)
Date: 05/30/04

  • Next message: Roman Kurakin: "Re: The Design and Implementation of the FreeBSD Operating System"
    To: naddy@mips.inka.de (Christian Weisgerber)
    Date: Sun, 30 May 2004 21:56:18 +0200
    
    

    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.
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Roman Kurakin: "Re: The Design and Implementation of the FreeBSD Operating System"

    Relevant Pages