Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp717543pxb; Fri, 8 Jan 2021 16:56:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtUIsruavrpuMdYBSFLvfTa32m/usJSXHK8kv04+TwkrXjTxO2ie60bAjBgk8+G8QS2aen X-Received: by 2002:aa7:d407:: with SMTP id z7mr7441087edq.234.1610153780820; Fri, 08 Jan 2021 16:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610153780; cv=none; d=google.com; s=arc-20160816; b=JrfAmvI/rFvuvyjEW99UWEZZX/UgH920acYd+cdpYn10kqi9xAKbGTFw5wCwpuliq9 xM1NvMOsrDL4dn31NnaLGkJ2IHEKcpj84tfZytsVC6fk7Jry9TCJ4chn8kLE8eWIotKD G3dA9gWp7gVyEkIomnqQA05hAzaLY5jq8WWfuWv1Fu17R9HWPKAQAIwOJJHB+Wc20Fk2 zVVbPcSTpqUMNagxsmkisTYkW6N2I9UykJpJtUo/XOg87X+v8XSLrSt57ZnLLUvQsx7/ XtPELZTSTRAQDvf/aO6JsomtPZ+9BLTPumvK70vaA7XhwK2OFy7ueJuCJnLVf81T9/QS tZNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature:dkim-filter; bh=nEuRwFOdEnGfRfNfwrOA/fu41ZxQZ2FqFk6gkuksdSY=; b=S2EKRxrhhZidTBP8XxXEF7aFgHUoK1F0EURJ5WtG/auxpTG+XbVJyFxm1xMaWRSe8n k23pRgIRN2SA1qkcaLqWcp4qon0Gv4bF/ZxhSvZYsW+nkDIB41L+j/crGFoQ916VeD10 YKST6rfZvn5CfbXdZPTHsZZlxS93GnJ5ZM2xazG8+xol9lwGcy9cuhyieecBaGzbfrqZ kI1/hr2N7W/9GIWnO5BPVuq0Sa4DQYGdqTyicfKX62pgjpp41KkQZOb3vnxGV88f6h+k PMOsZBpBqXUHhTb3p4gmkRitdmWWn4qgxaMTeotSSTln6WNNhHFBHFv9RH5xTWFsEPu9 i3Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=GmSv3Jg7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l25si4063551ejg.7.2021.01.08.16.55.57; Fri, 08 Jan 2021 16:56:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=GmSv3Jg7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbhAIAyl (ORCPT + 99 others); Fri, 8 Jan 2021 19:54:41 -0500 Received: from linux.microsoft.com ([13.77.154.182]:41704 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbhAIAyl (ORCPT ); Fri, 8 Jan 2021 19:54:41 -0500 Received: by linux.microsoft.com (Postfix, from userid 1004) id 796A920B6C40; Fri, 8 Jan 2021 16:54:00 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 796A920B6C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1610153640; bh=nEuRwFOdEnGfRfNfwrOA/fu41ZxQZ2FqFk6gkuksdSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GmSv3Jg7n5NFLuIimbRfsV4En1Jbx1RLuEIEm61xCDBuoPTQ+KN1CRn1xd3IvU/iO proSToQ7X0bJE2u+STE8HoRJcYQlIBullo9GVk4iRWeTypzuXXwqJngNjTTmHDlgun NxuD9Uk+Eh/FnYKvbsBYnUqHVpRcrehIk3HuOgXE= From: Long Li To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , "David S. Miller" , Jakub Kicinski , linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [PATCH v2 1/3] hv_netvsc: Check VF datapath when sending traffic to VF Date: Fri, 8 Jan 2021 16:53:41 -0800 Message-Id: <1610153623-17500-2-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1610153623-17500-1-git-send-email-longli@linuxonhyperv.com> References: <1610153623-17500-1-git-send-email-longli@linuxonhyperv.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li The driver needs to check if the datapath has been switched to VF before sending traffic to VF. Signed-off-by: Long Li Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/netvsc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f32f28311d57..5dd4f37afa3d 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -539,7 +539,8 @@ static int netvsc_xmit(struct sk_buff *skb, struct net_device *net, bool xdp_tx) */ vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev); if (vf_netdev && netif_running(vf_netdev) && - netif_carrier_ok(vf_netdev) && !netpoll_tx_running(net)) + netif_carrier_ok(vf_netdev) && !netpoll_tx_running(net) && + net_device_ctx->data_path_is_vf) return netvsc_vf_xmit(net, vf_netdev, skb); /* We will atmost need two pages to describe the rndis -- 2.27.0