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
This commit is contained in:
parent
1830617ec9
commit
468646f716
@ -8575,11 +8575,6 @@ set_sched_queue(struct adapter *sc, struct t4_sched_queue *p)
|
||||
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, struct t4_sched_queue *p)
|
||||
/* 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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user