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: 970069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=networkplumber.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="n7nh8dQ8"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42BmT8123yz9s3l for ; Sat, 15 Sep 2018 05:55:07 +1000 (AEST) 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 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(-)