From patchwork Fri Sep 14 19:54:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 10601175 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 2CDAF933 for ; Fri, 14 Sep 2018 19:55:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B3E32BCB8 for ; Fri, 14 Sep 2018 19:55:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0E352BD04; Fri, 14 Sep 2018 19:55:07 +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 9CB032BCB8 for ; Fri, 14 Sep 2018 19:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbeIOBLC (ORCPT ); Fri, 14 Sep 2018 21:11:02 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44826 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbeIOBLC (ORCPT ); Fri, 14 Sep 2018 21:11:02 -0400 Received: by mail-pg1-f193.google.com with SMTP id r1-v6so4857186pgp.11 for ; Fri, 14 Sep 2018 12:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=+zb36HN52tXchxr3mF2JE5VOk6WYRCAnNnqFg3rgAPw=; b=n7nh8dQ8tWnieON0UQ0Ohf22eEYrtChJIvZAOBK0zLuT2yae1it1h2vZNZvAy1NajJ URiw8yDLPgdILoVWvjKFRV9o8FCTdW23XNpqsI6N2XB4vm2pWmj+cijDocAgjnntLNjq B/ftu49CrlIkgNCnlENs/9gCtABObt5foqod88H8rUR9+mlTZcZkcTnqiQeHxwT6RyY9 9hnkXRqkDnYIihjBwCLCid5zLWCMeJBXDrJkGwGtJ8y52VPA09qKLZed9mBMuOK0dvxY 2n3VbZFaGjWIOTIfxRQJ2ueorCgnRKzuuwrInVEBPg2LuRMBG1h3zjpn07K1N3fmUPeA Viuw== 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=+zb36HN52tXchxr3mF2JE5VOk6WYRCAnNnqFg3rgAPw=; b=jmhbKr/u4YpbUbTxoZnhPtlAdGZAZ0Q8oHsdi7T7UbWJee+771nw1s0McR63MDign5 zovQ4sFYvI+fXmPqsMhI74+hUdm+115muy0HukF5gJ+RD763apE2CBTZnAaMbzGRpaPH y50CmrSelekcymbkb0qzKgmytTRe11ScWJkvegrEQuBXwVJTdlvQUOmkieh6Py7XYPTc eNmyT+UqI/ZhNbFX04ok3bJHun7KlqO5kczJPV/9y27TAFYkDpdv0YJAyMnnn5UhJg0y HMcMAO407EpQTjO37lR5hSTTemMtf8B1ymIf66jqOlakXKf8nnai3WmOb7fzCxwFxOe+ dHww== X-Gm-Message-State: APzg51AjFts3mt6zTKHb7D+TuojAJyx9c8NPHG+3XnT+Ww0OhwYhXpPA L82tiLBxlFtfJOKvhxXQC0pqAg== X-Google-Smtp-Source: ANB0VdZOQIdqL8usePLmMlh0AFVX2CwiS/iLlgH4ikajV30NRQBFunXI9mCmVpg7qZ3n90zUdy2bbw== X-Received: by 2002:a63:1f55:: with SMTP id q21-v6mr13002822pgm.88.1536954904755; Fri, 14 Sep 2018 12:55:04 -0700 (PDT) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id z8-v6sm9394338pfe.163.2018.09.14.12.55.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 12:55:03 -0700 (PDT) From: Stephen Hemminger X-Google-Original-From: Stephen Hemminger To: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com Cc: devel@linuxdriverproject.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 0/2] hv_netvsc: associate VF and PV device by serial number Date: Fri, 14 Sep 2018 12:54:55 -0700 Message-Id: <20180914195457.20433-1-sthemmin@microsoft.com> X-Mailer: git-send-email 2.18.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Hyper-V implementation of PCI controller has concept of 32 bit serial number (not to be confused with PCI-E serial number). This value is sent in the protocol from the host to indicate SR-IOV VF device is attached to a synthetic NIC. Using the serial number (instead of MAC address) to associate the two devices avoids lots of potential problems when there are duplicate MAC addresses from tunnels or layered devices. The patch set is broken into two parts, one is for the PCI controller and the other is for the netvsc device. Normally, these go through different trees but sending them together here for better review. The PCI changes were submitted previously, but the main review comment was "why do you need this?". This is why. v2 - slot name can be shorter. remove locking when creating pci_slots; see comment for explaination Stephen Hemminger (2): PCI: hv: support reporting serial number as slot information hv_netvsc: pair VF based on serial number drivers/net/hyperv/netvsc.c | 3 ++ drivers/net/hyperv/netvsc_drv.c | 58 ++++++++++++++++------------- drivers/pci/controller/pci-hyperv.c | 37 ++++++++++++++++++ 3 files changed, 73 insertions(+), 25 deletions(-)