summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-02-20 06:54:10 +0300
committerDavid S. Miller <davem@davemloft.net>2016-02-20 06:54:10 +0300
commit2f86017748d96723372864c597d08d11c09dd759 (patch)
tree1b44786594f5e6007984be210e3e94d311508076 /include/uapi/linux
parent76d13b568776fdef646c70878de406c90aef46a9 (diff)
parentf3757a4d9e823c43ccfe4db02b6cda77414e25f7 (diff)
downloadlinux-2f86017748d96723372864c597d08d11c09dd759.tar.xz
Merge branch 'ethtool-perqueue-params'
Kan Liang says: ==================== ethtool per queue parameters support Modern network interface controllers usually support multiple receive and transmit queues. Each queue may have its own parameters. For example, Intel XL710/X710 hardware supports per queue interrupt moderation. However, current ethtool does not support per queue parameters option. User has to set parameters for the whole NIC. This series extends ethtool to support per queue parameters option. Since the support of per queue parameters vary with different cards, it is impossible to address all cards in one patch. This series only supports per queue coalesce options on i40e driver. The framework used in the patch can be easily extended to other cards and parameters. The lib bitmap needs to be extended to facilitate exchanging queue bitmaps between user space and kernel space. Two patches from David's latest V8 patch series are also cited in this series. You may refer to https://lkml.org/lkml/2016/2/9/919 for more details. Changes since V6: - Rebase on commit 76d13b568776. Did minor change in patch 6. Changes since V5: - Add test_bitmap.c and bitmap.sh in the series. They are forgot to be added previously. - Update the first two patches to David's latest V8 version. The changes include - bitmap u32 API returns number of bits copied, unit tests updated - module_exit in test_bitmap - Also change the mode of bitmap.sh to 755 according to Ben's suggestion Changes since V4: - Modify set/get_per_queue_coalesce function description - Change the queue number to be u32 - Correct an error of calculating coalesce backup buffer address - Rename queue_num to n_queues - Don't log error message in __i40e_get_coalesce Changes since V3: - Based on David's lib bitmap. - ETHTOOL_PERQUEUE should be handled before the containing switch - Make the rollback code unconditional - some minor changes according to Ben's feedback Changes since V2: - Add queue-specific settings for interrupt moderation in i40e Changes since V1: - Checking the sub-command number to determine whether the command requires CAP_NET_ADMIN - Refine the struct ethtool_per_queue_op and improve the comments - Use bitmap functions to parse queue mask - Improve comments - Use bitmap functions to parse queue mask - Improve comments - Add rollback support - Correct the way to find the vector for specific queue. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/ethtool.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 190aea0faaf4..f15ae02621a1 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1202,6 +1202,21 @@ enum ethtool_sfeatures_retval_bits {
#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
+#define MAX_NUM_QUEUE 4096
+
+/**
+ * struct ethtool_per_queue_op - apply sub command to the queues in mask.
+ * @cmd: ETHTOOL_PERQUEUE
+ * @sub_command: the sub command which apply to each queues
+ * @queue_mask: Bitmap of the queues which sub command apply to
+ * @data: A complete command structure following for each of the queues addressed
+ */
+struct ethtool_per_queue_op {
+ __u32 cmd;
+ __u32 sub_command;
+ __u32 queue_mask[DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
+ char data[];
+};
/* CMDs currently supported */
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
@@ -1285,6 +1300,8 @@ enum ethtool_sfeatures_retval_bits {
#define ETHTOOL_STUNABLE 0x00000049 /* Set tunable configuration */
#define ETHTOOL_GPHYSTATS 0x0000004a /* get PHY-specific statistics */
+#define ETHTOOL_PERQUEUE 0x0000004b /* Set per queue options */
+
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
#define SPARC_ETH_SSET ETHTOOL_SSET