Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lkl: Minor cleanup to virtio_net #89

Merged
1 commit merged into from
Feb 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/lkl/lib/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define RX_QUEUE_IDX 0
#define TX_QUEUE_IDX 1
#define NUM_QUEUES (TX_QUEUE_IDX + 1)
#define QUEUE_DEPTH 32

#ifdef DEBUG
#define bad_request(s) do { \
Expand Down Expand Up @@ -143,11 +144,10 @@ static struct lkl_mutex_t **init_queue_locks(int num_queues)
if (!ret)
return NULL;

memset(ret, 0, sizeof(struct lkl_mutex_t*) * num_queues);
for (i = 0; i < num_queues; i++) {
ret[i] = lkl_host_ops.mutex_alloc();
if (!ret[i]) {
free_queue_locks(ret, num_queues);
free_queue_locks(ret, i);
return NULL;
}
}
Expand Down Expand Up @@ -193,7 +193,7 @@ int lkl_netdev_add(union lkl_netdev nd, void *mac)
* could init the queues in virtio_dev_setup to help enforce
* this, but netdevs are the only flavor that need these
* locks, so it's better to do it here. */
ret = virtio_dev_setup(&dev->dev, NUM_QUEUES, 32);
ret = virtio_dev_setup(&dev->dev, NUM_QUEUES, QUEUE_DEPTH);

if (ret)
goto out_free;
Expand Down