Date: Mon, 11 Apr 2016 06:31:52 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297809 - head/sys/dev/hyperv/netvsc Message-ID: <201604110631.u3B6VqcT027423@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Mon Apr 11 06:31:52 2016 New Revision: 297809 URL: https://svnweb.freebsd.org/changeset/base/297809 Log: hyperv/hn: Cap default # of rings to 8. 8 gives the best performance in both Azure and local Hyper-V on both 10Ge and 40Ge. More rings are still allowed by manual configuration. Reviewed by: Dexuan Cui <decui microsoft com> MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5879 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 11 06:22:26 2016 (r297808) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 11 06:31:52 2016 (r297809) @@ -136,6 +136,8 @@ __FBSDID("$FreeBSD$"); #define HN_LROENT_CNT_DEF 128 +#define HN_RING_CNT_DEF_MAX 8 + #define HN_RNDIS_MSG_LEN \ (sizeof(rndis_msg) + \ RNDIS_HASH_PPI_SIZE + \ @@ -460,8 +462,14 @@ netvsc_attach(device_t dev) * The # of RX rings to use is same as the # of channels to use. */ ring_cnt = hn_chan_cnt; - if (ring_cnt <= 0 || ring_cnt > mp_ncpus) + if (ring_cnt <= 0) { + /* Default */ + ring_cnt = mp_ncpus; + if (ring_cnt > HN_RING_CNT_DEF_MAX) + ring_cnt = HN_RING_CNT_DEF_MAX; + } else if (ring_cnt > mp_ncpus) { ring_cnt = mp_ncpus; + } tx_ring_cnt = hn_tx_ring_cnt; if (tx_ring_cnt <= 0 || tx_ring_cnt > ring_cnt)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604110631.u3B6VqcT027423>