Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp441601pxb; Wed, 25 Aug 2021 06:55:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFCvX/vMfheprqqxk/Bm5Q7k5Zso0KOEAPRbauxuubwzTP53ee8D8fupqCkY8G1wEu/8l7 X-Received: by 2002:a17:906:504:: with SMTP id j4mr45267236eja.245.1629899748625; Wed, 25 Aug 2021 06:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629899748; cv=none; d=google.com; s=arc-20160816; b=Pp+d1bwGMOhTdvsiGrgrPmXiwrdTUJulGWwUatthmjtrxQtUNFKgHWGMFTYuWJ4fQN t7oGOxe1aOGZkPJq+vsUxhg06BPUJ2OBl2ZV/8sq4l0WwTcS7S6alVXdOsJZVhOgt6fc eAMvK5o7Ts0YSgvOX6n5gy6ttrgEQj1m1WhBUz5m6CwVAe9d+Qv5jqILiAwROqs6Ob1b oFP/Czfgmi6MLIgrpQu9wgFAxRoR9wnuRExjwoycrGAdgmOT0sLlSd2fN3S9Ht9M4I8D leKXTs7j9x2KxPaaZxBeJ+z6jEVGBC8H+NC4HV+NEjCm6KAYeS5sAe1CMLu6sI+Dp79j xAJw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=A/htP7MQwE1WocRnDXZywGTa4cGcMJaiiSpZCc7Gsg0=; b=twm60Tow5z4LVGd9uWonth1ZserxiztWOhW+hQejmcJ9j1CkhYdXysa2oxIoKHfD2R 39a9Hx+C754qTgE8BwDAeib7610BD8ZSPHqhhKxsM8UNWglpnTrL3SfeQq7tn1X3g8Gt NKidsR+MDIoCrrAeXH8VNox94B2xP53vvaa0C6i/dTbJt/D3EtmGnCKLWEQ/TjYuKQKV LEQZ071Gue8kYrAj/UPlomxyO+zqI06nS6culNUX8BCloPBGViVmLPUqx3CKhfLiAnK8 fqOZQRN8dOU+XhEDEHtCA2OsgU8RSOuaypvVIvthlFlwE2FSTeod+06Ri2dPWjq6F6Jt zzeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="IJpcVZi/"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si59422edx.605.2021.08.25.06.55.24; Wed, 25 Aug 2021 06:55:48 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b="IJpcVZi/"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240182AbhHYNjx (ORCPT + 99 others); Wed, 25 Aug 2021 09:39:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58568 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240220AbhHYNjw (ORCPT ); Wed, 25 Aug 2021 09:39:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629898746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=A/htP7MQwE1WocRnDXZywGTa4cGcMJaiiSpZCc7Gsg0=; b=IJpcVZi/zn0O3biHCD/tJD0H1GPoqOCTbZIJFSXWfaIomV+Gn9u6TzYqTMtdNHkjGrWhmc U/o8QaInD1UJkQ9QlLLDIRWitUZMnyFKcu1dWsveRiqcYRvI7DloarwqJr1EuAzOp0lvMQ UwGJHTRiHj8kyRGkCiuy+Urc1s+95JE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-Grq60voaP_KvWG_1_PFfog-1; Wed, 25 Aug 2021 09:39:02 -0400 X-MC-Unique: Grq60voaP_KvWG_1_PFfog-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F71F1082921; Wed, 25 Aug 2021 13:39:01 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.193.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84CE51970F; Wed, 25 Aug 2021 13:38:58 +0000 (UTC) From: Vitaly Kuznetsov To: linux-hyperv@vger.kernel.org Cc: Andres Beltran , Michael Kelley , "Andrea Parri (Microsoft)" , Dexuan Cui , Wei Liu , Stephen Hemminger , Haiyang Zhang , "K. Y. Srinivasan" , linux-kernel@vger.kernel.org Subject: [PATCH] hv_utils: Set the maximum packet size for VSS driver to the length of the receive buffer Date: Wed, 25 Aug 2021 15:38:57 +0200 Message-Id: <20210825133857.847866-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") introduced a notion of maximum packet size and for KVM and FCOPY drivers set it to the length of the receive buffer. VSS driver wasn't updated, this means that the maximum packet size is now VMBUS_DEFAULT_MAX_PKT_SIZE (4k). Apparently, this is not enough. I'm observing a packet of 6304 bytes which is being truncated to 4096. When VSS driver tries to read next packet from ring buffer it starts from the wrong offset and receives garbage. Set the maximum packet size to 'HV_HYP_PAGE_SIZE * 2' in VSS driver. This matches the length of the receive buffer and is in line with other utils drivers. Fixes: adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_snapshot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c index 2267bd4c3472..6018b9d1b1fb 100644 --- a/drivers/hv/hv_snapshot.c +++ b/drivers/hv/hv_snapshot.c @@ -375,6 +375,7 @@ hv_vss_init(struct hv_util_service *srv) } recv_buffer = srv->recv_buffer; vss_transaction.recv_channel = srv->channel; + vss_transaction.recv_channel->max_pkt_size = HV_HYP_PAGE_SIZE * 2; /* * When this driver loads, the user level daemon that -- 2.31.1