@@ -55,6 +55,20 @@ get_netdev_rx_queue_index(struct netdev_rx_queue *queue)
return index;
}
+static inline bool netdev_devmem_enabled(struct net_device *dev)
+{
+ struct netdev_rx_queue *queue;
+ int i;
+
+ for (i = 0; i < dev->real_num_rx_queues; i++) {
+ queue = __netif_get_rx_queue(dev, i);
+ if (queue->mp_params.mp_priv)
+ return true;
+ }
+
+ return false;
+}
+
int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq);
#endif
@@ -5,6 +5,7 @@
#include <linux/netdevice.h>
#include <linux/ethtool.h>
+#include <net/netdev_rx_queue.h>
#define ETHTOOL_DEV_FEATURE_WORDS DIV_ROUND_UP(NETDEV_FEATURE_COUNT, 32)
@@ -258,6 +258,19 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)
return -ERANGE;
}
+ if (netdev_devmem_enabled(dev)) {
+ if (kernel_ringparam.tcp_data_split !=
+ ETHTOOL_TCP_DATA_SPLIT_ENABLED) {
+ NL_SET_ERR_MSG(info->extack,
+ "tcp-data-split should be enabled while devmem is running");
+ return -EINVAL;
+ } else if (kernel_ringparam.hds_thresh) {
+ NL_SET_ERR_MSG(info->extack,
+ "header-data-split-thresh should be zero while devmem is running");
+ return -EINVAL;
+ }
+ }
+
/* ensure new ring parameters are within limits */
if (ringparam.rx_pending > ringparam.rx_max_pending)
err_attr = tb[ETHTOOL_A_RINGS_RX];