Date: Thu, 25 Feb 2016 14:21:04 +0000 (UTC) From: Zbigniew Bodek <zbb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296034 - head/sys/dev/vnic Message-ID: <201602251421.u1PEL4jS060616@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: zbb Date: Thu Feb 25 14:21:04 2016 New Revision: 296034 URL: https://svnweb.freebsd.org/changeset/base/296034 Log: 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 Modified: head/sys/dev/vnic/nicvf_main.c Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:19:02 2016 (r296033) +++ head/sys/dev/vnic/nicvf_main.c Thu Feb 25 14:21:04 2016 (r296034) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602251421.u1PEL4jS060616>