From patchwork Sat Jan 9 00:53:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 12007867 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96128C4332D for ; Sat, 9 Jan 2021 00:54:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5962723AC4 for ; Sat, 9 Jan 2021 00:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbhAIAyl (ORCPT ); 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: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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