@@ -457,6 +457,26 @@ operations:
attributes:
- ifindex
reply: *queue-get-op
+ -
+ name: queue-set
+ doc: User configuration of queue attributes.
+ The id, type and ifindex forms the queue header/identifier. Example,
+ to configure the NAPI instance associated with the queue, the napi-id
+ is the configurable attribute.
+ attribute-set: queue
+ do:
+ request:
+ attributes:
+ - ifindex
+ - type
+ - id
+ - napi-id
+ reply: &queue-set-op
+ attributes:
+ - id
+ - type
+ - napi-id
+ - ifindex
-
name: napi-get
doc: Get information about NAPI instances configured on the system.
@@ -162,6 +162,7 @@ enum {
NETDEV_CMD_PAGE_POOL_CHANGE_NTF,
NETDEV_CMD_PAGE_POOL_STATS_GET,
NETDEV_CMD_QUEUE_GET,
+ NETDEV_CMD_QUEUE_SET,
NETDEV_CMD_NAPI_GET,
NETDEV_CMD_QSTATS_GET,
@@ -58,6 +58,14 @@ static const struct nla_policy netdev_queue_get_dump_nl_policy[NETDEV_A_QUEUE_IF
[NETDEV_A_QUEUE_IFINDEX] = NLA_POLICY_MIN(NLA_U32, 1),
};
+/* NETDEV_CMD_QUEUE_SET - do */
+static const struct nla_policy netdev_queue_set_nl_policy[NETDEV_A_QUEUE_NAPI_ID + 1] = {
+ [NETDEV_A_QUEUE_IFINDEX] = NLA_POLICY_MIN(NLA_U32, 1),
+ [NETDEV_A_QUEUE_TYPE] = NLA_POLICY_MAX(NLA_U32, 1),
+ [NETDEV_A_QUEUE_ID] = { .type = NLA_U32, },
+ [NETDEV_A_QUEUE_NAPI_ID] = { .type = NLA_U32, },
+};
+
/* NETDEV_CMD_NAPI_GET - do */
static const struct nla_policy netdev_napi_get_do_nl_policy[NETDEV_A_NAPI_ID + 1] = {
[NETDEV_A_NAPI_ID] = { .type = NLA_U32, },
@@ -129,6 +137,13 @@ static const struct genl_split_ops netdev_nl_ops[] = {
.maxattr = NETDEV_A_QUEUE_IFINDEX,
.flags = GENL_CMD_CAP_DUMP,
},
+ {
+ .cmd = NETDEV_CMD_QUEUE_SET,
+ .doit = netdev_nl_queue_set_doit,
+ .policy = netdev_queue_set_nl_policy,
+ .maxattr = NETDEV_A_QUEUE_NAPI_ID,
+ .flags = GENL_CMD_CAP_DO,
+ },
{
.cmd = NETDEV_CMD_NAPI_GET,
.doit = netdev_nl_napi_get_doit,
@@ -26,6 +26,7 @@ int netdev_nl_page_pool_stats_get_dumpit(struct sk_buff *skb,
int netdev_nl_queue_get_doit(struct sk_buff *skb, struct genl_info *info);
int netdev_nl_queue_get_dumpit(struct sk_buff *skb,
struct netlink_callback *cb);
+int netdev_nl_queue_set_doit(struct sk_buff *skb, struct genl_info *info);
int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info);
int netdev_nl_napi_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb);
int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
@@ -674,6 +674,11 @@ int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
return err;
}
+int netdev_nl_queue_set_doit(struct sk_buff *skb, struct genl_info *info)
+{
+ return -EOPNOTSUPP;
+}
+
static int netdev_genl_netdevice_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
@@ -162,6 +162,7 @@ enum {
NETDEV_CMD_PAGE_POOL_CHANGE_NTF,
NETDEV_CMD_PAGE_POOL_STATS_GET,
NETDEV_CMD_QUEUE_GET,
+ NETDEV_CMD_QUEUE_SET,
NETDEV_CMD_NAPI_GET,
NETDEV_CMD_QSTATS_GET,
Add support in netlink spec(netdev.yaml) for queue-set command. Currently, the set command enables associating a NAPI ID for a queue, but can also be extended to support configuring other attributes. Also, add code generated from the spec. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> --- Documentation/netlink/specs/netdev.yaml | 20 ++++++++++++++++++++ include/uapi/linux/netdev.h | 1 + net/core/netdev-genl-gen.c | 15 +++++++++++++++ net/core/netdev-genl-gen.h | 1 + net/core/netdev-genl.c | 5 +++++ tools/include/uapi/linux/netdev.h | 1 + 6 files changed, 43 insertions(+)