From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by dpdk.org (Postfix) with ESMTP id 0E97F1CD79 for ; Thu, 5 Apr 2018 21:13:10 +0200 (CEST) Received: by mail-pl0-f66.google.com with SMTP id z5-v6so2357784pln.1 for ; Thu, 05 Apr 2018 12:13:10 -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:in-reply-to:references; bh=EI8gd3Y3o2kk0jssYYk6dUoBvuxV3vD34QAwcu6i8uE=; b=J5U1vgqESWJ4X5oM4dxnwGZECLAYV+ZA7IWJCtEmaK+2nA4I5EpYX7LS53HtkoGBNm 9KqxsgU6SJDd5x22U22nEsDDlKxfDYS9ySBcZc1TbL4v6V1AWMxWkEXsjkiDjdVrsux7 Eup6ATidoDfO6K7gODdPiQs3b1Q5aLI3P2llmm56LBhFGTFk206mSrDjDSZ1AVEoGYv1 4mQ2R/f5fnqDV8+RMgWQVOhx/HrvaBHI+0uftR5vuISYsSdEm5fvCfE8mqzRuCoha5Hr w/ynZm2DLEetK7TdrEj+0E5LQnHna6WwfN8+8vLgyxt1Q4Z1x5ebb3w/ngZ7vlkuVvDT hCCQ== 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=EI8gd3Y3o2kk0jssYYk6dUoBvuxV3vD34QAwcu6i8uE=; b=tAN7F3K135JJeUfx6IkQLS+VDoIwkputl9nmFh01yDwKuX9FeSL9KzRTuo+ktyex6g O2CRAQAGpJkVBbmKWBdWiiVwuW6Y3usufIoJpoJZEMrp/l3KazlBpX3jb3sOo80Cunla zWKBsiMc4dPtKIeMTc8TKFsqPFLyvD5j0g7lR9xH6THfjn6fDf7qCHMaqwVLdS0gkb1l 3o+7n88vv/JeEQ/uumfSbN0V4QI8T01cDxBbyWeruBeLLXiR0Rcf3JBcntXKjlKohWOA A1bk005PP5gAnnH2BKkfucLUfRLEaOai4pjZwUpjL2Sbooc3SQposWO/Bw3C3lPXDnjt 10BA== X-Gm-Message-State: AElRT7Fv1KIsYavMj7rCi7CdmtMX9Bv1DvthYUqhnwoWPS/hJOm6QYxx D14Onhg8shidZ+C9Ub976/nSMN267zc= X-Google-Smtp-Source: AIpwx4+qJ0i017sJDohecWzVhHokZJA2CB/2BiwJUNTp/yxhu/ATNG1ynowrS23XRVjVL6cIUXC/XA== X-Received: by 2002:a17:902:bf47:: with SMTP id u7-v6mr17885691pls.133.1522955589798; Thu, 05 Apr 2018 12:13:09 -0700 (PDT) Received: from xeon-e3.lan (204-195-71-95.wavecable.com. [204.195.71.95]) by smtp.gmail.com with ESMTPSA id d8sm16447947pfh.177.2018.04.05.12.13.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 12:13:09 -0700 (PDT) From: Stephen Hemminger X-Google-Original-From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 5 Apr 2018 12:13:04 -0700 Message-Id: <20180405191305.26813-3-sthemmin@microsoft.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180405191305.26813-1-sthemmin@microsoft.com> References: <20180405191305.26813-1-sthemmin@microsoft.com> Subject: [dpdk-dev] [PATCH 2/3] usertools: add hv_uio_setup script X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 19:13:11 -0000 Small script to rebind netvsc kernel device to Hyper-V networking PMD. It could be integrated in dpdk-bind, but dpdk-bind is focused on PCI, and that would get messy. Eventually, this functionality will be built into netvsc driver (see vdev_netvsc as an example). Signed-off-by: Stephen Hemminger --- usertools/hv_uio_setup.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 usertools/hv_uio_setup.sh diff --git a/usertools/hv_uio_setup.sh b/usertools/hv_uio_setup.sh new file mode 100755 index 000000000000..9885a0e80828 --- /dev/null +++ b/usertools/hv_uio_setup.sh @@ -0,0 +1,40 @@ +#! /bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Microsoft Corporation + +module=uio_hv_generic +# Hyper-V network device GUID +net_guid="f8615163-df3e-46c5-913f-f2d2f965ed0e" + +if [ $# -ne 1 ]; then + echo "Usage: $0 ethN" + exit 1 +fi + +syspath=/sys/class/net/$1/device +devpath=$(readlink $syspath) +if [ $? -ne 0 ]; then + echo "$1 no device present" + exit 1 +fi +dev_guid=$(basename $devpath) + +driver=$(readlink $syspath/driver) +if [ $? -ne 0 ]; then + echo "$1 driver not found" + exit 1 +fi +existing=$(basename $driver) + +if [ "$existing" != "hv_netvsc" ]; then + echo "$1 controlled by $existing" + exit 1 +fi + +if [ ! -d /sys/module/$module ]; then + modprobe $module + echo $net_guid >/sys/bus/vmbus/drivers/uio_hv_generic/new_id +fi + +echo $dev_guid > /sys/bus/vmbus/drivers/$existing/unbind +echo $dev_guid > /sys/bus/vmbus/drivers/$module/bind -- 2.16.3