Date: Tue, 7 Jun 2016 07:48:36 +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: r301542 - head/sys/dev/cxgbe Message-ID: <201606070748.u577maaW052558@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Tue Jun 7 07:48:36 2016 New Revision: 301542 URL: https://svnweb.freebsd.org/changeset/base/301542 Log: cxgbe(4): A couple of fixes to set_sched_queue. - Validate the scheduling class against the actual limit (which is chip specific) instead of a magic number. - Return an error if an attempt is made to manipulate the tx queues of a VI that hasn't been initialized. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jun 7 07:04:05 2016 (r301541) +++ head/sys/dev/cxgbe/t4_main.c Tue Jun 7 07:48:36 2016 (r301542) @@ -8575,11 +8575,6 @@ set_sched_queue(struct adapter *sc, stru if (rc) return (rc); - if (!(sc->flags & FULL_INIT_DONE)) { - rc = EAGAIN; - goto done; - } - if (p->port >= sc->params.nports) { rc = EINVAL; goto done; @@ -8588,7 +8583,14 @@ set_sched_queue(struct adapter *sc, stru /* XXX: Only supported for the main VI. */ pi = sc->port[p->port]; vi = &pi->vi[0]; - if (!in_range(p->queue, 0, vi->ntxq - 1) || !in_range(p->cl, 0, 7)) { + if (!(vi->flags & VI_INIT_DONE)) { + /* tx queues not set up yet */ + rc = EAGAIN; + goto done; + } + + if (!in_range(p->queue, 0, vi->ntxq - 1) || + !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) { rc = EINVAL; goto done; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606070748.u577maaW052558>