diff options
author | Michael Dalton <mwdalton@google.com> | 2014-01-17 01:23:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-17 02:46:06 -0500 |
commit | a953be53ce40440acb4740edb48577b9468d4c3d (patch) | |
tree | c9bef1d8ce80a7f2dc852f87bcd2a969ef34e1f8 /net/core/dev.c | |
parent | ab7db91705e95ed1bba1304388936fccfa58c992 (diff) |
net-sysfs: add support for device-specific rx queue sysfs attributes
Extend existing support for netdevice receive queue sysfs attributes to
permit a device-specific attribute group. Initial use case for this
support will be to allow the virtio-net device to export per-receive
queue mergeable receive buffer size.
Signed-off-by: Michael Dalton <mwdalton@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index f87bedd51eed..288df6232006 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2083,7 +2083,7 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) | |||
2083 | } | 2083 | } |
2084 | EXPORT_SYMBOL(netif_set_real_num_tx_queues); | 2084 | EXPORT_SYMBOL(netif_set_real_num_tx_queues); |
2085 | 2085 | ||
2086 | #ifdef CONFIG_RPS | 2086 | #ifdef CONFIG_SYSFS |
2087 | /** | 2087 | /** |
2088 | * netif_set_real_num_rx_queues - set actual number of RX queues used | 2088 | * netif_set_real_num_rx_queues - set actual number of RX queues used |
2089 | * @dev: Network device | 2089 | * @dev: Network device |
@@ -5764,7 +5764,7 @@ void netif_stacked_transfer_operstate(const struct net_device *rootdev, | |||
5764 | } | 5764 | } |
5765 | EXPORT_SYMBOL(netif_stacked_transfer_operstate); | 5765 | EXPORT_SYMBOL(netif_stacked_transfer_operstate); |
5766 | 5766 | ||
5767 | #ifdef CONFIG_RPS | 5767 | #ifdef CONFIG_SYSFS |
5768 | static int netif_alloc_rx_queues(struct net_device *dev) | 5768 | static int netif_alloc_rx_queues(struct net_device *dev) |
5769 | { | 5769 | { |
5770 | unsigned int i, count = dev->num_rx_queues; | 5770 | unsigned int i, count = dev->num_rx_queues; |
@@ -6309,7 +6309,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | |||
6309 | return NULL; | 6309 | return NULL; |
6310 | } | 6310 | } |
6311 | 6311 | ||
6312 | #ifdef CONFIG_RPS | 6312 | #ifdef CONFIG_SYSFS |
6313 | if (rxqs < 1) { | 6313 | if (rxqs < 1) { |
6314 | pr_err("alloc_netdev: Unable to allocate device with zero RX queues\n"); | 6314 | pr_err("alloc_netdev: Unable to allocate device with zero RX queues\n"); |
6315 | return NULL; | 6315 | return NULL; |
@@ -6365,7 +6365,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | |||
6365 | if (netif_alloc_netdev_queues(dev)) | 6365 | if (netif_alloc_netdev_queues(dev)) |
6366 | goto free_all; | 6366 | goto free_all; |
6367 | 6367 | ||
6368 | #ifdef CONFIG_RPS | 6368 | #ifdef CONFIG_SYSFS |
6369 | dev->num_rx_queues = rxqs; | 6369 | dev->num_rx_queues = rxqs; |
6370 | dev->real_num_rx_queues = rxqs; | 6370 | dev->real_num_rx_queues = rxqs; |
6371 | if (netif_alloc_rx_queues(dev)) | 6371 | if (netif_alloc_rx_queues(dev)) |
@@ -6385,7 +6385,7 @@ free_all: | |||
6385 | free_pcpu: | 6385 | free_pcpu: |
6386 | free_percpu(dev->pcpu_refcnt); | 6386 | free_percpu(dev->pcpu_refcnt); |
6387 | netif_free_tx_queues(dev); | 6387 | netif_free_tx_queues(dev); |
6388 | #ifdef CONFIG_RPS | 6388 | #ifdef CONFIG_SYSFS |
6389 | kfree(dev->_rx); | 6389 | kfree(dev->_rx); |
6390 | #endif | 6390 | #endif |
6391 | 6391 | ||
@@ -6410,7 +6410,7 @@ void free_netdev(struct net_device *dev) | |||
6410 | release_net(dev_net(dev)); | 6410 | release_net(dev_net(dev)); |
6411 | 6411 | ||
6412 | netif_free_tx_queues(dev); | 6412 | netif_free_tx_queues(dev); |
6413 | #ifdef CONFIG_RPS | 6413 | #ifdef CONFIG_SYSFS |
6414 | kfree(dev->_rx); | 6414 | kfree(dev->_rx); |
6415 | #endif | 6415 | #endif |
6416 | 6416 | ||