[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c0a84563-9840-d188-5d52-fc4e9e8b5f48@intel.com>
Date: Tue, 26 Jun 2018 17:21:17 -0700
From: "Nambiar, Amritha" <amritha.nambiar@...el.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.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 6/26/2018 3:55 AM, Willem de Bruijn wrote:
> 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?
>
Will change this to ns_capable.
Powered by blists - more mailing lists