Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / drivers / net / ethernet / amazon / ena / ena_ethtool.c
index fc96c66..b4e891d 100644 (file)
@@ -740,7 +740,9 @@ static int ena_set_channels(struct net_device *netdev,
        struct ena_adapter *adapter = netdev_priv(netdev);
        u32 count = channels->combined_count;
        /* The check for max value is already done in ethtool */
-       if (count < ENA_MIN_NUM_IO_QUEUES)
+       if (count < ENA_MIN_NUM_IO_QUEUES ||
+           (ena_xdp_present(adapter) &&
+           !ena_xdp_legal_queue_count(adapter, channels->combined_count)))
                return -EINVAL;
 
        return ena_update_queue_count(adapter, count);