Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset ee0c03a in mainline


Ignore:
Timestamp:
2018-05-22T19:06:50Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
5b5c286
Parents:
7bf16b7e
git-author:
Jakub Jermar <jakub@…> (2018-05-20 10:33:15)
git-committer:
Jakub Jermar <jakub@…> (2018-05-22 19:06:50)
Message:

Require at least the specified queue size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/virtio/virtio.c

    r7bf16b7e ree0c03a  
    4747
    4848        /* Trim the size of the queue as needed */
    49         size = min(pio_read_16(&cfg->queue_size), size);
     49        if (size > pio_read_16(&cfg->queue_size)) {
     50                ddf_msg(LVL_ERROR, "Virtq %u: not enough descriptors", num);
     51                return ENOMEM;
     52        }
    5053        pio_write_16(&cfg->queue_size, size);
    51         ddf_msg(LVL_NOTE, "Virtq %u: %u buffers", num, (unsigned) size);
     54        ddf_msg(LVL_NOTE, "Virtq %u: %u descriptors", num, (unsigned) size);
    5255
    5356        size_t avail_offset = 0;
Note: See TracChangeset for help on using the changeset viewer.