Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Hardware checksums on bge(4) interfaces



On Sep 15, 2010, at 3:47 AM, Brian Buhrow wrote:
>       This patch changes the driver to instruct the hardware to perform the
> checksum over the entire packet, just as the FreeBSD and Linux drivers do,
> and to notify the upper layers appropriately.  
> 
> Let me know what you find.
> -Brian

  The patch, left below, looks like it removes the BGE_MODECTL_RX_NO_PHDR_CSUM 
bit, but leaves the BGE_MODECTL_TX_NO_PHDR_CSUM bit in place.  By reading your 
description, this may solve only half of the problem.

  I don't know, of course, but it looked worth asking about...  Did you mean to 
leave the TX side without calculating the checksum of the pseudo-header?

           - Chris


> 
> 
> Index: if_bge.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/pci/if_bge.c,v
> retrieving revision 1.152.4.2
> diff -u -r1.152.4.2 if_bge.c
> --- if_bge.c  2 Feb 2009 20:44:16 -0000       1.152.4.2
> +++ if_bge.c  15 Sep 2010 07:12:43 -0000
> @@ -1444,7 +1444,7 @@
>        */
>       CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS|
>                   BGE_MODECTL_MAC_ATTN_INTR|BGE_MODECTL_HOST_SEND_BDS|
> -                 BGE_MODECTL_TX_NO_PHDR_CSUM|BGE_MODECTL_RX_NO_PHDR_CSUM);
> +                 BGE_MODECTL_TX_NO_PHDR_CSUM);
> 
>       /* Get cache line size. */
>       cachesize = pci_conf_read(sc->sc_pc, sc->sc_pcitag, BGE_PCI_CACHESZ);
> @@ -3276,7 +3276,7 @@
>                           cur_rx->bge_tcp_udp_csum;
>                       m->m_pkthdr.csum_flags |=
>                           (M_CSUM_TCPv4|M_CSUM_UDPv4|
> -                          M_CSUM_DATA|M_CSUM_NO_PSEUDOHDR);
> +                          M_CSUM_DATA);
>               }
> 
>               /*



Home | Main Index | Thread Index | Old Index