From cf3f8909a75ed27a887f0180d752ea1c4401cc86 Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Thu, 30 Aug 2018 14:23:08 -0600 Subject: [PATCH] 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 --- rmnetctl/src/librmnetctl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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));