Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2927372rwd; Mon, 22 May 2023 06:26:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vI3N4XTERKlKnvSNdsY2eMXDrzLErkXTxLV7hP6Uu5/TYB1US0LvulP1gQkubPP0ew/0c X-Received: by 2002:a05:6a00:1689:b0:627:6328:79f1 with SMTP id k9-20020a056a00168900b00627632879f1mr15587474pfc.34.1684762005089; Mon, 22 May 2023 06:26:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684762005; cv=pass; d=google.com; s=arc-20160816; b=EVGp5l/PXPuZ5TAe48JRyLkFUspdW0CRSLNNLtD49392EUpa7ivWlFFFiUG0vbsfgL Bv2r+BWu6YShMV/f3PMAqGMTLe8E5lIpq2X/Ygnl2ZAUi1a9AeO3jM3DTjW5hXNzzFtl a6a7lRRB0GOhx5ujbEuw4QAk0TV7C7emUqcX2AyunAcDbVhRpMdPztQizvg99RjXeJba P4IvZu/Dy0h4AqjHtu9bHpe49VOR7m4RpZUz6mDP1zXNkHXoNLbEr8BIMSNT7p1hmxLZ /i+RG4vNBeF+uvSZOlbp7OgeibiB0PBXvdbQqbNBhI0fEntaBorAimHADl6/bfPVxBXj u9XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YhJ+DqBuh7hxJ9ire3Jilz3Y/81HN1SSsdL3DdWowz0=; b=WrB45Tf9wVe265wDFxih1txWJob41q6pE0cZCZnEscRxRxISyKjJeLrstXIzHEWGgu HDoyVi0KO0S8hxV5Qm+AUf4hlDAs2YcakQ5X2iQiw/Tu86B3TaatH+zommP9y2kOHVQ4 J8hOxW6TQM92AAgViYJ7W7zHAHhSc2xr+Ryq2DJQ7HAY8esOh3xtLEzx7EIKpF5K2L1P /EuDhk2ChjK3Son9vCuIIzChGC4US8EKNmdMgrsg1MGykoozYYBHke26zroDCOvjn/mf IKq5vd3tA/AXt0H3qu4BXDy0DuIQBOgFupuIWSP7KebDGxDuut3Pnrzj3RGMYVSgsKyD 9E3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=LnorRJmh; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020aa793c2000000b0063b356e36fesi4734904pff.372.2023.05.22.06.26.32; Mon, 22 May 2023 06:26:45 -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=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=LnorRJmh; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234266AbjEVNOB (ORCPT + 99 others); Mon, 22 May 2023 09:14:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbjEVNN7 (ORCPT ); Mon, 22 May 2023 09:13:59 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2101.outbound.protection.outlook.com [40.107.220.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5D7C4; Mon, 22 May 2023 06:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lHsHaoQYIUDYds8PWfSKIAD5LRiaHNKzs5+f/reIzjxU/rDp4oQGJGId5zGvC0e0zK1A9XbaRvd3CBCCPZVBjV/lsvcrTTRTdHzRGrbGU5awHmLlrF1mvXK+io0mqWdpehIdtbeiBIP0kvQeiYul3SSOE+vJWaesAhVVYia8ZKrV2UjUKwSBvipkl99KUumlOsOIbLQI1LpC23WrpPtpGIPMgOiOmP4Kx+RrF8QyqHu2ds7T/Lh3+Th1+MAjRvVkF4IOhcSYrQeSVQ9ADCO9T0hjVuhHlhrfLYGVxeZFSrlB1IzokG2ztMxQO1nHImFH3vo1NGBKNhq0+K9tMvE+fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YhJ+DqBuh7hxJ9ire3Jilz3Y/81HN1SSsdL3DdWowz0=; b=hl+5Ga+CzrTz75uECOmN6eb/u6VoIHyik+lexFn66Zg/FBETpEgsDTrezQuo792GKWtrYuWkfBufBPMhlpNDT7TzKYOTn8TMmwwo3XnELn/9AIFRGGyAriedXdoIHykRDeQZNuKau2UgjCfYtqXAikNoKDmAZmB9KNlg29FREAfDiKHgHI9dZrXp8MCY01aMREEn1q6z/Ipqma2wzQI7SZ5Kd3xjFMolmCuKP9DqoTjrcZsywWwpxHwgtkAZFlUAXacdggJD/7s6wvfcAnpvwEUOUfDr+teUSc9ThHKTILH2niXTFyXG4juU6fdttUAt1lSqnzGQOS2XQUeeeoQ0Yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YhJ+DqBuh7hxJ9ire3Jilz3Y/81HN1SSsdL3DdWowz0=; b=LnorRJmhmt7LOpiWEIn+SxBhCtOmlBH9KtnSo2fYC0GlPNoCHlRs6yVB9dniRBIYfiOl7RhpBTtb/W1CpJKPQy1GzpsbGhXcCV/8dLod2MAHPNRzOGOknoZ5nPPuDd78G6IfFWaPmqQk1yX3dl9UPu17VoWb/vVByUOExekO29k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MW5PR13MB5995.namprd13.prod.outlook.com (2603:10b6:303:1cc::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 13:13:54 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%5]) with mapi id 15.20.6411.028; Mon, 22 May 2023 13:13:54 +0000 Date: Mon, 22 May 2023 15:13:46 +0200 From: Simon Horman To: Arseniy Krasnov Cc: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru, oxffffaa@gmail.com Subject: Re: [RFC PATCH v3 04/17] vsock/virtio: non-linear skb handling for tap Message-ID: References: <20230522073950.3574171-1-AVKrasnov@sberdevices.ru> <20230522073950.3574171-5-AVKrasnov@sberdevices.ru> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230522073950.3574171-5-AVKrasnov@sberdevices.ru> X-ClientProxiedBy: AS4P251CA0009.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d2::20) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|MW5PR13MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 72c59bf2-cff9-49c7-f042-08db5ac6649c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DLmv9yU1hzZd6gfgILgGvDIXoBs6AnmFei6BZSKheUr3dpBakLgXG8sU84LYwcLQHJvfwpybNzDqvexRNRljQqhLfeA0vHEWLjXMfOZ0Ob9vFKTfp+5ElL+Rg8NnZho/8faRDSkx4yUI2Ojj9ARdPqLeVwhzZ4BXUii+1Fg/8x4QPcLoVOvN335xBxcUTbbFd/y/72XjsNy1/pIlorTd1a83hgwWj1BhEqPrqsmUN7dhLuBrkSPsnG730h9go36JaeyLKWtFpMPwkEZHugE42DcTGZRWkulsqEemk61HZ/65TAMvk8VILXXO3jHDkkhZY16bz6KrMVwP7EaMTOMMz9b4NMZ0jUzBewAs8lG7QutFrjz88/dnHGHotkeYu0MGNON0kZXv9juv2+E4KQ2dJmilMh0FrHmMgtxn/ZysMibNBhR8XaqBfs3BmPdUpc92fAQrkzmWl0JIjum3jqTzVoBMR+qq2Xa3iMpDbEiY8qiIV/Bk6z8bM468itNiQeFVx4uTYSq4PQnyB5aYB5IfSZp8eoF2vt176tvA3hpsmNjj70vxEsJ/hEjkM9RjWBuM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(39840400004)(136003)(376002)(346002)(451199021)(83380400001)(36756003)(6666004)(6486002)(86362001)(2906002)(54906003)(478600001)(6512007)(2616005)(186003)(6506007)(8676002)(7416002)(8936002)(66946007)(66556008)(44832011)(66476007)(38100700002)(316002)(5660300002)(41300700001)(6916009)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/H0/DWcYzYzcVTRfL0URDg5bHtHTwpuWZtOB6Blh0/G4AEjlr0dd0KRWvQgM?= =?us-ascii?Q?dIibMNScG5PG+FL6Cf3q1rUL1dt3ieDwuoEfpu9XLRFY6wuP/zUKsIbuuBqa?= =?us-ascii?Q?A1EG5GfigwPvD6OwfRlfyVUkRzbiyvOs7rvGm/ghCQgx/Q67nLUD4WEgeRxd?= =?us-ascii?Q?Y7DSje/Nti7q96lqyIOs0U4cRtDFmXHVebFPgS9TRlcV3crFWEm+kOxk4+rS?= =?us-ascii?Q?hHRft32Q0CUG8NRpEOJPYPe86pvLv+/NDPE5d9jYuvm3sNAKO0lBnGTT+jnc?= =?us-ascii?Q?+A+x9SLp+Ftfd5F+GFJIk5aZFGvbRxi5iWwSrbEQlTs6zl5K5NWSwxGpnPKv?= =?us-ascii?Q?M3yhqJktUC6ZAfH+OfnEwCpLYNW9exhIDepGggE9Qmx/4/uYI8RleoZRCi8Y?= =?us-ascii?Q?RUkxx/2o6WXsBuZiHKS25LjQ3gyqxptQF/ZnPCNam0vrHN4P3+RJimGa8iqK?= =?us-ascii?Q?1Sl2V25/vBCR/tktIF41mGFjfV5ebFSuDihLcVpCSBNtYCz3T/bz6/IlSKxR?= =?us-ascii?Q?QuCZqhL7qqe1H1Wezgum1gI1YbHPuPkbFw3te/THmwn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4AyQqDaF7+a/Udv4HZKR83JiiN7t/H0ni63J?= =?us-ascii?Q?IpJjqdY6/5mWUdnisPdFQRwEP1bZ4jvkDXYIVYtY+BSqMyJWgsaOBhr/izCy?= =?us-ascii?Q?QVlzEOyU0slyxTOYUACWfl/b6SskXnA+78ktzWzPOB787rW7UAk/MW5AUA9G?= =?us-ascii?Q?mGKJehC9tuQKel0iYVSUzsIIuIpE7WQ3AcVm384qDEdMzab4eINJzHEUCDqc?= =?us-ascii?Q?C75Rew=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72c59bf2-cff9-49c7-f042-08db5ac6649c X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 13:13:54.2279 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RiT93JKZzJJRRij3Oi4D+tBG9L89grc4vkagTJGf+R0pf7urFWT8dqVlWgcWkFEeZrFs59MHEdImEIv7xj5O28L6rEJ6A1LGWRWYj5DGwDg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR13MB5995 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, May 22, 2023 at 10:39:37AM +0300, Arseniy Krasnov wrote: > For tap device new skb is created and data from the current skb is > copied to it. This adds copying data from non-linear skb to new > the skb. > > Signed-off-by: Arseniy Krasnov > --- > net/vmw_vsock/virtio_transport_common.c | 31 ++++++++++++++++++++++--- > 1 file changed, 28 insertions(+), 3 deletions(-) > > diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c > index 16effa8d55d2..9854f48a0544 100644 > --- a/net/vmw_vsock/virtio_transport_common.c > +++ b/net/vmw_vsock/virtio_transport_common.c > @@ -106,6 +106,27 @@ virtio_transport_alloc_skb(struct virtio_vsock_pkt_info *info, > return NULL; > } > > +static void virtio_transport_copy_nonlinear_skb(struct sk_buff *skb, > + void *dst, > + size_t len) > +{ > + struct iov_iter iov_iter = { 0 }; > + struct iovec iovec; > + size_t to_copy; > + > + iovec.iov_base = dst; Hi Arseniy, Sparse seems unhappy about this. Though, TBH, I'm unsure what should be done about it. .../virtio_transport_common.c:117:24: warning: incorrect type in assignment (different address spaces) .../virtio_transport_common.c:117:24: expected void [noderef] __user *iov_base .../virtio_transport_common.c:117:24: got void *dst ...