From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 19:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD25CA19 for ; Wed, 6 Aug 2014 19:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 904C22A99 for ; Wed, 6 Aug 2014 19:38:04 +0000 (UTC) Received: from np (uid 1205) (envelope-from np@FreeBSD.org) id 57e5 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 19:38:04 +0000 From: Navdeep Parhar Date: Wed, 6 Aug 2014 19:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269644 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2841c.57e5.7d9ee4dd@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Wed, 06 Aug 2014 19:38:05 -0000 Author: np Date: Wed Aug 6 19:38:03 2014 New Revision: 269644 URL: http://svnweb.freebsd.org/changeset/base/269644 Log: cxgbe(4): Let caller specify whether it's ok to sleep in t4_sched_config and t4_sched_params. MFC after: 2 weeks Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Aug 6 19:34:03 2014 (r269643) +++ head/sys/dev/cxgbe/common/common.h Wed Aug 6 19:38:03 2014 (r269644) @@ -614,8 +614,10 @@ int t4_sge_ctxt_rd_bd(struct adapter *ad int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); -int t4_sched_config(struct adapter *adapter, int type, int minmaxen); +int t4_sched_config(struct adapter *adapter, int type, int minmaxen, + int sleep_ok); int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, - int minrate, int maxrate, int weight, int pktsize); + int minrate, int maxrate, int weight, int pktsize, + int sleep_ok); #endif /* __CHELSIO_COMMON_H */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Aug 6 19:34:03 2014 (r269643) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Aug 6 19:38:03 2014 (r269644) @@ -5717,7 +5717,8 @@ int __devinit t4_port_init(struct port_i return 0; } -int t4_sched_config(struct adapter *adapter, int type, int minmaxen) +int t4_sched_config(struct adapter *adapter, int type, int minmaxen, + int sleep_ok) { struct fw_sched_cmd cmd; @@ -5732,12 +5733,13 @@ int t4_sched_config(struct adapter *adap cmd.u.config.minmaxen = minmaxen; return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), - NULL, 1); + NULL, sleep_ok); } int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, - int minrate, int maxrate, int weight, int pktsize) + int minrate, int maxrate, int weight, int pktsize, + int sleep_ok) { struct fw_sched_cmd cmd; @@ -5761,5 +5763,5 @@ int t4_sched_params(struct adapter *adap cmd.u.params.pktsize = cpu_to_be16(pktsize); return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), - NULL, 1); + NULL, sleep_ok); } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Aug 6 19:34:03 2014 (r269643) +++ head/sys/dev/cxgbe/t4_main.c Wed Aug 6 19:38:03 2014 (r269644) @@ -7617,7 +7617,7 @@ set_sched_class(struct adapter *sc, stru } /* And pass the request to the firmware ...*/ - rc = -t4_sched_config(sc, fw_type, p->u.config.minmax); + rc = -t4_sched_config(sc, fw_type, p->u.config.minmax, 1); goto done; } @@ -7715,7 +7715,7 @@ set_sched_class(struct adapter *sc, stru rc = -t4_sched_params(sc, fw_type, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->u.params.channel, p->u.params.cl, p->u.params.minrate, p->u.params.maxrate, - p->u.params.weight, p->u.params.pktsize); + p->u.params.weight, p->u.params.pktsize, 1); goto done; }