From patchwork Mon Jun 17 08:53:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kirjanov X-Patchwork-Id: 10998579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22A75112C for ; Mon, 17 Jun 2019 08:53:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12FE428874 for ; Mon, 17 Jun 2019 08:53:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0708528877; Mon, 17 Jun 2019 08:53:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C08528874 for ; Mon, 17 Jun 2019 08:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726731AbfFQIxt (ORCPT ); Mon, 17 Jun 2019 04:53:49 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38929 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbfFQIxt (ORCPT ); Mon, 17 Jun 2019 04:53:49 -0400 Received: by mail-ed1-f68.google.com with SMTP id m10so15035063edv.6 for ; Mon, 17 Jun 2019 01:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-powerpc-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=tVdybmwcrudt9c/Fjr6ik4Y4QWR2zx2XxazxsJ9Os08=; b=FgMRwUPbuEvJzbL8PBS5vNGvEhcMXLT3jMfxRuwMUz069Fb+j7se/WTJ3z9LVnjbG6 98Y7N7aHskNgVPoVoIgwWL9SEEIgySDn0Y3Ur9PkQkJeqMHNRSMUn/kf5aXqKBUd58Cu hOtpiKGPLWCoS5YD3dk4HsTl1lW+dgDdlc49AX/mf5jUnvXV+FaL3Gu3qurNd428A3NV Vi3JfbZA4mopUsqmyJGa4Wgefr2/Y8tmGWn0qKXmQYswCfspBS2TWuTOOIdbHwrG0kP0 IQ1zA2o6YKURf7muC7i9llEAKZ9ZFY5fJt8C0+lIwQFsk+a091YUQ9503gVgDtxV3EcN 4uUw== 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; bh=tVdybmwcrudt9c/Fjr6ik4Y4QWR2zx2XxazxsJ9Os08=; b=iFWAjvG5ZBcfFpjMkByZmleV5aPTUOknTC1ynNJGvrWJUisUKv5XLSbE4+sYVOgT85 M4ELOuWxtEqgRJkPfG0oAaxla0XzSyHWjfmQ/bXsVbLgR9SsR9guYRzIxoPf3NAw7suh frQ1gq1oPQDAME9kKm+Lm+ux+2SAiSwy6dmlUyFHso2wbYkoUqHMbZG+RnKKCw/e9GHR Q+eJjQcidWnslrxbaT0ptLFEN9aV31cpCNVc9ve5ff1Byi5Q/HwNskhFE5buohXis485 E0hmFp9o/PUjztFGNaVBCvaEnIxGCkA2dB+z3Cfm0JIqMwugYWYlrHeuAC/LPYvUw/7/ /4TQ== X-Gm-Message-State: APjAAAUPqFruvZ4VTDm5SAKGUteeKLKxVYBzaxe5ZnR8qT71ZQPB4jxj wIWz6RquKl+cuA9JdsuD5PKYM9nDeRU= X-Google-Smtp-Source: APXvYqx/ZK+CJMvgB9VVxuWljmLEpBD7Y1zlCGUtpeu2PX2nLWMIOqMtyw4ZmxucdIEf+1EtiIeF/A== X-Received: by 2002:a17:906:3452:: with SMTP id d18mr74122016ejb.24.1560761627751; Mon, 17 Jun 2019 01:53:47 -0700 (PDT) Received: from tegmen.arch.suse.de (nat.nue.novell.com. [195.135.221.2]) by smtp.gmail.com with ESMTPSA id y11sm2075735ejb.54.2019.06.17.01.53.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jun 2019 01:53:47 -0700 (PDT) From: Denis Kirjanov X-Google-Original-From: Denis Kirjanov To: davem@davemloft.net, dledford@redhat.com Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, mkubecek@suse.cz, Denis Kirjanov Subject: [PATCH 1/2] ipoib: correcly show a VF hardware address Date: Mon, 17 Jun 2019 10:53:38 +0200 Message-Id: <20190617085341.51592-1-dkirjanov@suse.com> X-Mailer: git-send-email 2.12.3 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP in the case of IPoIB with SRIOV enabled hardware ip link show command incorrecly prints 0 instead of a VF hardware address. Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff vf 0 MAC 00:00:00:00:00:00, spoof checking off, link-state disable, trust off, query_rss off ... After with iproute2 patch[0] 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff vf 0 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff, spoof checking off, link-state disable, trust off, query_rss off [0]: https://patchwork.kernel.org/patch/10997111/ v1->v2: just copy an address without modifing ifla_vf_mac v2->v3: update the changelog v3->v4: update the changelog: add a link to the patch for iproute2 Signed-off-by: Denis Kirjanov Acked-by: Doug Ledford --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 9b5e11d3fb85..04ea7db08e87 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1998,6 +1998,7 @@ static int ipoib_get_vf_config(struct net_device *dev, int vf, return err; ivf->vf = vf; + memcpy(ivf->mac, dev->dev_addr, dev->addr_len); return 0; }