diff options
author | Zbigniew Bodek <zbb@FreeBSD.org> | 2016-02-25 14:21:04 +0000 |
---|---|---|
committer | Zbigniew Bodek <zbb@FreeBSD.org> | 2016-02-25 14:21:04 +0000 |
commit | 6dc234599fe8d1602ad92b38910453547ae8aee7 (patch) | |
tree | ab5699bb1a9eaf4f6e99343336feafec38382ecf /sys/dev/vnic | |
parent | 44f2eb96bd7e367ca8e4387418ab92de9a6280df (diff) | |
download | src-6dc234599fe8d1602ad92b38910453547ae8aee7.tar.gz src-6dc234599fe8d1602ad92b38910453547ae8aee7.zip |
Clean-up network interface settings for VNIC
- Remove unrelevant bits
- Remove redundant code
- Reset variables and then set given bits
Reviewed by: wma
Obtained from: Semihalf
Sponsored by: Cavium
Differential Revision: https://reviews.freebsd.org/D5324
Notes
Notes:
svn path=/head/; revision=296034
Diffstat (limited to 'sys/dev/vnic')
-rw-r--r-- | sys/dev/vnic/nicvf_main.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/dev/vnic/nicvf_main.c b/sys/dev/vnic/nicvf_main.c index a995510eddf9..a0315700f312 100644 --- a/sys/dev/vnic/nicvf_main.c +++ b/sys/dev/vnic/nicvf_main.c @@ -348,27 +348,24 @@ nicvf_setup_ifnet(struct nicvf *nic) if_setinitfn(ifp, nicvf_if_init); if_setgetcounterfn(ifp, nicvf_if_getcounter); - /* Set send queue len to number to default maximum */ - if_setsendqlen(ifp, IFQ_MAXLEN); - if_setsendqready(ifp); if_setmtu(ifp, ETHERMTU); - if_setcapabilities(ifp, IFCAP_VLAN_MTU); + /* Reset caps */ + if_setcapabilities(ifp, 0); + + /* Set the default values */ + if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); - /* - * HW offload capabilities - */ /* IP/TCP/UDP HW checksums */ if_setcapabilitiesbit(ifp, IFCAP_HWCSUM, 0); if_setcapabilitiesbit(ifp, IFCAP_HWSTATS, 0); - if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP), 0); + /* + * HW offload enable + */ + if_clearhwassist(ifp); + if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP), 0); -#ifdef DEVICE_POLLING -#error "DEVICE_POLLING not supported in VNIC driver yet" - if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0); -#endif if_setcapenable(ifp, if_getcapabilities(ifp)); - if_setmtu(ifp, ETHERMTU); return (0); } |