Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5551361pxb; Mon, 28 Mar 2022 14:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdkZK1mdlqcMAjnlZGXI3EtmGdjRNz34lJmNVPt223XzCuT2CO73pC1WTsPnWWIaoEPNmZ X-Received: by 2002:a05:6830:242f:b0:5cd:a8b2:a784 with SMTP id k15-20020a056830242f00b005cda8b2a784mr11072306ots.365.1648501575658; Mon, 28 Mar 2022 14:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648501575; cv=none; d=google.com; s=arc-20160816; b=cd20Jw93m6ebfsQ90JE5Zq5JCuZCnfc70npfhagg+EwGMprCsqkjMCdRl4jXPYBgS+ kAw9lLCjRRWuQ9IzVXsSNtBVj9oAOTfTnkZlFAp3eWJVZgC8ttqjeTN0XcGaA0S01SVw KJ5EPeE/od4+1nRh+Q8z2WfHuwf2L/hw6YyOcFugd2eNxkmI6STN6EM5QIk5YdGaXVI+ TmeFmrlJh/KuglS01tw2MnnxLTaDK+PlyvabCIc0czXgJ2wKP/rKdzfPuH2beDW/hiF0 EqvtmAL9LN9T5b7ph8FOtGyhKe3dCA1BsWW6HifhR0fEgf385F1AqP/PEOgUgUsZkSp+ dCAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k6Z2QAh69D2f3QVduoGx7amlvw7Kf+1kJe9caoLYo90=; b=ivkRR4aJLRoYoXyeYFIzPkBtCyhnmv+++QPQIDTihUXaPJ+87eJTKkif2ZxiRmjf7b ecB920rmuV+6EhIUzgbu0Xl3z4NSCZzewhFFiFxtg755WCfVcnscu4efMMG7QtjwJS+h m7P7omipxQr0Xylq/YGjfin4AFPWiT3pxxW4wYVkKNDXKIYBHMuEUWhi0pe21TzU23up vVl3/IE6RFowvHeJ8uUh/C3cntrMQ1ajIcwf7NX96jvLNGkc7i+BInU3NtP3wA5qoRLu 14Kkies1CrBp+Hzq81Mqeo9+5eKWBYldP0o0V+IPjNb0v+Gv1aAP3q1bQrHiXbRJHccr 5Jfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ki4xV6Fb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m16-20020a9d6ad0000000b005cda592837fsi12110715otq.36.2022.03.28.14.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ki4xV6Fb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 258BF71A12; Mon, 28 Mar 2022 14:01:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244009AbiC1Oo5 (ORCPT + 99 others); Mon, 28 Mar 2022 10:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244001AbiC1Oox (ORCPT ); Mon, 28 Mar 2022 10:44:53 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C09935F4FF; Mon, 28 Mar 2022 07:43:11 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id yy13so29179494ejb.2; Mon, 28 Mar 2022 07:43:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k6Z2QAh69D2f3QVduoGx7amlvw7Kf+1kJe9caoLYo90=; b=Ki4xV6FbK/Bb9MVx3DDLR9ANFfqVPIk219k3dd+EjsBILtkGxKDryZivr6PqnEpi76 hK/NogkvQF+7BD+pjn3/0QiIaJkI9CSfSXAFQILezgs3rL5gPonOMuEDsMEpt2U6iBy0 Fjw7hksxTES7jI8Bvz0nGgXGKSfHuS+pYJHTFP10/ZatEJ07vsNP6gqiy1+ibRgP4ibk ovAzkumrDJiGfDz5roq9GIdxVcQuWGoUxowlSzckHcP13HY7xbAQ9b6Z5pGuXDtYvo6Z d69XBwKKlCumiJi/QdW2HE30Z53PFbSzsNA8MNg9RGxi+8sUAl/Y6AEyW8/fLGJkIBnb YnaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k6Z2QAh69D2f3QVduoGx7amlvw7Kf+1kJe9caoLYo90=; b=4mn9+CAxFKgl7/kfbCauiFVU4EKCo2G+hvXvUbVDuwLcz5mtp4obPxjg67+WKvflpC CUS0XHnp3oUj+K/o0L5u/VKwz8n486KrUpjHKVqAuTGCOxJNs9o6usyN4F+pr3yGhUx/ EPkRumjh6jGj1/sNKkMeNZfCDvSwlMM54jrSIF47D2Yo8B1XV+iqsgx5dACodTtV9G3K nmCmoc+s1VES6h3wlADxm4CzZ1p95NRR/y36zRVgKJMjaQnIv96+8DVoglpGlsLoD0Gy zat7kPTwfE/dO1Cd/GYHK8FTKISQbh+if7V12EsUys/S2Jf1bckIGE5HBVRwXiug347A kQpg== X-Gm-Message-State: AOAM531O5N0ixjds0yp3VgnwlKJ1XXG/8npk7Y129gdX3Mii+DI4uzCs UA9gE5EmiU11roSntrKt/O0= X-Received: by 2002:a17:906:2bd7:b0:6cd:f89d:c828 with SMTP id n23-20020a1709062bd700b006cdf89dc828mr28190599ejg.232.1648478590143; Mon, 28 Mar 2022 07:43:10 -0700 (PDT) Received: from anparri.mshome.net (host-82-59-4-232.retail.telecomitalia.it. [82.59.4.232]) by smtp.gmail.com with ESMTPSA id g2-20020aa7c842000000b0041314b98872sm7008983edt.22.2022.03.28.07.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 07:43:09 -0700 (PDT) From: "Andrea Parri (Microsoft)" To: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Michael Kelley , Wei Hu , Lorenzo Pieralisi , Rob Herring , Krzysztof Wilczynski , Bjorn Helgaas Cc: linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, "Andrea Parri (Microsoft)" Subject: [RFC PATCH 1/4] Drivers: hv: vmbus: Remove special code for unsolicited messages Date: Mon, 28 Mar 2022 16:42:41 +0200 Message-Id: <20220328144244.100228-2-parri.andrea@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220328144244.100228-1-parri.andrea@gmail.com> References: <20220328144244.100228-1-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vmbus_requestor has included code for handling unsolicited messages since its introduction with commit e8b7db38449ac ("Drivers: hv: vmbus: Add vmbus_requestor data structure for VMBus hardening"); such code was motivated by the early use of vmbus_requestor from storvsc. Since storvsc moved to a tag-based mechanism to generate/retrieve request IDs with commit bf5fd8cae3c8f ("scsi: storvsc: Use blk_mq_unique_tag() to generate requestIDs"), the special handling of unsolicited messages in vmbus_requestor is not useful and can be removed. Signed-off-by: Andrea Parri (Microsoft) --- drivers/hv/channel.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index dc5c35210c16a..a253eee3aeb1a 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -1243,11 +1243,7 @@ u64 vmbus_next_request_id(struct vmbus_channel *channel, u64 rqst_addr) spin_unlock_irqrestore(&rqstor->req_lock, flags); - /* - * Cannot return an ID of 0, which is reserved for an unsolicited - * message from Hyper-V. - */ - return current_id + 1; + return current_id; } EXPORT_SYMBOL_GPL(vmbus_next_request_id); @@ -1268,15 +1264,8 @@ u64 vmbus_request_addr(struct vmbus_channel *channel, u64 trans_id) if (!channel->rqstor_size) return VMBUS_NO_RQSTOR; - /* Hyper-V can send an unsolicited message with ID of 0 */ - if (!trans_id) - return trans_id; - spin_lock_irqsave(&rqstor->req_lock, flags); - /* Data corresponding to trans_id is stored at trans_id - 1 */ - trans_id--; - /* Invalid trans_id */ if (trans_id >= rqstor->size || !test_bit(trans_id, rqstor->req_bitmap)) { spin_unlock_irqrestore(&rqstor->req_lock, flags); -- 2.25.1