From owner-svn-src-head@freebsd.org Thu Feb 25 14:21:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1EFCAAFDBD; Thu, 25 Feb 2016 14:21:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2E212D1; Thu, 25 Feb 2016 14:21:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PEL4pi060617; Thu, 25 Feb 2016 14:21:04 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PEL4jS060616; Thu, 25 Feb 2016 14:21:04 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201602251421.u1PEL4jS060616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 25 Feb 2016 14:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296034 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 14:21:05 -0000 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); }