[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-JG_HtSarajsbPQYrMQp+ftwNTkqLVxtFBCB1VCzsgC0Q@mail.gmail.com>
Date: Tue, 26 Jun 2018 06:55:09 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Amritha Nambiar <amritha.nambiar@...el.com>
Cc: Network Development <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Alexander Duyck <alexander.h.duyck@...el.com>,
"Samudrala, Sridhar" <sridhar.samudrala@...el.com>,
Alexander Duyck <alexander.duyck@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Hannes Frederic Sowa <hannes@...essinduktion.org>,
Tom Herbert <tom@...bertland.com>
Subject: Re: [net-next PATCH v4 6/7] net-sysfs: Add interface for Rx queue(s)
map per Tx queue
On Mon, Jun 25, 2018 at 7:06 PM Amritha Nambiar
<amritha.nambiar@...el.com> wrote:
>
> Extend transmit queue sysfs attribute to configure Rx queue(s) map
> per Tx queue. By default no receive queues are configured for the
> Tx queue.
>
> - /sys/class/net/eth0/queues/tx-*/xps_rxqs
>
> Signed-off-by: Amritha Nambiar <amritha.nambiar@...el.com>
> ---
> +static ssize_t xps_rxqs_show(struct netdev_queue *queue, char *buf)
> +{
> + struct net_device *dev = queue->dev;
> + struct xps_dev_maps *dev_maps;
> + unsigned long *mask, index;
> + int j, len, num_tc = 1, tc = 0;
> +
> + mask = kcalloc(BITS_TO_LONGS(dev->num_rx_queues), sizeof(long),
> + GFP_KERNEL);
> + if (!mask)
> + return -ENOMEM;
> +
> + index = get_netdev_queue_index(queue);
> +
> + if (dev->num_tc) {
> + num_tc = dev->num_tc;
> + tc = netdev_txq_to_tc(dev, index);
> + if (tc < 0)
> + return -EINVAL;
Must free mask
> +static ssize_t xps_rxqs_store(struct netdev_queue *queue, const char *buf,
> + size_t len)
> +{
> + struct net_device *dev = queue->dev;
> + unsigned long *mask, index;
> + int err;
> +
> + if (!capable(CAP_NET_ADMIN))
> + return -EPERM;
ns_capable?
Powered by blists - more mailing lists