Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp701134imm; Wed, 4 Jul 2018 04:34:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcDhmEGiQ7ZE9WNQRH4C7iM6Ee7jMCvl+itT+LMvZOtKMsFVqu+gloXn8dK638KS8yYMSlv X-Received: by 2002:a17:902:be18:: with SMTP id r24-v6mr595574pls.268.1530704064858; Wed, 04 Jul 2018 04:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530704064; cv=none; d=google.com; s=arc-20160816; b=FkqVLbaphJeCfp24+m4Xfc8+K/hsWRH3Rpw1+rfWLG89rCazKb2p7Ld6Nq8fBjp3Fc 5PtRv8HffG8KNaWa/4+uTSYj6LmcYhfvE/vqeplcDa7mOvXchFWlz9G4JYzVFvxtlqTy WUV6v74qUYBxDdhoOcJCCPpKMxwFfGAPZ/uZjRaucH2q7NTI6XL4y+f4dXMgXxsz0KBp YfxhKAMyhtwzJgB11+BmvZBnygJb/6yO7xq0S8aupa1m34WnKyZcwFAs+9sIUbeAsjTe Fo/23A9vjsqlULi+GodjafBGCRtW4Mxs8RGpCUMoIu+Ju4BiRkFyuNnV8zQijnd/i4bT Zn+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=yCThrKCEgp4in6Dy9vaiiq5gpGU7d5S3KskhYqQh9nY=; b=VwGp8RJnMOUmsS7pzypfKgYk00EdxzxAJiJd7ntWAM5GGv4aBEuvRGpnR0UXKqFEpl luq/PfVxmjt12qNJhJJjZhfGzFYnzm2i+MaoMRTiTv7Bx+KXRYff5KIap0DsbFSfhEyV eTPFQ3DN30BoZjulKqr+kHHi0JK01SXss2uqU3NkIFxLvWReKixAWGFbwbG/+0m8ZAHL iKSGH+hqVofQJrhQVup39XrOAAiWSYd1h6zGcotuVPIUg7/qA6VN/Li3uP0u59sXh8bt vTeztwnXOmhjHC3KQKA8GcEJ9Q4K0JJx9F/FFNLIJ2jpvZOvITigDqNBqcXl5VQ3T9JX NV/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12-v6si3515664pfk.156.2018.07.04.04.34.10; Wed, 04 Jul 2018 04:34:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934427AbeGDLcO (ORCPT + 99 others); Wed, 4 Jul 2018 07:32:14 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:46035 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934117AbeGDLbY (ORCPT ); Wed, 4 Jul 2018 07:31:24 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with ESMTPS (AES256-SHA encrypted); 4 Jul 2018 14:34:10 +0300 Received: from dev-l-vrt-136.mtl.labs.mlnx (dev-l-vrt-136.mtl.labs.mlnx [10.134.136.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w64BVL0k031428; Wed, 4 Jul 2018 14:31:21 +0300 Received: from dev-l-vrt-136.mtl.labs.mlnx (localhost [127.0.0.1]) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7) with ESMTP id w64BVLU7024659; Wed, 4 Jul 2018 14:31:21 +0300 Received: (from moshe@localhost) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id w64BVLoj024658; Wed, 4 Jul 2018 14:31:21 +0300 From: Moshe Shemesh To: "David S. Miller" Cc: Vasundhara Volam , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 09/10] devlink: Add enable_sriov boolean generic parameter Date: Wed, 4 Jul 2018 14:30:36 +0300 Message-Id: <1530703837-24563-10-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1530703837-24563-1-git-send-email-moshe@mellanox.com> References: <1530703837-24563-1-git-send-email-moshe@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasundhara Volam enable_sriov - Enables Single-Root Input/Output Virtualization(SR-IOV) characteristic of the device. Reviewed-by: Michael Chan Signed-off-by: Vasundhara Volam Signed-off-by: Jiri Pirko --- include/net/devlink.h | 4 ++++ net/core/devlink.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/net/devlink.h b/include/net/devlink.h index a1c230d..8ed57138 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -358,6 +358,7 @@ struct devlink_param_item { enum devlink_param_generic_id { DEVLINK_PARAM_GENERIC_ID_INT_ERR_RESET, DEVLINK_PARAM_GENERIC_ID_MAX_MACS, + DEVLINK_PARAM_GENERIC_ID_ENABLE_SRIOV, /* add new param generic ids above here*/ __DEVLINK_PARAM_GENERIC_ID_MAX, @@ -370,6 +371,9 @@ enum devlink_param_generic_id { #define DEVLINK_PARAM_GENERIC_MAX_MACS_NAME "max_macs" #define DEVLINK_PARAM_GENERIC_MAX_MACS_TYPE DEVLINK_PARAM_TYPE_U32 +#define DEVLINK_PARAM_GENERIC_ENABLE_SRIOV_NAME "enable_sriov" +#define DEVLINK_PARAM_GENERIC_ENABLE_SRIOV_TYPE DEVLINK_PARAM_TYPE_BOOL + #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \ { \ .id = DEVLINK_PARAM_GENERIC_ID_##_id, \ diff --git a/net/core/devlink.c b/net/core/devlink.c index 5bbd0aa..470f3db 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -2615,7 +2615,11 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info) .name = DEVLINK_PARAM_GENERIC_MAX_MACS_NAME, .type = DEVLINK_PARAM_GENERIC_MAX_MACS_TYPE, }, - + { + .id = DEVLINK_PARAM_GENERIC_ID_ENABLE_SRIOV, + .name = DEVLINK_PARAM_GENERIC_ENABLE_SRIOV_NAME, + .type = DEVLINK_PARAM_GENERIC_ENABLE_SRIOV_TYPE, + }, }; static int devlink_param_generic_verify(const struct devlink_param *param) -- 1.8.3.1