From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BE66C43218 for ; Thu, 25 Apr 2019 14:00:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4B42206BA for ; Thu, 25 Apr 2019 14:00:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="wrrXh4zE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729185AbfDYOAW (ORCPT ); Thu, 25 Apr 2019 10:00:22 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35873 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729157AbfDYOAV (ORCPT ); Thu, 25 Apr 2019 10:00:21 -0400 Received: by mail-wm1-f68.google.com with SMTP id h18so10775065wml.1 for ; Thu, 25 Apr 2019 07:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=n0F7XnVzprMoqZsqzIeSzEWtgKL0F6+AdHP0zj7iw7g=; b=wrrXh4zEqXj56itMVDRQy+uj21NBwZIrhycrSgb9kX3bpWcQzbasjmvYz/D83EuvqR x8p/Z+6XdgpgaQMxmZny2MC5641Dcn/tZAekoEnXYPYAAetbEkvwkAWgutWQdiCQjC1z zkEOMu+I+YwoVwesGCo0vLu0Ly2n0re9fPRCbcqkrLYreRLJak3A07eo5j38B2L2Fgja lqJDO7umlfv+64O3E9PsQHFdfJOvXPjM3EWBNHE8OZl14q1hwBAbDK5H6cXNWvtc9uzE gdsUcyQNYcIgDVSdAJSlPyEr73CPfgFn6Eg7WuFTWBhJ+Bfk0zPTSyFdZzYceAxBEBa+ DLFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=n0F7XnVzprMoqZsqzIeSzEWtgKL0F6+AdHP0zj7iw7g=; b=eWY00F9CAmSSX0W1BuuxaLvgG7wSqGv4ER7GvEQrrzXOJen8cZFMylayz4EAhbirgB j6J02RCxEtS5RfM8A1H/MZwvOJXKmyxXYTkGVn7IbjixnqlsrwPbHsHm2B4DkueaTLd9 anz8uLtWeRDYdyzfb+G/LYR5tt59t2FNLXoS2YpiVLTwXnywnpn8WtVw/DKMpDT0CBiq XLWgytvXRDmtAs1QsVkZyaG3iU3Jhvtm797PD40YSrEBn4NPKYeUga9dqg/P8xsoBLMh CKHmNUnbegL7llPuizyP6qIQCzwV0ZDzlAJtFWHO1yxq20YV0BtSXug1PLXujWPSGHGh k4wA== X-Gm-Message-State: APjAAAXxm6LX1acFB9rdnPVnXlSrex+Dk4htMVdTdfwCVILciWYBU8bi TpDX2of0FLahbpWCjQz/Hlvx+f9VXuI= X-Google-Smtp-Source: APXvYqwelcBcGLR2PEkEtdePusEEMT1Pul6V7x1PkdJz2KN0eyASGx8NIRRhiMidrSwQPDNOm7Mj+w== X-Received: by 2002:a7b:c147:: with SMTP id z7mr3718927wmi.67.1556200819252; Thu, 25 Apr 2019 07:00:19 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id v1sm23181638wrd.47.2019.04.25.07.00.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 07:00:18 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, mlxsw@mellanox.com, jakub.kicinski@netronome.com, dsahern@gmail.com Subject: [patch net-next v4 16/16] netdevsim: implement ndo_get_devlink_port Date: Thu, 25 Apr 2019 15:59:56 +0200 Message-Id: <20190425135956.3970-17-jiri@resnulli.us> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190425135956.3970-1-jiri@resnulli.us> References: <20190425135956.3970-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Implement ndo_get_devlink_port and allow switch_id and port_name to be handled by devlink. Signed-off-by: Jiri Pirko --- drivers/net/netdevsim/netdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index 040c390d0c01..e5c8aa08e1cd 100644 --- a/drivers/net/netdevsim/netdev.c +++ b/drivers/net/netdevsim/netdev.c @@ -245,6 +245,13 @@ nsim_set_features(struct net_device *dev, netdev_features_t features) return 0; } +static struct devlink_port *nsim_get_devlink_port(struct net_device *dev) +{ + struct netdevsim *ns = netdev_priv(dev); + + return &ns->nsim_dev_port->devlink_port; +} + static const struct net_device_ops nsim_netdev_ops = { .ndo_start_xmit = nsim_start_xmit, .ndo_set_rx_mode = nsim_set_rx_mode, @@ -263,6 +270,7 @@ static const struct net_device_ops nsim_netdev_ops = { .ndo_setup_tc = nsim_setup_tc, .ndo_set_features = nsim_set_features, .ndo_bpf = nsim_bpf, + .ndo_get_devlink_port = nsim_get_devlink_port, }; static void nsim_setup(struct net_device *dev) -- 2.17.2