]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/uapi/linux/ethtool.h
Merge tag 'dmaengine-4.2-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[karo-tx-linux.git] / include / uapi / linux / ethtool.h
index ae832b45b44c01fe149547eb07734865dabcd478..cd67aec187d9fab31aacba01974b8f2d145b393e 100644 (file)
@@ -215,6 +215,11 @@ enum tunable_id {
        ETHTOOL_ID_UNSPEC,
        ETHTOOL_RX_COPYBREAK,
        ETHTOOL_TX_COPYBREAK,
+       /*
+        * Add your fresh new tubale attribute above and remember to update
+        * tunable_strings[] in net/core/ethtool.c
+        */
+       __ETHTOOL_TUNABLE_COUNT,
 };
 
 enum tunable_type_id {
@@ -545,6 +550,7 @@ enum ethtool_stringset {
        ETH_SS_NTUPLE_FILTERS,
        ETH_SS_FEATURES,
        ETH_SS_RSS_HASH_FUNCS,
+       ETH_SS_TUNABLES,
 };
 
 /**
@@ -796,6 +802,31 @@ struct ethtool_rx_flow_spec {
        __u32           location;
 };
 
+/* How rings are layed out when accessing virtual functions or
+ * offloaded queues is device specific. To allow users to do flow
+ * steering and specify these queues the ring cookie is partitioned
+ * into a 32bit queue index with an 8 bit virtual function id.
+ * This also leaves the 3bytes for further specifiers. It is possible
+ * future devices may support more than 256 virtual functions if
+ * devices start supporting PCIe w/ARI. However at the moment I
+ * do not know of any devices that support this so I do not reserve
+ * space for this at this time. If a future patch consumes the next
+ * byte it should be aware of this possiblity.
+ */
+#define ETHTOOL_RX_FLOW_SPEC_RING      0x00000000FFFFFFFFLL
+#define ETHTOOL_RX_FLOW_SPEC_RING_VF   0x000000FF00000000LL
+#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
+static inline __u64 ethtool_get_flow_spec_ring(__u64 ring_cookie)
+{
+       return ETHTOOL_RX_FLOW_SPEC_RING & ring_cookie;
+};
+
+static inline __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
+{
+       return (ETHTOOL_RX_FLOW_SPEC_RING_VF & ring_cookie) >>
+                               ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
+};
+
 /**
  * struct ethtool_rxnfc - command to get or set RX flow classification rules
  * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,