From owner-svn-src-stable@freebsd.org Tue Aug 4 04:00:38 2015 Return-Path: Delivered-To: svn-src-stable@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 48B609B311F; Tue, 4 Aug 2015 04:00:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2BC1D1AE8; Tue, 4 Aug 2015 04:00:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7440cGn079495; Tue, 4 Aug 2015 04:00:38 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7440bDv079492; Tue, 4 Aug 2015 04:00:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201508040400.t7440bDv079492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Aug 2015 04:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286274 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 04:00:38 -0000 Author: np Date: Tue Aug 4 04:00:36 2015 New Revision: 286274 URL: https://svnweb.freebsd.org/changeset/base/286274 Log: MFC r284988, r285220, and r285221. r284988: cxgbe(4): request an automatic tx update when a netmap tx queue idles. The NIC tx queues already do this. r285220: cxgbe(4): Do not override the the global defaults for congestion drops. The hw.cxgbe.cong_drop knob is not affected by this change because the driver sets up congestion drop on a per-queue basis. r285221: cxgbe(4): Add a new knob that controls the congestion response of netmap rx queues. The default is to drop rather than backpressure. This decouples the congestion settings of NIC and netmap rx queues. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_netmap.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue Aug 4 03:43:09 2015 (r286273) +++ stable/10/sys/dev/cxgbe/adapter.h Tue Aug 4 04:00:36 2015 (r286274) @@ -1045,7 +1045,7 @@ void t4_update_fl_bufsize(struct ifnet * int parse_pkt(struct mbuf **); void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); -int tnl_cong(struct port_info *); +int tnl_cong(struct port_info *, int); /* t4_tracer.c */ struct t4_tracer; Modified: stable/10/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_netmap.c Tue Aug 4 03:43:09 2015 (r286273) +++ stable/10/sys/dev/cxgbe/t4_netmap.c Tue Aug 4 04:00:36 2015 (r286274) @@ -77,6 +77,15 @@ int holdoff_tmr_idx = 2; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CTLFLAG_RWTUN, &holdoff_tmr_idx, 0, "Holdoff timer index for netmap rx queues."); +/* + * Congestion drops. + * -1: no congestion feedback (not recommended). + * 0: backpressure the channel instead of dropping packets right away. + * 1: no backpressure, drop packets for the congested queue immediately. + */ +static int nm_cong_drop = 1; +TUNABLE_INT("hw.cxgbe.nm_cong_drop", &nm_cong_drop); + /* netmap ifnet routines */ static void cxgbe_nm_init(void *); static int cxgbe_nm_ioctl(struct ifnet *, unsigned long, caddr_t); @@ -405,8 +414,8 @@ alloc_nm_txq_hwq(struct port_info *pi, s V_FW_EQ_ETH_CMD_VFN(0)); c.alloc_to_len16 = htobe32(F_FW_EQ_ETH_CMD_ALLOC | F_FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c)); - c.autoequiqe_to_viid = htobe32(F_FW_EQ_ETH_CMD_AUTOEQUEQE | - V_FW_EQ_ETH_CMD_VIID(pi->nm_viid)); + c.autoequiqe_to_viid = htobe32(F_FW_EQ_ETH_CMD_AUTOEQUIQE | + F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(pi->nm_viid)); c.fetchszm_to_iqid = htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | @@ -503,7 +512,7 @@ cxgbe_netmap_on(struct adapter *sc, stru nm_set_native_flags(na); for_each_nm_rxq(pi, i, nm_rxq) { - alloc_nm_rxq_hwq(pi, nm_rxq, tnl_cong(pi)); + alloc_nm_rxq_hwq(pi, nm_rxq, tnl_cong(pi, nm_cong_drop)); nm_rxq->fl_hwidx = hwidx; slot = netmap_reset(na, NR_RX, i, 0); MPASS(slot != NULL); /* XXXNM: error check, not assert */ Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Tue Aug 4 03:43:09 2015 (r286273) +++ stable/10/sys/dev/cxgbe/t4_sge.c Tue Aug 4 04:00:36 2015 (r286274) @@ -471,12 +471,6 @@ t4_tweak_chip_settings(struct adapter *s V_TIMERVALUE5(us_to_core_ticks(sc, intr_timer[5])); t4_write_reg(sc, A_SGE_TIMER_VALUE_4_AND_5, v); - if (cong_drop == 0) { - m = F_TUNNELCNGDROP0 | F_TUNNELCNGDROP1 | F_TUNNELCNGDROP2 | - F_TUNNELCNGDROP3; - t4_set_reg_field(sc, A_TP_PARA_REG3, m, 0); - } - /* 4K, 16K, 64K, 256K DDP "page sizes" */ v = V_HPZ0(0) | V_HPZ1(2) | V_HPZ2(4) | V_HPZ3(6); t4_write_reg(sc, A_ULP_RX_TDDP_PSZ, v); @@ -684,17 +678,6 @@ t4_read_chip_settings(struct adapter *sc s->timer_val[4] = G_TIMERVALUE4(r) / core_ticks_per_usec(sc); s->timer_val[5] = G_TIMERVALUE5(r) / core_ticks_per_usec(sc); - if (cong_drop == 0) { - m = F_TUNNELCNGDROP0 | F_TUNNELCNGDROP1 | F_TUNNELCNGDROP2 | - F_TUNNELCNGDROP3; - r = t4_read_reg(sc, A_TP_PARA_REG3); - if (r & m) { - device_printf(sc->dev, - "invalid TP_PARA_REG3(0x%x)\n", r); - rc = EINVAL; - } - } - v = V_HPZ0(0) | V_HPZ1(2) | V_HPZ2(4) | V_HPZ3(6); r = t4_read_reg(sc, A_ULP_RX_TDDP_PSZ); if (r != v) { @@ -2915,12 +2898,12 @@ free_mgmtq(struct adapter *sc) } int -tnl_cong(struct port_info *pi) +tnl_cong(struct port_info *pi, int drop) { - if (cong_drop == -1) + if (drop == -1) return (-1); - else if (cong_drop == 1) + else if (drop == 1) return (0); else return (pi->rx_chan_map); @@ -2934,7 +2917,8 @@ alloc_rxq(struct port_info *pi, struct s struct sysctl_oid_list *children; char name[16]; - rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx, tnl_cong(pi)); + rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx, + tnl_cong(pi, cong_drop)); if (rc != 0) return (rc);