From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90A7AA0544 for ; Wed, 22 Jun 2022 16:08:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87DAA427F4; Wed, 22 Jun 2022 16:08:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 7F2924069F for ; Wed, 22 Jun 2022 16:08:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655906889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Mu6u+nKOa5Vj6sEeVsmvKlRwrZtuA1B5siiPyfGCXEk=; b=e2N1SHHPMoqbUWpTVLh9y19ANPjpeGjS+Tmt0oxh7oofNXlIwebmE0ytgZVpmTvEC9Uw+1 YW2eC98ciP1CPiHuX6ESPJClkvlBBMtdseE69NVwYB2UPzcRKphHkpER27TAxIgr0pKYbf OASJPB1pVwRncJrGd0kS7yO66Z3p3WM= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-608-tte34RXWO1KniBF14cwrxg-1; Wed, 22 Jun 2022 10:08:08 -0400 X-MC-Unique: tte34RXWO1KniBF14cwrxg-1 Received: by mail-lf1-f71.google.com with SMTP id bp15-20020a056512158f00b0047f603e5f92so5467886lfb.20 for ; Wed, 22 Jun 2022 07:08:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mu6u+nKOa5Vj6sEeVsmvKlRwrZtuA1B5siiPyfGCXEk=; b=DubWXbGVqu9LCEmaVB9e5wokrbYUMbAW2kwLWycAwNTX4dkTZLhIaQEYIFNXZfy3X7 duravyyRfJdVoynJZ8VjL/NJC6Inw38uMXWzXSBz9EE5H+ra2Fap2JpnlC5UKiH9y4rw 1cnYPjZ+P21yCAFzVWV+bFerWLwYfg6qUlbyNvwLz937MNbZU9qu1cdURgEcJM8vMC1X ZecbdNUyHc5qPbPCr2UXcfKTIxa61BsSwebBJ6V0IkhETlkK3FNRGzFPHw+pf6euqW3j yhjE0UCiFPAsfBzh1h2Dch/BgHZFKDzGLJuZ6nAZMl8h5VQDhYmikPprrCRYDbLSOo8f A0Mw== X-Gm-Message-State: AJIora+Cj7277P1tQumTVAyIYPiThGOL58+JVrvJ8VydrY/ZVaeMB5uP vwqYb00Do1g6xgW24VKFkhXo1RzI4ge4buSQTdDSUSBbQOrHibQuAqdljbGtFOs+hS0zQ0fcCcI /XviMZVApB2CJlk3GmcH3eFs= X-Received: by 2002:a2e:9e04:0:b0:255:a211:f440 with SMTP id e4-20020a2e9e04000000b00255a211f440mr1958038ljk.159.1655906886710; Wed, 22 Jun 2022 07:08:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vPgzNxG9aXocp1J1anzGOGBkTs10Cjgxn4jjzogH/60bHnK8Ulx9/0PiZDyEIFihUp12kuMxPfpL00Jt5+yw8= X-Received: by 2002:a2e:9e04:0:b0:255:a211:f440 with SMTP id e4-20020a2e9e04000000b00255a211f440mr1958011ljk.159.1655906886373; Wed, 22 Jun 2022 07:08:06 -0700 (PDT) MIME-Version: 1.0 References: <20220518101657.1230416-13-david.marchand@redhat.com> <20220616144650.1013920-1-david.marchand@redhat.com> <01bd004b-02f1-9369-dc43-456149d0240d@redhat.com> In-Reply-To: From: David Marchand Date: Wed, 22 Jun 2022 16:07:54 +0200 Message-ID: Subject: Re: [PATCH v3] vhost/crypto: fix build with GCC 12 To: "Poczatek, Jakub" , "Zhang, Roy Fan" Cc: Maxime Coquelin , "dev@dpdk.org" , "stable@dpdk.org" , "Xia, Chenbo" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hello Jakub, Roy, On Wed, Jun 22, 2022 at 11:01 AM Poczatek, Jakub wrote: > When running a Virtio performance test on a VM using VHost with this patch applied, > VHost gives the following error message: > > > VHOST_CONFIG: (/tmp/vhost) read message VHOST_USER_SET_FEATURES > > VHOST_CONFIG: (/tmp/vhost) negotiated Virtio features: 0x0 > > VHOST_CONFIG: (/tmp/vhost) read message VHOST_USER_SET_MEM_TABLE > > VHOST_CONFIG: (/tmp/vhost) guest memory region size: 0x80000000 > > VHOST_CONFIG: (/tmp/vhost) guest physical addr: 0x0 > > VHOST_CONFIG: (/tmp/vhost) guest virtual addr: 0x7f17c0000000 > > VHOST_CONFIG: (/tmp/vhost) host virtual addr: 0x7f94c0000000 > > VHOST_CONFIG: (/tmp/vhost) mmap addr : 0x7f94c0000000 > > VHOST_CONFIG: (/tmp/vhost) mmap size : 0x80000000 > > VHOST_CONFIG: (/tmp/vhost) mmap align: 0x40000000 > > VHOST_CONFIG: (/tmp/vhost) mmap off : 0x0 > > VHOST_CONFIG: (/tmp/vhost) read message VHOST_USER_SET_VRING_NUM > > VHOST_CONFIG: (/tmp/vhost) read message VHOST_USER_SET_VRING_BASE > > VHOST_CONFIG: (/tmp/vhost) vring base idx:0 last_used_idx:0 last_avail_idx:0. > > VHOST_CONFIG: (/tmp/vhost) read message VHOST_USER_SET_VRING_ADDR > > VHOST_CONFIG: (/tmp/vhost) read message VHOST_USER_SET_VRING_KICK > > VHOST_CONFIG: (/tmp/vhost) vring kick idx:0 file:37 > > VHOST_CONFIG: (/tmp/vhost) reallocated virtqueue on node 1 > > VHOST_CONFIG: (/tmp/vhost) reallocated device on node 1 > > VHOST_CONFIG: (/tmp/vhost) virtio is now ready for processing. > > USER1: New Vhost-crypto Device /tmp/vhost, Device ID 0 > > VHOST_CONFIG: (/tmp/vhost) read message VHOST_USER_SET_VRING_CALL > > VHOST_CONFIG: (/tmp/vhost) vring call idx:0 file:38 > > USER1: [VHOST-Crypto]: Session 1 created for vdev 0. > > USER1: [VHOST-Crypto]: Incorrect virtio descriptor > > USER1: [VHOST-Crypto]: Failed to process sym request > > USER1: [VHOST-Crypto]: Incorrect virtio descriptor > > USER1: [VHOST-Crypto]: Failed to process sym request Could you test with the following snippet: diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index 96ffb82a5d..54946f46d9 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -610,8 +610,7 @@ copy_data(void *data, struct vhost_crypto_data_req *vc_req, return -1; left -= copied; data = RTE_PTR_ADD(data, copied); - desc++; - } while (desc < head + max_n_descs && left != 0); + } while (left != 0 && ++desc < head + max_n_descs); if (unlikely(left != 0)) return -1; -- David Marchand