diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-08-12 00:27:32 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-08-12 00:27:32 +0000 |
commit | 174a1072944b14d78afbf2bf44a550bcafcf2adb (patch) | |
tree | bbec9c04021e539420089a5d85e1f397e5a33175 /sys/dev/cxgb/cxgb_main.c | |
parent | 2e0fd6b4c3050b7765ca05851c99123e1e74856e (diff) | |
download | FreeBSD-src-174a1072944b14d78afbf2bf44a550bcafcf2adb.zip FreeBSD-src-174a1072944b14d78afbf2bf44a550bcafcf2adb.tar.gz |
Remove cxgb private lro implementation and switch to using system implementation.
Obtained from: Chelsio Inc.
MFC after: 1 week
Diffstat (limited to 'sys/dev/cxgb/cxgb_main.c')
-rw-r--r-- | sys/dev/cxgb/cxgb_main.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index d4ab337..e8a3ad9 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -903,9 +903,9 @@ cxgb_makedev(struct port_info *pi) #ifdef TSO_SUPPORTED -#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU) +#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO) /* Don't enable TSO6 yet */ -#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO4 | IFCAP_JUMBO_MTU) +#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO4 | IFCAP_JUMBO_MTU | IFCAP_LRO) #else #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU) /* Don't enable TSO6 yet */ @@ -1946,6 +1946,24 @@ cxgb_set_mtu(struct port_info *p, int mtu) return (error); } +/* + * Mark lro enabled or disabled in all qsets for this port + */ +static int +cxgb_set_lro(struct port_info *p, int enabled) +{ + int i; + struct adapter *adp = p->adapter; + struct sge_qset *q; + + PORT_LOCK_ASSERT_OWNED(p); + for (i = 0; i < p->nqsets; i++) { + q = &adp->sge.qs[p->first_qset + i]; + q->lro.enabled = (enabled != 0); + } + return (0); +} + static int cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) { @@ -2031,6 +2049,12 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) error = EINVAL; } } + if (mask & IFCAP_LRO) { + ifp->if_capenable ^= IFCAP_LRO; + + /* Safe to do this even if cxgb_up not called yet */ + cxgb_set_lro(p, ifp->if_capenable & IFCAP_LRO); + } if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; reinit = ifp->if_drv_flags & IFF_DRV_RUNNING; |