aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/fsl-dpaa2
diff options
context:
space:
mode:
authorGravatar Ioana Radulescu <ruxandra.radulescu@nxp.com> 2017-06-06 10:00:41 -0500
committerGravatar Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2017-06-13 12:04:38 +0200
commitbb5b42c0d8d2352a266b19abb29db7c566a4a707 (patch)
treebb0804d364cb88f45f00f1403f2d14700b9f4af7 /drivers/staging/fsl-dpaa2
parentstaging: fsl-dpaa2/eth: Refactor MAC address setup (diff)
downloadlinux-bb5b42c0d8d2352a266b19abb29db7c566a4a707.tar.gz
linux-bb5b42c0d8d2352a266b19abb29db7c566a4a707.tar.bz2
linux-bb5b42c0d8d2352a266b19abb29db7c566a4a707.zip
staging: fsl-dpaa2/eth: Update number of netdev queues
Currently, the netdevice is allocated with a default number of Rx/Tx queues equal to CONFIG_NR_CPUS, meaning the maximum number of cores supported by the current kernel. The actual number of queues is reflected by the DPNI object attribute, so update the netdevice configuration based on that. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-dpaa2')
-rw-r--r--drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index e674a01ce09d..1f89274a03d3 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -2232,6 +2232,7 @@ static int netdev_init(struct net_device *net_dev)
struct device *dev = net_dev->dev.parent;
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
u8 bcast_addr[ETH_ALEN];
+ u8 num_queues;
int err;
net_dev->netdev_ops = &dpaa2_eth_ops;
@@ -2257,6 +2258,19 @@ static int netdev_init(struct net_device *net_dev)
net_dev->min_mtu = 68;
net_dev->max_mtu = DPAA2_ETH_MAX_MTU;
+ /* Set actual number of queues in the net device */
+ num_queues = dpaa2_eth_queue_count(priv);
+ err = netif_set_real_num_tx_queues(net_dev, num_queues);
+ if (err) {
+ dev_err(dev, "netif_set_real_num_tx_queues() failed\n");
+ return err;
+ }
+ err = netif_set_real_num_rx_queues(net_dev, num_queues);
+ if (err) {
+ dev_err(dev, "netif_set_real_num_rx_queues() failed\n");
+ return err;
+ }
+
/* Our .ndo_init will be called herein */
err = register_netdev(net_dev);
if (err < 0) {