On Mon, Jun 25, 2018 at 7:06 PM Amritha Nambiar
<amritha.namb...@intel.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.namb...@intel.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?

Reply via email to