summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amazon/ena/ena_ethtool.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-12-12 17:14:01 -0800
committerDavid S. Miller <davem@davemloft.net>2019-12-12 17:14:01 -0800
commit355979decf07d77e9f1fa59233b1e60ae51e307a (patch)
treeb79569d682e7e8c7c549193a2013ccec8adc16cf /drivers/net/ethernet/amazon/ena/ena_ethtool.c
parentaabf23d18322100720cb40002cdf05397f619914 (diff)
parent913b0bfd6c859aaf1735e1c8c69731e1d5359d31 (diff)
downloadlinux-355979decf07d77e9f1fa59233b1e60ae51e307a.tar.gz
linux-355979decf07d77e9f1fa59233b1e60ae51e307a.tar.bz2
linux-355979decf07d77e9f1fa59233b1e60ae51e307a.zip
Merge branch 'Introduce-XDP-to-ena'
Sameeh Jubran says: ==================== Introduce XDP to ena This patchset includes 3 patches: * XDP_DROP implementation * XDP_TX implementation * A fix for an issue which might occur due to the XDP_TX patch. I see fit to place it as a standalone patch for clarity. Difference from v2: * Fixed the usage of rx headroom (XDP_PACKET_HEADROOM) * Aligned the page_offset of the packet when passing it to the stack * Switched to using xdp_frame in xdp xmit queue * Dropped the print for unsupported commands * Cosmetic changes Difference from RFC v1 (XDP_DROP patch): * Initialized xdp.rxq pointer * Updated max_mtu on attachment of xdp and removed the check from ena_change_mtu() * Moved the xdp execution from ena_rx_skb() to ena_clean_rx_irq() * Moved xdp buff (struct xdp_buff) from rx_ring to the local stack * Started using netlink's extack mechanism to deliver error messages to the user ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amazon/ena/ena_ethtool.c')
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_ethtool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
index a3250dcf7d53..745fffd422aa 100644
--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c
+++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
@@ -744,7 +744,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);