Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp941672pxb; Fri, 22 Apr 2022 14:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9lLupcpPB7Tz2Orh34emi7r0JTwbaUfvNDU+r+WPhiy7SNih0B40aOi9Yj6hQ9cTcgoYK X-Received: by 2002:a17:90b:4d01:b0:1d0:f39f:6073 with SMTP id mw1-20020a17090b4d0100b001d0f39f6073mr7673122pjb.175.1650664631983; Fri, 22 Apr 2022 14:57:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650664631; cv=pass; d=google.com; s=arc-20160816; b=QPWLuqcH4vvq2z7/woQXUuZWkFuvOW1W4KpoJd8Q+0nYUOflkLXXQDvonuA3IXePMz Zc6+C71QycmgDKEMJ5AUcnyZueCDc98ysWRqWJ4pERViBNlhaXjiCv3Js7cFerZc5XgT zJQP6KUXt+enKWeo2IQDFrKM30VK5cMBUUle5WzOfKpeE+mFWzeKvarYAuNUOVMyfYr7 jlQgFJ75NnumVGHeNYVJAPZJTF5wGHV4Ysvq/QXlLg4f/DlOymBX//JLVj55PXEQ/Eun K6r1CKK3m/0jIEbZVwo5a8XpctxdVDk/Q4ngN+rRknmT2EWvaG/a0r7QPuWcTC460hIc etUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=G48gaoFMLG6KyRpgrzxv3LFh2u9c7s6gbwhig1Vylp4=; b=aWy0BgkKUq+DOli7JOBF1Vz8qkkZL4wUpQktJSg9OQ3fpNdoDxr+HM3RazRU5S7tv8 VEZKQJAA2RzophljMtVYrVp5ALuS5Ew/seQHaXeYCsRcHvhXCcPjSs8aVzZ4XV4AKIog Kj/hUAYpvo8fMOcQZC0gWcBcROhVkBMQn979SQs0kgDuEmYGvN5pdOZ11v8tc4udP+Cv rf2NJhOOhnzSJWKw8PJCnZq62Bz2TpbL83NlJd5EUgk05FmCeubgoyH8JJM3NjvXqYEf q3WkYXSh7eDrznZ65Er5TrVLSYUDUhyUANhUtwubq3+yVyC4IjdaPacp1OUc+8rIWVlE xucw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b="AOIe/dnv"; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d5-20020a170902aa8500b00158f80642a6si8539327plr.109.2022.04.22.14.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:57:11 -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=@microsoft.com header.s=selector2 header.b="AOIe/dnv"; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69922245E66; Fri, 22 Apr 2022 13:04:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383116AbiDTXR5 (ORCPT + 99 others); Wed, 20 Apr 2022 19:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345452AbiDTXRv (ORCPT ); Wed, 20 Apr 2022 19:17:51 -0400 Received: from na01-obe.outbound.protection.outlook.com (unknown [52.101.57.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B7D15838; Wed, 20 Apr 2022 16:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GknRNaSUizrLNfiXE68gqMojMCbnDEw3ZeQEkzKmU5KjipOmQO9hBWqNIBauKcgRQ5uj108OQm8Rl6Lpjuvv3WUrOStsvurBcmoXbG1ZVyy885iUbWtIlh6NmAd3H+3JH87i/1w6Ahg/O2VwN6OwT1CSciqCc93GpoOX1Q2oAgVRBxmUpchw6ux9EWlmRI3OpQaDlHB0aAO3K0iqq2N3AgpwMgsD4F8AWMY1PX3naeb7yckjMdEErAZd+8/J4633/uGfWqFKBRg1ctz6hrRy5fXOU/MYBv085KpqfOG9tBuUoTSU3RNhSn1yns6ak34zQ3OwZ7qU/5bh5iSlSYTjXA== 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=G48gaoFMLG6KyRpgrzxv3LFh2u9c7s6gbwhig1Vylp4=; b=gwGoynlzGGbM/WyASP7h0ZlKoTXhbvH77GnjzEWltri+FccsRqcLuayQ7XG+rH8sIUrSIrrrEtIO/sLtELw/g7IbCfhbpk8RCHZ4DfSL0LoNI5jxaTMylt/jceBvJUTfEewatfgiyMT2Z6FwTBGOwaQJXGtvfzCLu+Asr9/sdgjiQGx2iv90BMkoJu6hBN8zmJhF5+G916P+t2kgphpW1t/+EUcaxGf7GI1l4WyPnNGcuuQCfV/WfFZoYF5Bb9iOKlB/w9RQkOYZI5t4LuWPrfbz3so783Nj4tqw8P3rFHE8LNZ1H2hOuGvAeDgNv3/S5sMxPL0a8HOlF0LRclTlGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G48gaoFMLG6KyRpgrzxv3LFh2u9c7s6gbwhig1Vylp4=; b=AOIe/dnvTdtSa/oBLX60TtGbXnn7gwYb4JZgv/EHtnv/DCSDrKSVsWLgRe7aoWBV40Pg+PiBTbd1SRvMQcWqyEYS9I1Lvnq1WiQu/RyHu0U8az9bks0bZpzQjdqnnRR/x/+RRMF8hq6FC7+ne91E9QO6fhrVkEYliotn8iwm864= Received: from PH0PR21MB3025.namprd21.prod.outlook.com (2603:10b6:510:d2::21) by DM5PR21MB0634.namprd21.prod.outlook.com (2603:10b6:3:127::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.6; Wed, 20 Apr 2022 23:15:01 +0000 Received: from PH0PR21MB3025.namprd21.prod.outlook.com ([fe80::dd77:2d4d:329e:87df]) by PH0PR21MB3025.namprd21.prod.outlook.com ([fe80::dd77:2d4d:329e:87df%5]) with mapi id 15.20.5206.006; Wed, 20 Apr 2022 23:15:00 +0000 From: "Michael Kelley (LINUX)" To: "Andrea Parri (Microsoft)" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Stefano Garzarella , David Miller , Jakub Kicinski , Paolo Abeni CC: "linux-hyperv@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 5/5] Drivers: hv: vmbus: Refactor the ring-buffer iterator functions Thread-Topic: [PATCH 5/5] Drivers: hv: vmbus: Refactor the ring-buffer iterator functions Thread-Index: AQHYVPJSruHaMyZGKUm01yiVMWl9T6z5brnw Date: Wed, 20 Apr 2022 23:15:00 +0000 Message-ID: References: <20220420200720.434717-1-parri.andrea@gmail.com> <20220420200720.434717-6-parri.andrea@gmail.com> In-Reply-To: <20220420200720.434717-6-parri.andrea@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=7ec502e7-3170-4548-9c01-55f53781ec4a;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-04-20T23:13:56Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 987306b0-4223-4141-510e-08da23239804 x-ms-traffictypediagnostic: DM5PR21MB0634:EE_ x-ms-exchange-atpmessageproperties: SA|SL x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OtCGjTZJOJS1ReRbwDI3SPT3ypUSHa2eP3aFcJLKWpBu10Gv+MgRg12zWDmYzEZO5JaZYO6dZysTGQo8VsPiTT12EYAwQiXQQTPK6tM9oHP9IFN3eovjPXGi3r914SXPrduaDBNDO2pow4WZeaLxSFwVRl51JNtLgcfETJO8OwYWEfx+8xP1Oe28IiE8uLcwe8DTJVTE2s7+AISgAndjbycl7IACut1QYsfYtZJykKbV5HZ4KBiKw5j/7gLBeMkrZqyS8dZFsZW2oo9qTjfo1DiYXukXVtwOH466dxKrs+rG7mlcKLlj8/Fo2hNwqDFkDWSyXVsp1ZlWU6lcjj26cNav8tcB+nFnmyXUP/ZfizM2k9t+x32n+a9WwzMsYMwvj6YwKZbK2AAUwXQo7AWwMkQhAvD6BRy75uMPc+1UcUPN+hnmccelOEm+8PeebzgsmY0TRWdXt9CA8w0M4h50KvbvK4DGw6SYtCkJj4p9IKmIS/Q6qUDv4re5jSVc+CvkbUFG7s0RcrpYKgNUE/IgWUSilYN1p7DTyc5HGD3KH9TIeU3epahZi0nkotaOlJDu+rPCB3MyhHAHcAXSHF/K3iSOFRaA2wKmETjc/HCmsPrGh1U475XoCybA34DSD8r3U9X4ZGu11L9SYoP0vmBkbpZAbMkGOBZn9VJ6ZbbhCIFmyDuhD8etY072Rouzn2u76KWUn643kDz38ZXnRC/l5y4iaYxjOGWL+hDIz1l+r1I9uLcg/tOlnBmf4his1Wl4bPvz8uXNMfeXxihzbeFlig== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR21MB3025.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(451199009)(26005)(8990500004)(6506007)(86362001)(2906002)(9686003)(186003)(110136005)(66946007)(7696005)(4326008)(54906003)(316002)(8676002)(64756008)(66446008)(76116006)(10290500003)(66476007)(66556008)(38100700002)(83380400001)(38070700005)(122000001)(55016003)(508600001)(5660300002)(7416002)(71200400001)(82950400001)(8936002)(52536014)(33656002)(82960400001)(921005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8xsx4yAPsa0fcD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eHiFKWTszh+I+QXoIYM=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR21MB3025.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 987306b0-4223-4141-510e-08da23239804 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2022 23:15:00.6793 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jtbFOuSVX/vHvJGScy0EJTs8N7LxamtoNjYf91LQ1WS5lrE+CeEJr2zGpVhZUzIBdF3dV89reE69CGnaxC8CyDmXg5A/4aLuxPJHHSfQdxs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0634 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 From: Andrea Parri (Microsoft) Sent: Wednesday, Ap= ril 20, 2022 1:07 PM >=20 > With no users of hv_pkt_iter_next_raw() and no "external" users of > hv_pkt_iter_first_raw(), the iterator functions can be refactored > and simplified to remove some indirection/code. >=20 > Signed-off-by: Andrea Parri (Microsoft) > --- > drivers/hv/ring_buffer.c | 32 +++++++++----------------------- > include/linux/hyperv.h | 35 ++++------------------------------- > 2 files changed, 13 insertions(+), 54 deletions(-) >=20 > diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c > index 3d215d9dec433..fa98b3a91206a 100644 > --- a/drivers/hv/ring_buffer.c > +++ b/drivers/hv/ring_buffer.c > @@ -421,7 +421,7 @@ int hv_ringbuffer_read(struct vmbus_channel *channel, > memcpy(buffer, (const char *)desc + offset, packetlen); >=20 > /* Advance ring index to next packet descriptor */ > - __hv_pkt_iter_next(channel, desc, true); > + __hv_pkt_iter_next(channel, desc); >=20 > /* Notify host of update */ > hv_pkt_iter_close(channel); > @@ -456,22 +456,6 @@ static u32 hv_pkt_iter_avail(const struct hv_ring_bu= ffer_info > *rbi) > return (rbi->ring_datasize - priv_read_loc) + write_loc; > } >=20 > -/* > - * Get first vmbus packet without copying it out of the ring buffer > - */ > -struct vmpacket_descriptor *hv_pkt_iter_first_raw(struct vmbus_channel *= channel) > -{ > - struct hv_ring_buffer_info *rbi =3D &channel->inbound; > - > - hv_debug_delay_test(channel, MESSAGE_DELAY); > - > - if (hv_pkt_iter_avail(rbi) < sizeof(struct vmpacket_descriptor)) > - return NULL; > - > - return (struct vmpacket_descriptor *)(hv_get_ring_buffer(rbi) + rbi- > >priv_read_index); > -} > -EXPORT_SYMBOL_GPL(hv_pkt_iter_first_raw); > - > /* > * Get first vmbus packet from ring buffer after read_index > * > @@ -483,11 +467,14 @@ struct vmpacket_descriptor *hv_pkt_iter_first(struc= t > vmbus_channel *channel) > struct vmpacket_descriptor *desc, *desc_copy; > u32 bytes_avail, pkt_len, pkt_offset; >=20 > - desc =3D hv_pkt_iter_first_raw(channel); > - if (!desc) > + hv_debug_delay_test(channel, MESSAGE_DELAY); > + > + bytes_avail =3D hv_pkt_iter_avail(rbi); > + if (bytes_avail < sizeof(struct vmpacket_descriptor)) > return NULL; > + bytes_avail =3D min(rbi->pkt_buffer_size, bytes_avail); >=20 > - bytes_avail =3D min(rbi->pkt_buffer_size, hv_pkt_iter_avail(rbi)); > + desc =3D (struct vmpacket_descriptor *)(hv_get_ring_buffer(rbi) + rbi- > >priv_read_index); >=20 > /* > * Ensure the compiler does not use references to incoming Hyper-V valu= es > (which > @@ -534,8 +521,7 @@ EXPORT_SYMBOL_GPL(hv_pkt_iter_first); > */ > struct vmpacket_descriptor * > __hv_pkt_iter_next(struct vmbus_channel *channel, > - const struct vmpacket_descriptor *desc, > - bool copy) > + const struct vmpacket_descriptor *desc) > { > struct hv_ring_buffer_info *rbi =3D &channel->inbound; > u32 packetlen =3D desc->len8 << 3; > @@ -548,7 +534,7 @@ __hv_pkt_iter_next(struct vmbus_channel *channel, > rbi->priv_read_index -=3D dsize; >=20 > /* more data? */ > - return copy ? hv_pkt_iter_first(channel) : hv_pkt_iter_first_raw(channe= l); > + return hv_pkt_iter_first(channel); > } > EXPORT_SYMBOL_GPL(__hv_pkt_iter_next); >=20 > diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h > index 1112c5cf894e6..370adc9971d3e 100644 > --- a/include/linux/hyperv.h > +++ b/include/linux/hyperv.h > @@ -1673,55 +1673,28 @@ static inline u32 hv_pkt_len(const struct > vmpacket_descriptor *desc) > return desc->len8 << 3; > } >=20 > -struct vmpacket_descriptor * > -hv_pkt_iter_first_raw(struct vmbus_channel *channel); > - > struct vmpacket_descriptor * > hv_pkt_iter_first(struct vmbus_channel *channel); >=20 > struct vmpacket_descriptor * > __hv_pkt_iter_next(struct vmbus_channel *channel, > - const struct vmpacket_descriptor *pkt, > - bool copy); > + const struct vmpacket_descriptor *pkt); >=20 > void hv_pkt_iter_close(struct vmbus_channel *channel); >=20 > static inline struct vmpacket_descriptor * > -hv_pkt_iter_next_pkt(struct vmbus_channel *channel, > - const struct vmpacket_descriptor *pkt, > - bool copy) > +hv_pkt_iter_next(struct vmbus_channel *channel, > + const struct vmpacket_descriptor *pkt) > { > struct vmpacket_descriptor *nxt; >=20 > - nxt =3D __hv_pkt_iter_next(channel, pkt, copy); > + nxt =3D __hv_pkt_iter_next(channel, pkt); > if (!nxt) > hv_pkt_iter_close(channel); >=20 > return nxt; > } >=20 > -/* > - * Get next packet descriptor without copying it out of the ring buffer > - * If at end of list, return NULL and update host. > - */ > -static inline struct vmpacket_descriptor * > -hv_pkt_iter_next_raw(struct vmbus_channel *channel, > - const struct vmpacket_descriptor *pkt) > -{ > - return hv_pkt_iter_next_pkt(channel, pkt, false); > -} > - > -/* > - * Get next packet descriptor from iterator > - * If at end of list, return NULL and update host. > - */ > -static inline struct vmpacket_descriptor * > -hv_pkt_iter_next(struct vmbus_channel *channel, > - const struct vmpacket_descriptor *pkt) > -{ > - return hv_pkt_iter_next_pkt(channel, pkt, true); > -} > - > #define foreach_vmbus_pkt(pkt, channel) \ > for (pkt =3D hv_pkt_iter_first(channel); pkt; \ > pkt =3D hv_pkt_iter_next(channel, pkt)) > -- > 2.25.1 Reviewed-by: Michael Kelley