From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next RFC 3/7] devlink: Add port param set command Date: Wed, 5 Dec 2018 13:13:34 +0100 Message-ID: <20181205121334.GD2318@nanopsycho> References: <1543989420-14859-1-git-send-email-vasundhara-v.volam@broadcom.com> <1543989420-14859-4-git-send-email-vasundhara-v.volam@broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, michael.chan@broadcom.com, jiri@mellanox.com, netdev@vger.kernel.org To: Vasundhara Volam Return-path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:35320 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbeLEMUk (ORCPT ); Wed, 5 Dec 2018 07:20:40 -0500 Received: by mail-wr1-f67.google.com with SMTP id 96so19494845wrb.2 for ; Wed, 05 Dec 2018 04:20:39 -0800 (PST) Content-Disposition: inline In-Reply-To: <1543989420-14859-4-git-send-email-vasundhara-v.volam@broadcom.com> Sender: netdev-owner@vger.kernel.org List-ID: Wed, Dec 05, 2018 at 06:56:56AM CET, vasundhara-v.volam@broadcom.com wrote: >Add port param set command to set the value for a parameter. >Value can be set to any of the supported configuration modes. > >Cc: Jiri Pirko >Signed-off-by: Vasundhara Volam >--- > include/uapi/linux/devlink.h | 1 + > net/core/devlink.c | 41 ++++++++++++++++++++++++++++++++++------- > 2 files changed, 35 insertions(+), 7 deletions(-) > >diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h >index f96e052..8f3c5dd 100644 >--- a/include/uapi/linux/devlink.h >+++ b/include/uapi/linux/devlink.h >@@ -84,6 +84,7 @@ enum devlink_command { > DEVLINK_CMD_PARAM_DEL, > > DEVLINK_CMD_PORT_PARAM_GET, /* can dump */ >+ DEVLINK_CMD_PORT_PARAM_SET, Same note as for the previous patch. > > DEVLINK_CMD_REGION_GET, > DEVLINK_CMD_REGION_SET, >diff --git a/net/core/devlink.c b/net/core/devlink.c >index 8653fb5..10e1c45 100644 >--- a/net/core/devlink.c >+++ b/net/core/devlink.c >@@ -3096,19 +3096,20 @@ static int devlink_nl_cmd_param_get_doit(struct sk_buff *skb, > return genlmsg_reply(msg, info); > } > >-static int devlink_nl_cmd_param_set_doit(struct sk_buff *skb, >- struct genl_info *info) >+static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink, >+ struct list_head *param_list, >+ struct genl_info *info, >+ enum devlink_command cmd) > { >- struct devlink *devlink = info->user_ptr[0]; >+ struct devlink_param_item *param_item; > enum devlink_param_type param_type; > struct devlink_param_gset_ctx ctx; >- enum devlink_param_cmode cmode; >- struct devlink_param_item *param_item; > const struct devlink_param *param; > union devlink_param_value value; >+ enum devlink_param_cmode cmode; Don't move the things around for no good reason. In case you want to make our reverse-Christmas-tree obsession satisfied, do it in a separate patch :) [...]