From owner-svn-src-head@freebsd.org Thu Jul 26 06:42:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044B2104438E; Thu, 26 Jul 2018 06:42:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEC77810FC; Thu, 26 Jul 2018 06:42:09 +0000 (UTC) (envelope-from np@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FEA62581A; Thu, 26 Jul 2018 06:42:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6Q6g9m1013514; Thu, 26 Jul 2018 06:42:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6Q6g91q013513; Thu, 26 Jul 2018 06:42:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201807260642.w6Q6g91q013513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 26 Jul 2018 06:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336734 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 336734 X-SVN-Commit-Repository: base 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.27 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, 26 Jul 2018 06:42:10 -0000 Author: np Date: Thu Jul 26 06:42:09 2018 New Revision: 336734 URL: https://svnweb.freebsd.org/changeset/base/336734 Log: cxgbe(4): Better defaults for all cl-rl rate limiters. Start in "class" instead of "flow" mode. This eliminates the need to specify an MTU, which is not available that early anyway. It also allows the user to manually configure ch-rl rate limiting after attach. This used to fail because ch-rl isn't supported if cl-rl "flow" mode is configured. Set all traffic classes to 1Gbps during initialization. The goal is to start off with _any_ valid configuration and 1Gbps works even for gigabit cards. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Thu Jul 26 05:08:58 2018 (r336733) +++ head/sys/dev/cxgbe/t4_sched.c Thu Jul 26 06:42:09 2018 (r336734) @@ -356,24 +356,6 @@ t4_init_tx_sched(struct adapter *sc) const int n = sc->chip_params->nsched_cls; struct port_info *pi; struct tx_cl_rl_params *tc; - static const uint32_t init_kbps[] = { - 100 * 1000, - 200 * 1000, - 400 * 1000, - 500 * 1000, - 800 * 1000, - 1000 * 1000, - 1200 * 1000, - 1500 * 1000, - 1800 * 1000, - 2000 * 1000, - 2500 * 1000, - 3000 * 1000, - 3500 * 1000, - 4000 * 1000, - 5000 * 1000, - 10000 * 1000 - }; mtx_init(&sc->tc_lock, "tx_sched lock", NULL, MTX_DEF); TASK_INIT(&sc->tc_task, 0, update_tx_sched, sc); @@ -386,9 +368,8 @@ t4_init_tx_sched(struct adapter *sc) tc->refcount = 0; tc->ratemode = FW_SCHED_PARAMS_RATE_ABS; tc->rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; - tc->mode = FW_SCHED_PARAMS_MODE_FLOW; - tc->maxrate = init_kbps[min(j, nitems(init_kbps) - 1)]; - tc->pktsize = ETHERMTU; /* XXX */ + tc->mode = FW_SCHED_PARAMS_MODE_CLASS; + tc->maxrate = 1000 * 1000; /* 1 Gbps. Arbitrary */ if (t4_sched_params_cl_rl_kbps(sc, pi->tx_chan, j, tc->mode, tc->maxrate, tc->pktsize, 1) == 0)