diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2018-08-30 14:23:08 -0600 |
---|---|---|
committer | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2018-09-06 16:44:04 -0600 |
commit | cf3f8909a75ed27a887f0180d752ea1c4401cc86 (patch) | |
tree | a6ad7d11caaa5a8318514c90af9daf8b6fcf6c08 | |
parent | 85a5f41ed3ea90623b5eac4519af6550a1b97027 (diff) |
librmnetctl: Enable multiqueue TX for rmnet devices
Create 10 queues for multiqueue rmnet devices.
This is needed to manage flows more precisely at rmnet
layer rather than at a custom classful qdisc.
CRs-fixed: 2308858
Change-Id: I26bfc1b3f8b85e787d40af7a25abdb5f628fa7d8
-rw-r--r-- | rmnetctl/src/librmnetctl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rmnetctl/src/librmnetctl.c b/rmnetctl/src/librmnetctl.c index d621f43..fa034cc 100644 --- a/rmnetctl/src/librmnetctl.c +++ b/rmnetctl/src/librmnetctl.c @@ -96,6 +96,13 @@ struct nlmsg { char data[NLMSG_DATA_SIZE]; }; +#define RMNETCTL_NUM_TX_QUEUES 10 + +/* This needs to be hardcoded here because some legacy linux systems + * do not have this definition + */ +#define RMNET_IFLA_NUM_TX_QUEUES 31 + /*=========================================================================== LOCAL FUNCTION DEFINITIONS ===========================================================================*/ @@ -1160,6 +1167,14 @@ int rtrmnet_ctl_newvnd(rmnetctl_hndl_t *hndl, char *devname, char *vndname, req.nl_addr.nlmsg_len = NLMSG_ALIGN(req.nl_addr.nlmsg_len) + RTA_ALIGN(RTA_LENGTH(sizeof(val))); + attrinfo = (struct rtattr *)(((char *)&req) + + NLMSG_ALIGN(req.nl_addr.nlmsg_len)); + attrinfo->rta_type = RMNET_IFLA_NUM_TX_QUEUES; + attrinfo->rta_len = RTA_LENGTH(4); + *(int *)RTA_DATA(attrinfo) = RMNETCTL_NUM_TX_QUEUES; + req.nl_addr.nlmsg_len = NLMSG_ALIGN(req.nl_addr.nlmsg_len) + + RTA_ALIGN(RTA_LENGTH((4))); + /* Set up IFLA info kind RMNET that has linkinfo and type */ attrinfo = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.nl_addr.nlmsg_len)); |