Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3256211pxb; Mon, 24 Jan 2022 06:02:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2Gb247JfxJhHlQyf+Qd8Risn2+voz2RTURKN25/LC3BCJ1syZg7Z8dizsz37yBEx6NEaF X-Received: by 2002:a63:6a49:: with SMTP id f70mr11850433pgc.244.1643032941557; Mon, 24 Jan 2022 06:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643032941; cv=none; d=google.com; s=arc-20160816; b=SFD7Q4nM30jSxi8zwgVLFNKdp0ABDoZjnHkxchGlSo9AEYvY+QGi2Z4kU31oxNRzb6 9DIW3tqpOS/tn2/c0MuoWVBWzjaDziRCmotJLLJq/HhRiVI55R4AGnCAdNl/R1X0BxtH 7fDEch4oQc91UHf/POuFbiifYi9+heiNNu8AwXEWF7VLZDP4MLEGPRidSRIVS6COpzls uU8jyYCGZ3Flskxw+iLxArp80ALhhe4CniqSLkZcPKvg0lg/vgnRc8q+HirYAWpmqpsh kdvniihFX/OSepNkxW90fCckY80rXpVwFYJqUF/fxGfj2fOj7nVYIRd1NgVd6ewblmtv qBJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=FtCZGMVCEzvzcuj9uIT9ybSsEia//PiD1l8+cmaI4f4=; b=LoVFn2K27TJnjsZhAYxXyVq6XH/Ip46RAtRsX51pxC3S3ykTXt4GI6FB1SNBsbPtAp QUx+gpZ14GjChk1Q93L28o2PtkjnAT3Tcaj3O1M/ijFbhCup+SXESrIQ+pRtXETtvUjN b5n+chx6/Tx8p5UySasqywx7HyKifd7DPTA5JxYXc+mShjSZOkqI/BxkDjHEYSD5NeHB sMlKHzwyM1pToPqZLEZ44HXJsJcymPwezo/dtTYAS48T732sRD8dFxf6CSgbuXyKfsBo Q6cBZ9Ju3yJ9BNdgodFOiWPM+vFV7n+UIIqiQ/gTAeeKcu2vsL15ScoB2H8gR9KHC6Qk 2M9w== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si13410703pgh.118.2022.01.24.06.02.08; Mon, 24 Jan 2022 06:02:21 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240269AbiAWVzk (ORCPT + 99 others); Sun, 23 Jan 2022 16:55:40 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:44591 "EHLO mail-wr1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234697AbiAWVzj (ORCPT ); Sun, 23 Jan 2022 16:55:39 -0500 Received: by mail-wr1-f52.google.com with SMTP id k18so10155232wrg.11; Sun, 23 Jan 2022 13:55:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FtCZGMVCEzvzcuj9uIT9ybSsEia//PiD1l8+cmaI4f4=; b=cEk+i0WGCyRUjUvmjZxs5orB5/WGe+Rvu8BC7M2hwO728lNOnpuCzT3O2aGotrKhVo 33xT/aDgBRoBp80lWfE9WmNHC0CmbRtmAGa3cS4M/x3whKj3TxjpmF3VMsMsQ9lwm1aX QV3dXMt85KwnoH9s91Obr/G4OrjZsM/FXTluyhbNSyPGRzqPgBPydeIkrSewYdZ+bCuO V90SI10+jsRTO8OCCq0TWC8obSytM9j0VH6fO/GedD/RA2Nb5U0HszzPkWNlh7OhgYen Do4F2k/p+XSBSH/kwlj8kjp5Q0Aa8nwjoTRn61Zb95raTuKWPGwaw8K8wFmyAmXflcAH SjqA== X-Gm-Message-State: AOAM530tFzS7iN1kFCEJtLN7PQu90i0i0FjvsazKo5I33HzCucQXK/gQ mnYhf/gFHMAXig+k9mPwK8hxj34X7N0= X-Received: by 2002:adf:e0c6:: with SMTP id m6mr12016980wri.525.1642974938554; Sun, 23 Jan 2022 13:55:38 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id h127sm19625046wmh.27.2022.01.23.13.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 13:55:38 -0800 (PST) Date: Sun, 23 Jan 2022 21:55:36 +0000 From: Wei Liu To: Yanming Liu Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, "Andrea Parri (Microsoft)" , Andres Beltran , Dexuan Cui , Wei Liu , Stephen Hemminger , Haiyang Zhang , "K. Y. Srinivasan" , Michael Kelley Subject: Re: [PATCH] Drivers: hv: balloon: account for vmbus packet header in max_pkt_size Message-ID: <20220123215536.vsbv7n36govrzqbd@liuwe-devbox-debian-v2> References: <20220119202052.3006981-1-yanminglr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220119202052.3006981-1-yanminglr@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 20, 2022 at 04:20:52AM +0800, Yanming Liu wrote: > Commit adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V > out of the ring buffer") introduced a notion of maximum packet size in > vmbus channel and used that size to initialize a buffer holding all > incoming packet along with their vmbus packet header. hv_balloon uses > the default maximum packet size VMBUS_DEFAULT_MAX_PKT_SIZE which matches > its maximum message size, however vmbus_open expects this size to also > include vmbus packet header. This leads to 4096 bytes > dm_unballoon_request messages being truncated to 4080 bytes. When the > driver tries to read next packet it starts from a wrong read_index, > receives garbage and prints a lot of "Unhandled message: type: > " in dmesg. > > Allocate the buffer with HV_HYP_PAGE_SIZE more bytes to make room for > the header. > > Fixes: adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") > Suggested-by: Michael Kelley (LINUX) > Suggested-by: Andrea Parri (Microsoft) > Signed-off-by: Yanming Liu Applied to hyperv-fixes. Thanks.