Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20502343rwd; Thu, 29 Jun 2023 03:15:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64AAuNcl7zKCgCH3cPDlzCd7XD2czw0l+xG24N97Y6siJezF1R3Q8oOnt+xhl7+VLo/Uxd X-Received: by 2002:a17:90b:4fc2:b0:260:d8c0:ae79 with SMTP id qa2-20020a17090b4fc200b00260d8c0ae79mr16349398pjb.35.1688033725676; Thu, 29 Jun 2023 03:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688033725; cv=none; d=google.com; s=arc-20160816; b=YD8rnPmJUWqs0/xdPX9Ewf0l7GZA5FZL7pjccfNWhAEDrshzFORlL9myvURxcW+4Vd /TRb43gSb9kufVuodcYxhfpVAH8onjhlGTXe75CikqvxVCcJFjrkg3zu7pFyzeBmBhTc 3Z43USPNHPK0xIxawu2Smlza15c01SSgv7jmgyDN+KrrWi0SLGudaxaS3JNAqmvvlu+r B6miufwbyt45aralc7Xa9beLIpO1U8JZdEva5xGDN8oJuo51DiTA0PbRlDFHdZRI7pos wYIzt4HURyn1DhstlxvtFsqKyhoZhL+I1xzFhp5qUZHSmau/2ZwCRN/gvU8T5qahyoQv gEVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=XGi0Xfbla6zy1W1JQmGRgBhHp8TXf7aa805AEzMwfpM=; fh=DajlBr+WeNJOgU+gxXGULREhF6H5lyVjbBIcdunJArY=; b=Hx8XXn6N7wC5cJpXkBL28HJRnYvM7XO18JxuAc+DEIj4p1+6J9NkefBy9Sl4WBCShY y2b1uvHb3Md1foE4DlRoFvCrSnR5EvjbbqS8Jbw2US7sQrDl6w4/6YlYUz8q+OCsG4zN 2FUr23VZmTefx7OSVr60uLaYeak8P+BRb/qsDgllUeO/XpAeDV3jcRl4ON1x59EiV/r1 OIkgcAZKtvCwX9fVbtpdG/y8ugy2oEN2OlnCCv/GmbfMwbSOb6ml0OFiP4GX9+JIg5QA EolryhpC9/N75+46KrhHIqzUdyeqHt2gghYfVNgjGknuYD9Ay5Z+meaXeVo60FidIjF9 iUhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=OqwpSIc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a63dc09000000b00553b02a9a17si10543492pgg.256.2023.06.29.03.15.09; Thu, 29 Jun 2023 03:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=OqwpSIc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232131AbjF2KAr (ORCPT + 99 others); Thu, 29 Jun 2023 06:00:47 -0400 Received: from linux.microsoft.com ([13.77.154.182]:42492 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbjF2J6p (ORCPT ); Thu, 29 Jun 2023 05:58:45 -0400 Received: by linux.microsoft.com (Postfix, from userid 1134) id F30CC208395B; Thu, 29 Jun 2023 02:58:43 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F30CC208395B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1688032724; bh=XGi0Xfbla6zy1W1JQmGRgBhHp8TXf7aa805AEzMwfpM=; h=From:To:Cc:Subject:Date:From; b=OqwpSIc2mI4wBBiJZzndArFVjfoCtY2cq4zL2esKlYkJPPdr1gh+dgYOWAiVO1jSD 0xibWswzVhybPzZhec0OUQmb8i/v+11mIBm6hnhSdcGP/ior5rW23WnoiNIYQ9nQkG WIqgGFAZ7kam3SJpyRsX8DL5BCMRDquwmrliljw8= From: Shradha Gupta To: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org Cc: Shradha Gupta , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Michael Kelley , "David S. Miller" Subject: [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus Date: Thu, 29 Jun 2023 02:58:39 -0700 Message-Id: <1688032719-22847-1-git-send-email-shradhagupta@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A future Azure host update has the potential to change RSC behavior in the VMs. To avoid this invisble change, Vswitch will check the netvsc version of a VM before sending its RSC capabilities, and will always indicate that the host performs RSC if the VM doesn't have an updated netvsc driver regardless of the actual host RSC capabilities. Netvsc now advertises a new capability: AllowRscDisabledStatus The host will check for this capability before sending RSC status, and if a VM does not have this capability it will send RSC enabled status regardless of host RSC settings Signed-off-by: Shradha Gupta --- drivers/net/hyperv/hyperv_net.h | 3 +++ drivers/net/hyperv/netvsc.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index dd5919ec408b..218e0f31dd66 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -572,6 +572,9 @@ struct nvsp_2_vsc_capability { u64 teaming:1; u64 vsubnetid:1; u64 rsc:1; + u64 timestamp:1; + u64 reliablecorrelationid:1; + u64 allowrscdisabledstatus:1; }; }; } __packed; diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index da737d959e81..2eb1e85ba940 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -619,6 +619,14 @@ static int negotiate_nvsp_ver(struct hv_device *device, init_packet->msg.v2_msg.send_ndis_config.mtu = ndev->mtu + ETH_HLEN; init_packet->msg.v2_msg.send_ndis_config.capability.ieee8021q = 1; + /* Don't need a version check while setting this bit because if we + * have a New VM on an old host, the VM will set the bit but the host + * won't check it. If we have an old VM on a new host, the host will + * check the bit, see its zero, and it'll know the VM has an + * older NetVsc + */ + init_packet->msg.v2_msg.send_ndis_config.capability.allowrscdisabledstatus = 1; + if (nvsp_ver >= NVSP_PROTOCOL_VERSION_5) { if (hv_is_isolation_supported()) netdev_info(ndev, "SR-IOV not advertised by guests on the host supporting isolation\n"); -- 2.34.1