Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7016057pxb; Wed, 17 Feb 2021 21:56:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkI36Q2/k+fa/H/VhEGETJk85os+DWAk7hZ5Pnh3peF/B2fNBDg7dOb2TjvV23ujNha4ik X-Received: by 2002:a05:6402:293:: with SMTP id l19mr2400287edv.4.1613627802654; Wed, 17 Feb 2021 21:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613627802; cv=none; d=google.com; s=arc-20160816; b=BJqM+Pjk7RoSfO5X78QPEwodtHiy+wGDvpuYCyY+13krpxtGAmjtBgQY6YvFwmDmDp 5R6vuQjtEXZd3RbOqFgoV+YQGn+szNnCU/XsFxmOR2HFXTS26D8BYcP2aAzT8WqzFU1u vfGpWFuBThocGRbk7NRVAWj1l5EMWnsNTXObDDmlHjk6kHRRTpxCZTUxqcQwXRhgKID0 WHahqCVjZG8LU9WxGLkODQeZfFUc8BB1SLRFdslO9lw/ZeMdNgH/FCPjVhy3QMFihOeT jf2A9/h4Js+zNz9pfpZNLamm9qvzYfYW+dmbgyiU1sGGILGx8+y27g/yWvI/8VpOEYP0 ZytA== 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=dKMJfd1hxPhlgO6eJnZPqRFXXY6layQVjLF96Rw6H6g=; b=vfC+7rI7qOEc5dCRKEvPwC6ncW7t2Ao1VLiXwBfGWzplJtNg04TDbcgudRF3NDykW0 E/+Gj3oXyGevNSwD6vxVlDVY+XRt6ECHCkvTWlFkI1wtVjEAcIcBYbFRmTrStnRz68+c 5O4ijBYZOKCzrJkZLfuT6FZe4IC3NNamL+ZiP4xhiYchGGrLbQmqMWNyQUmy4EiDsTaX ZFdUlD7x/uF0HquKxmSfh12+TfLDmcH48vK4dRx810iiT3PrPolV5S8ZHXiVOXRyMHKL xJFjST9v/5ZTMREneLowt/cxVLWcSCc8OIIO8cRif0buH8TT1lnD5IjQY2Pm62Dg8Nwo 6Xxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kaspersky.com header.s=mail202102 header.b=r5HnyuPR; 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=REJECT sp=REJECT dis=NONE) header.from=kaspersky.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id um17si3435917ejb.230.2021.02.17.21.56.19; Wed, 17 Feb 2021 21:56:42 -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; dkim=pass header.i=@kaspersky.com header.s=mail202102 header.b=r5HnyuPR; 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=REJECT sp=REJECT dis=NONE) header.from=kaspersky.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231618AbhBRFwv (ORCPT + 99 others); Thu, 18 Feb 2021 00:52:51 -0500 Received: from mx12.kaspersky-labs.com ([91.103.66.155]:48222 "EHLO mx12.kaspersky-labs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230509AbhBRFmO (ORCPT ); Thu, 18 Feb 2021 00:42:14 -0500 Received: from relay12.kaspersky-labs.com (unknown [127.0.0.10]) by relay12.kaspersky-labs.com (Postfix) with ESMTP id 636BF761D5; Thu, 18 Feb 2021 08:39:32 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kaspersky.com; s=mail202102; t=1613626772; bh=dKMJfd1hxPhlgO6eJnZPqRFXXY6layQVjLF96Rw6H6g=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=r5HnyuPRSO3Adi6UsdtWps4OnXofWTOjAw7G6KPrZDO0ksstnkCghIoutPOC95kDo BE0tMicJLpywyv7xONBTgwT2FHAbKvu9itoZs8C0HWAqEYypwz1AHJ1/VkyZuLyBFy oKtTTNwgPJTmOo7oSW+9uO4Rj0Lz6Wbn+Chy7u43ol6f1Stx0wUwQoOCaVOMOhgGwY tfJP0BQMYjasTZZuPLSS9+aqv1WyTvCsq9nF48CKZmQsVh8EcONZBOnElHCZqlD0gh XuopkXO5GJgksUD/zFJ0Us8+7+7Hhaqc1QOtIkcc9S3fsAyNV43MZs3lCJpnQVUGEg g6QcaYyjZxNbA== Received: from mail-hq2.kaspersky.com (unknown [91.103.66.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client CN "mail-hq2.kaspersky.com", Issuer "Kaspersky MailRelays CA G3" (verified OK)) by mailhub12.kaspersky-labs.com (Postfix) with ESMTPS id 1C138761C8; Thu, 18 Feb 2021 08:39:32 +0300 (MSK) Received: from arseniy-pc.avp.ru (10.64.64.121) by hqmailmbx3.avp.ru (10.64.67.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2044.4; Thu, 18 Feb 2021 08:39:12 +0300 From: Arseny Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Arseny Krasnov , Jorgen Hansen , Andra Paraschiv , Colin Ian King , Norbert Slusarek CC: , , , , , Subject: [RFC PATCH v5 09/19] virtio/vsock: set packet's type in send Date: Thu, 18 Feb 2021 08:39:02 +0300 Message-ID: <20210218053906.1067920-1-arseny.krasnov@kaspersky.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210218053347.1066159-1-arseny.krasnov@kaspersky.com> References: <20210218053347.1066159-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.64.64.121] X-ClientProxiedBy: hqmailmbx1.avp.ru (10.64.67.241) To hqmailmbx3.avp.ru (10.64.67.243) X-KSE-ServerInfo: hqmailmbx3.avp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.16, Database issued on: 02/06/2021 23:52:08 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 10 X-KSE-AntiSpam-Info: Lua profiles 161679 [Feb 06 2021] X-KSE-AntiSpam-Info: LuaCore: 422 422 763e61bea9fcfcd94e075081cb96e065bc0509b4 X-KSE-AntiSpam-Info: Version: 5.9.16.0 X-KSE-AntiSpam-Info: Envelope from: arseny.krasnov@kaspersky.com X-KSE-AntiSpam-Info: {Prob_from_in_msgid} X-KSE-AntiSpam-Info: {Tracking_date, moscow} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: Rate: 10 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 02/06/2021 23:55:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 06.02.2021 21:17:00 X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KLMS-Rule-ID: 52 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, disabled by settings X-KLMS-AntiSpam-Interceptor-Info: not scanned X-KLMS-AntiPhishing: Clean, bases: 2021/02/18 04:51:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2021/02/18 04:31:00 #16269527 X-KLMS-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This moves passing type of packet from 'info' srtucture to send function. There is no sense to set type of packet which differs from type of socket, and since at current time only stream type is supported, so force to use this type. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/virtio_transport_common.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index e4370b1b7494..1c9d71ca5e8e 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -179,6 +179,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, struct virtio_vsock_pkt *pkt; u32 pkt_len = info->pkt_len; + info->type = VIRTIO_VSOCK_TYPE_STREAM; + t_ops = virtio_transport_get_ops(vsk); if (unlikely(!t_ops)) return -EFAULT; @@ -624,7 +626,6 @@ int virtio_transport_connect(struct vsock_sock *vsk) { struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_REQUEST, - .type = VIRTIO_VSOCK_TYPE_STREAM, .vsk = vsk, }; @@ -636,7 +637,6 @@ int virtio_transport_shutdown(struct vsock_sock *vsk, int mode) { struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_SHUTDOWN, - .type = VIRTIO_VSOCK_TYPE_STREAM, .flags = (mode & RCV_SHUTDOWN ? VIRTIO_VSOCK_SHUTDOWN_RCV : 0) | (mode & SEND_SHUTDOWN ? @@ -665,7 +665,6 @@ virtio_transport_stream_enqueue(struct vsock_sock *vsk, { struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_RW, - .type = VIRTIO_VSOCK_TYPE_STREAM, .msg = msg, .pkt_len = len, .vsk = vsk, @@ -688,7 +687,6 @@ static int virtio_transport_reset(struct vsock_sock *vsk, { struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_RST, - .type = VIRTIO_VSOCK_TYPE_STREAM, .reply = !!pkt, .vsk = vsk, }; @@ -990,7 +988,6 @@ virtio_transport_send_response(struct vsock_sock *vsk, { struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_RESPONSE, - .type = VIRTIO_VSOCK_TYPE_STREAM, .remote_cid = le64_to_cpu(pkt->hdr.src_cid), .remote_port = le32_to_cpu(pkt->hdr.src_port), .reply = true, -- 2.25.1