vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Wed, 8 Jun 2005, Camiel Dobbelaar wrote: > Please help test this diff if you own a bge, nge, ti, or txp NIC. bge and txp are done. I'm still looking for nge or ti owners willing to test the diff below. > This diff disables hardware assisted decapsulation (untagging) of vlan > frames on the four above mentioned NICs. The reason is that this feature > does not help performance at all, but does hurt in other areas. > > How to test: configure a vlan interface and try to send and receive > vlan tagged frames. Check with tcpdump, the frames must still be tagged. > > Thanks. > > > Index: if_bge.c > ================================================== ================= > RCS file: /cvs/src/sys/dev/pci/if_bge.c,v > retrieving revision 1.62 > diff -u -p -r1.62 if_bge.c > --- if_bge.c 7 Jun 2005 20:39:07 -0000 1.62 > +++ if_bge.c 8 Jun 2005 06:22:41 -0000 > @@ -2214,10 +2214,6 @@ bge_rxeof(sc) > struct bge_rx_bd *cur_rx; > u_int32_t rxidx; > struct mbuf *m = NULL; > -#if NVLAN > 0 > - u_int16_t vlan_tag = 0; > - int have_tag = 0; > -#endif > #ifdef BGE_CHECKSUM > int sumflags = 0; > #endif > @@ -2228,13 +2224,6 @@ bge_rxeof(sc) > rxidx = cur_rx->bge_idx; > BGE_INC(sc->bge_rx_saved_considx, sc->bge_return_ring_cnt); > > -#if NVLAN > 0 > - if (cur_rx->bge_flags & BGE_RXBDFLAG_VLAN_TAG) { > - have_tag = 1; > - vlan_tag = cur_rx->bge_vlan_tag; > - } > -#endif > - > if (cur_rx->bge_flags & BGE_RXBDFLAG_JUMBO_RING) { > BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); > m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; > @@ -2317,18 +2306,6 @@ bge_rxeof(sc) > m->m_pkthdr.csum_flags = sumflags; > sumflags = 0; > #endif > - > -#if NVLAN > 0 > - /* > - * If we received a packet with a vlan tag, pass it > - * to vlan_input() instead of ether_input(). > - */ > - if (have_tag) { > - vlan_input_tag(m, vlan_tag); > - have_tag = vlan_tag = 0; > - continue; > - } > -#endif > ether_input_mbuf(ifp, m); > } > > @@ -2826,6 +2803,9 @@ bge_init(xsc) > } else { > BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_PROMISC); > } > + > + /* Disable hardware decapsulation of vlan frames. */ > + BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_KEEP_VLAN_DIAG); > > /* Program multicast filter. */ > bge_setmulti(sc); > Index: if_nge.c > ================================================== ================= > RCS file: /cvs/src/sys/dev/pci/if_nge.c,v > retrieving revision 1.34 > diff -u -p -r1.34 if_nge.c > --- if_nge.c 25 May 2005 21:01:17 -0000 1.34 > +++ if_nge.c 8 Jun 2005 06:22:42 -0000 > @@ -1363,18 +1363,6 @@ nge_rxeof(sc) > m->m_pkthdr.csum_flags |= M_UDP_CSUM_IN_OK; > } > > -#if NVLAN > 0 > - /* > - * If we received a packet with a vlan tag, pass it > - * to vlan_input() instead of ether_input(). > - */ > - if (extsts & NGE_RXEXTSTS_VLANPKT) { > - if (vlan_input_tag(m, extsts & NGE_RXEXTSTS_VTCI) < 0) > - ifp->if_data.ifi_noproto++; > - continue; > - } > -#endif > - > ether_input_mbuf(ifp, m); > } > > @@ -1846,17 +1834,6 @@ nge_init(xsc) > * packets, do not reject packets with bad checksums. > */ > CSR_WRITE_4(sc, NGE_VLAN_IP_RXCTL, NGE_VIPRXCTL_IPCSUM_ENB); > - > -#if NVLAN > 0 > - /* > - * If VLAN support is enabled, tell the chip to detect > - * and strip VLAN tag info from received frames. The tag > - * will be provided in the extsts field in the RX descriptors. > - */ > - if (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) > - NGE_SETBIT(sc, NGE_VLAN_IP_RXCTL, > - NGE_VIPRXCTL_TAG_DETECT_ENB|NGE_VIPRXCTL_TAG_STRIP _ENB); > -#endif > > /* Set TX configuration */ > CSR_WRITE_4(sc, NGE_TX_CFG, NGE_TXCFG); > Index: if_ti.c > ================================================== ================= > RCS file: /cvs/src/sys/dev/pci/if_ti.c,v > retrieving revision 1.60 > diff -u -p -r1.60 if_ti.c > --- if_ti.c 25 Apr 2005 17:55:51 -0000 1.60 > +++ if_ti.c 8 Jun 2005 06:22:43 -0000 > @@ -1445,9 +1445,6 @@ int ti_gibinit(sc) > rcb->ti_max_len = ETHER_MAX_LEN; > rcb->ti_flags = 0; > rcb->ti_flags |= TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; > -#if NVLAN > 0 > - rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST; > -#endif > > /* Set up the jumbo receive ring. */ > rcb = &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb; > @@ -1455,9 +1452,6 @@ int ti_gibinit(sc) > rcb->ti_max_len = ETHER_MAX_LEN_JUMBO; > rcb->ti_flags = 0; > rcb->ti_flags |= TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; > -#if NVLAN > 0 > - rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST; > -#endif > > /* > * Set up the mini ring. Only activated on the > @@ -1472,9 +1466,6 @@ int ti_gibinit(sc) > else > rcb->ti_flags = 0; > rcb->ti_flags |= TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; > -#if NVLAN > 0 > - rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST; > -#endif > > /* > * Set up the receive return ring. > @@ -1804,10 +1795,6 @@ void ti_rxeof(sc) > struct ti_rx_desc *cur_rx; > u_int32_t rxidx; > struct mbuf *m = NULL; > -#if NVLAN > 0 > - u_int16_t vlan_tag = 0; > - int have_tag = 0; > -#endif > int sumflags = 0; > #ifdef TI_CSUM_OFFLOAD > struct ip *ip; > @@ -1819,13 +1806,6 @@ void ti_rxeof(sc) > rxidx = cur_rx->ti_idx; > TI_INC(sc->ti_rx_saved_considx, TI_RETURN_RING_CNT); > > -#if NVLAN > 0 > - if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) { > - have_tag = 1; > - vlan_tag = cur_rx->ti_vlan_tag; > - } > -#endif > - > if (cur_rx->ti_flags & TI_BDFLAG_JUMBO_RING) { > TI_INC(sc->ti_jumbo, TI_JUMBO_RX_RING_CNT); > m = sc->ti_cdata.ti_rx_jumbo_chain[rxidx]; > @@ -1906,18 +1886,6 @@ void ti_rxeof(sc) > m->m_pkthdr.csum_flags = sumflags; > sumflags = 0; > > -#if NVLAN > 0 > - /* > - * If we received a packet with a vlan tag, pass it > - * to vlan_input() instead of ether_input(). > - */ > - if (have_tag) { > - if (vlan_input_tag(m, vlan_tag) < 0) > - ifp->if_data.ifi_noproto++; > - have_tag = vlan_tag = 0; > - continue; > - } > -#endif > ether_input_mbuf(ifp, m); > } > > Index: if_txp.c > ================================================== ================= > RCS file: /cvs/src/sys/dev/pci/if_txp.c,v > retrieving revision 1.77 > diff -u -p -r1.77 if_txp.c > --- if_txp.c 25 Apr 2005 17:55:51 -0000 1.77 > +++ if_txp.c 8 Jun 2005 06:22:43 -0000 > @@ -725,14 +725,6 @@ txp_rx_reclaim(sc, r, dma) > > m->m_pkthdr.csum_flags = sumflags; > > -#if NVLAN > 0 > - if (rxd->rx_stat & htole32(RX_STAT_VLAN)) { > - if (vlan_input_tag(m, htons(rxd->rx_vlan >> 16)) < 0) > - ifp->if_noproto++; > - goto next; > - } > -#endif > - > ether_input_mbuf(ifp, m); > > next: > @@ -2005,7 +1997,6 @@ txp_capabilities(sc) > ifp->if_capabilities |= IFCAP_VLAN_MTU; > if (rsp->rsp_par2 & rsp->rsp_par3 & OFFLOAD_VLAN) { > sc->sc_tx_capability |= OFFLOAD_VLAN; > - sc->sc_rx_capability |= OFFLOAD_VLAN; > ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; > } > #endif |