From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F004AA09FF; Tue, 5 Jan 2021 22:25:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D61E81607D8; Tue, 5 Jan 2021 22:25:18 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 2909E1607A1 for ; Tue, 5 Jan 2021 22:25:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609881916; 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=YNEbrMwRsLkpYoe2KeI19fgbe94Rt0aWB02Kk67zbSg=; b=cbEStr6MEVz4QxRMs0lSeL67BkCbTF+ymMe+eEc9iw8Sx52ub0o3mfgGoQcmacupQINqGo VnHwlVIrzP9CTGq0g5gkw0nCW1Xu+gY50haSXvIc8G77AeY/DTSk8ozfjlMEZvu+5CwMpa D4gEhpyBkM6XauvT89jkZDrMZz7HsIQ= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-453-EoIIbdEONiufgmW7-EsDVA-1; Tue, 05 Jan 2021 16:25:11 -0500 X-MC-Unique: EoIIbdEONiufgmW7-EsDVA-1 Received: by mail-ua1-f72.google.com with SMTP id z24so284632uao.0 for ; Tue, 05 Jan 2021 13:25:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YNEbrMwRsLkpYoe2KeI19fgbe94Rt0aWB02Kk67zbSg=; b=eTUBZR2Ma9ooQKmQWispMy/3SxIIwmHIigmkUucnUTSd/P1+hHvPugVDljD/5u+M0M ZjR7vrzNti4rhxBgV9VpUpSj0zHdFXd92P1GOaLA58zKLwDEMpiP7r7DvuHjp8w7TgyH 3r7gu1RvAGJZD208EkQN2mZf+OT5dMzBXs/rWJN5TYTZzESO95S6TLC2q040OsLBkJmm fjeTuZQPcmIg2ujg/iy7UO46rrMWRp04030cT18CBXTEpUaTmY/AC+rHYwg7xXimPWW9 1eVl/DhsG+cnM4j5vUiMWh2fnljVTqwAee7HP+CKiESaNMvbtw3p4Vq64jy+hBlok2qD Mj6w== X-Gm-Message-State: AOAM530M9KzLxkaXhvo6o6iUmgYPm7r7+RKXIs0xzI2PW5jhBXMHVygl r3+IJ8NEILYu9Fui6xb5cZ7M0UGkuAGvrE522dIs0sSCYml8Kcz/u14sKvQaOGGctFOVMKzJXDA Uhh0ENBSmbV5TGYyn5Pw= X-Received: by 2002:a1f:dac7:: with SMTP id r190mr1389312vkg.22.1609881910911; Tue, 05 Jan 2021 13:25:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQr2kYUIV06dmX+W4jksJ8GLiK3+EjC1qh4qW0Symk2jQ+x1nX2WSQDAxKjz+LuO+eBzzhYoMMj+usliMfjJs= X-Received: by 2002:a1f:dac7:: with SMTP id r190mr1389307vkg.22.1609881910757; Tue, 05 Jan 2021 13:25:10 -0800 (PST) MIME-Version: 1.0 References: <20201220211405.313012-1-maxime.coquelin@redhat.com> <20201220211405.313012-30-maxime.coquelin@redhat.com> In-Reply-To: <20201220211405.313012-30-maxime.coquelin@redhat.com> From: David Marchand Date: Tue, 5 Jan 2021 22:24:59 +0100 Message-ID: To: Maxime Coquelin Cc: dev , "Xia, Chenbo" , Olivier Matz , Adrian Moreno Zapata 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" Subject: Re: [dpdk-dev] [PATCH 29/40] net/virtio: add Virtio-user vring file ops 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 Sender: "dev" On Sun, Dec 20, 2020 at 10:16 PM Maxime Coquelin wrote: > diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c b/drivers/net/virtio/virtio_user/vhost_kernel.c > index 2f1b4840ee..1805aee7f7 100644 > --- a/drivers/net/virtio/virtio_user/vhost_kernel.c > +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c > @@ -259,11 +259,44 @@ vhost_kernel_get_vring_base(struct virtio_user_dev *dev, struct vhost_vring_stat > return vhost_kernel_set_vring(dev, VHOST_GET_VRING_BASE, state); > } > > +static int > +vhost_kernel_set_vring_file(struct virtio_user_dev *dev, uint64_t req, > + struct vhost_vring_file *file) > +{ > + int ret, fd; > + uint32_t index = file->index; > + > + /* Convert from queue index to queue-pair & offset */ > + fd = dev->vhostfds[file->index / 2]; > + file->index %= 2; > + > + ret = vhost_kernel_ioctl(fd, req, file); > + if (ret < 0) { > + PMD_DRV_LOG(ERR, "Failed to set vring file (request %lu)", req); Breaks 32bits build. > + return -1; > + } > + > + /* restore index back to queue index */ > + file->index = index; > + > + return 0; > +} > + -- David Marchand