From owner-svn-src-head@freebsd.org Mon Jul 6 20:57:01 2015 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 51FDF995BBF; Mon, 6 Jul 2015 20:57:01 +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 319101940; Mon, 6 Jul 2015 20:57:01 +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 t66Kv1p4090818; Mon, 6 Jul 2015 20:57:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t66Kv0b5090813; Mon, 6 Jul 2015 20:57:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201507062057.t66Kv0b5090813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Jul 2015 20:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285221 - head/sys/dev/cxgbe 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: Mon, 06 Jul 2015 20:57:01 -0000 Author: np Date: Mon Jul 6 20:56:59 2015 New Revision: 285221 URL: https://svnweb.freebsd.org/changeset/base/285221 Log: 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. MFC after: 3 days Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Jul 6 20:28:42 2015 (r285220) +++ head/sys/dev/cxgbe/adapter.h Mon Jul 6 20:56:59 2015 (r285221) @@ -1052,7 +1052,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: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Mon Jul 6 20:28:42 2015 (r285220) +++ head/sys/dev/cxgbe/t4_netmap.c Mon Jul 6 20:56:59 2015 (r285221) @@ -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); @@ -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: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Jul 6 20:28:42 2015 (r285220) +++ head/sys/dev/cxgbe/t4_sge.c Mon Jul 6 20:56:59 2015 (r285221) @@ -2903,12 +2903,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); @@ -2922,7 +2922,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);