diff options
| author | Pyun YongHyeon <yongari@FreeBSD.org> | 2010-03-23 19:30:15 +0000 |
|---|---|---|
| committer | Pyun YongHyeon <yongari@FreeBSD.org> | 2010-03-23 19:30:15 +0000 |
| commit | d95d4a8336336368bc17e4d616daad8a5358e70d (patch) | |
| tree | 5652cbf2dcda2ca0a674afcb7fa9706f8c3904e3 /sys/dev | |
| parent | 60a337785e3b6eaf1e0b82b7819cd724dd1e1cb6 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/re/if_re.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index a642925b50c4..978580179d5d 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1162,6 +1162,9 @@ re_attach(device_t dev) msic = 0; if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { sc->rl_flags |= RL_FLAG_PCIE; + /* Set PCIe maximum read request size to 2048. */ + if (pci_get_max_read_req(dev) < 2048) + pci_set_max_read_req(dev, 2048); msic = pci_msi_count(dev); if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); @@ -1426,7 +1429,7 @@ re_attach(device_t dev) */ if ((sc->rl_flags & RL_FLAG_DESCV2) == 0) { ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities |= IFCAP_TSO4; + ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } /* @@ -1448,7 +1451,7 @@ re_attach(device_t dev) * packets in TSO size. */ ifp->if_hwassist &= ~CSUM_TSO; - ifp->if_capenable &= ~IFCAP_TSO4; + ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif @@ -2786,6 +2789,7 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data) (ifp->if_capenable & IFCAP_TSO4) != 0) { ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_TSO; + VLAN_CAPABILITIES(ifp); } RL_UNLOCK(sc); break; @@ -2852,14 +2856,10 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } - if (mask & IFCAP_VLAN_HWTAGGING) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - reinit = 1; - } - if (mask & IFCAP_TSO4) { + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO) != 0) { ifp->if_capenable ^= IFCAP_TSO4; - if ((IFCAP_TSO4 & ifp->if_capenable) && - (IFCAP_TSO4 & ifp->if_capabilities)) + if ((IFCAP_TSO4 & ifp->if_capenable) != 0) ifp->if_hwassist |= CSUM_TSO; else ifp->if_hwassist &= ~CSUM_TSO; @@ -2869,6 +2869,17 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_hwassist &= ~CSUM_TSO; } } + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + /* TSO over VLAN requires VLAN hardware tagging. */ + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + reinit = 1; + } if ((mask & IFCAP_WOL) != 0 && (ifp->if_capabilities & IFCAP_WOL) != 0) { if ((mask & IFCAP_WOL_UCAST) != 0) |
