From a24889f942c3627c9204f1ad1e47a53afb67b790 Mon Sep 17 00:00:00 2001 From: np Date: Wed, 6 Aug 2014 19:38:03 +0000 Subject: [PATCH] cxgbe(4): Let caller specify whether it's ok to sleep in t4_sched_config and t4_sched_params. MFC after: 2 weeks --- sys/dev/cxgbe/common/common.h | 6 ++++-- sys/dev/cxgbe/common/t4_hw.c | 10 ++++++---- sys/dev/cxgbe/t4_main.c | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index dc499d05ef08..7a88462a2c5b 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -614,8 +614,10 @@ int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type cty 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 */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index c46de60416aa..2935efbc4fe7 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -5717,7 +5717,8 @@ int __devinit t4_port_init(struct port_info *p, int mbox, int pf, int vf) 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 *adapter, int type, int minmaxen) 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 *adapter, int type, int level, int mode, cmd.u.params.pktsize = cpu_to_be16(pktsize); return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), - NULL, 1); + NULL, sleep_ok); } diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index caa7b0683a7b..437b2a4dd3b2 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7617,7 +7617,7 @@ set_sched_class(struct adapter *sc, struct t4_sched_params *p) } /* 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, struct t4_sched_params *p) 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; }