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 18930A04FD; 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 BFCFD40A84; Wed, 22 Jun 2022 16:08:11 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 0A1744069F for ; Wed, 22 Jun 2022 16:08:09 +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-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-221-vH5orDqVN76sAqX37nkOcQ-1; Wed, 22 Jun 2022 10:08:08 -0400 X-MC-Unique: vH5orDqVN76sAqX37nkOcQ-1 Received: by mail-lf1-f69.google.com with SMTP id k17-20020a05651210d100b004794def3bd3so8554053lfg.2 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=DIquszqKb+3PFJxrUVosGH2QE9NZa69niz9lwlilwHOoBf0daKOewgvHb39oRYeEEW j7ZM4dT2pSSdcEcyTFJFfzp22JBpzyzw3u3m+IQwvdO8m9AemGWZLkDggKYa8g6aJE64 RCVd7Ai5VVEKZAQKM1Ii7LIklamrjIVoGxWo8tZDFnmQq1tNUREK9I5C805eLOfj/TTp lj7+B1/jqqAb++nURW24IiSA5upGcJu+idCqCZZFiVz0JKT3Xzof3T1tCbshE5uthvoe zq48mRnRTCD95/qNzS5HeDsfU44VlbhBJq/eqYVLbfhJFmbsjNs3q05FbwVN1GRZ8JNu z+6g== X-Gm-Message-State: AJIora/24NaXxg4j/6wfOpfkwUzbwNEiaQzSCsMFpVa5SP1urS3ihlCx jDJKhGBeXWzJhGeIlzwk5tJcoFZdGojHXQVmmxReoy+Ii4LsM6UZd2CFxFsG5Q3B4YtH9+OYYli COzzF5g0s2wdJvRJvvpE= X-Received: by 2002:a2e:9e04:0:b0:255:a211:f440 with SMTP id e4-20020a2e9e04000000b00255a211f440mr1958031ljk.159.1655906886630; 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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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