Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Aug 2014 19:38:04 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
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
Message-ID:  <53e2841c.57e5.7d9ee4dd@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e2841c.57e5.7d9ee4dd>