Port-sparc archive

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

Re: hme(4) hardware RX checksum



On Mar 7,  2:49am, tsutsui%ceres.dti.ne.jp@localhost (Izumi Tsutsui) wrote:
-- Subject: Re: hme(4) hardware RX checksum

| christos%astron.com@localhost wrote:
| 
| > >In hme.c:hme_get(), m_pkthdr.csum_flags is always cleared after
| > >a goto label, so hardware RX checksum on hme(4) seems unused at all.
| > >(no one has checked hwcsum stats by options TCP_CSUM_COUNTERS etc?)
| > >
| > >There is also a wrong pointer arith in VLAN case.
| > >
| > >Is it okay to commit this fix?
| > 
| > Please do!
| 
| Now I notice gem.c has the similar code and hme.c needs to
| have one more `else' for swcsum cases. Which is better?

should be fixed too I guess.

| Index: hme.c
| ===================================================================
| RCS file: /cvsroot/src/sys/dev/ic/hme.c,v
| retrieving revision 1.68
| diff -u -r1.68 hme.c
| --- hme.c     16 Dec 2008 22:35:31 -0000      1.68
| +++ hme.c     6 Mar 2009 17:45:55 -0000
| @@ -836,7 +836,7 @@
|               }
|  
|               m0->m_pkthdr.csum_flags |= M_CSUM_DATA | M_CSUM_NO_PSEUDOHDR;
| -     }
| +     } else
|  swcsum:
|               m0->m_pkthdr.csum_flags = 0;
|  #endif

right the else needs to be there.

| 
| BTW, does hardware checksum work even for VLAN packets?

It must, because there is vlan stuff inside a hw capabilities if statement
(I am just guessing).

| At least it looks wrong to check sc_ethercom.ec_capenable
| without checking eh->ether_type == ETHERTYPE_VLAN.

You are suggesting:

if (eh->ether_type == ETHERTYPE_VLAN && 
    sc->sc_ethercom.ec_capenable & ETHERCAP_VLAN_MTU) {
?

christos


Home | Main Index | Thread Index | Old Index