From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E3392A04F1; Wed, 11 Dec 2019 03:58:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2300223D; Wed, 11 Dec 2019 03:58:42 +0100 (CET) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id F2B0E1F5 for ; Wed, 11 Dec 2019 03:58:40 +0100 (CET) Received: by mail-wm1-f68.google.com with SMTP id q9so5373456wmj.5 for ; Tue, 10 Dec 2019 18:58:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4p0g1yqz5ib4W8YRFupvEM+DJYXt6OTVhv41wTvA/0M=; b=DkP2fAE1adwBDE8gr/xAMHJtObvWz8ErKd00u0MoWaLPvrae0/04cIf/kqsWp2isqR gvDs1w/hrlUqTpBEMu0U6r/gEzWYUECe9vN9sFX3FENC2m+6Mwq7hWdmUKv5Iw269if9 5Ml04Xh7aeNWWlIc+jAEaQqg4BCq7ZZrWon1YCmrkKuq17LW2FuldwipQ//W8AA4oXQu A2Hj4EucJnheuHohvKfJyCuPu0+7JK2yv7WTsQClhXOUuQLY0BZKBPZ586EZ2cMtBY5i GZhkq0sRvZNEjznfUu2lqw0R4/InNUt1sYeiVBewHApb9e26UrIMookPSpqrwCTEAG9U PgHw== 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:content-transfer-encoding; bh=4p0g1yqz5ib4W8YRFupvEM+DJYXt6OTVhv41wTvA/0M=; b=OQKOW1rDQBzNWjoCMM+m1YF7Vlr5TvWvU2n9dvLkA4flkUPmmEjn9vmUOiMxkgBUM2 CXV2VUyEHQnplR5sSBmEbPsW90ifYd0up3/oDCG6QfnG6pGaLjt27Wbwyy+ujssW4U9G rO6ovHQpiI+YWvD7AkMi9a5fJ/VYZWNsZrykwn6b0EhkILNkrDgjA4Fn2n48kB+xcGJd ZZsSWqkRa8Pts108ihgUM2rtN3WW0bPG3N4HgcDgqKMUyL7oidswv5p/k2enUOihYVNl fi6an56T1THEO02All42LaSErz8Y9kqgLIgbSm8BM4CT+B3EjoEg3oqMTVtkP/I34Yza 0JNA== X-Gm-Message-State: APjAAAU3UcCqZ8LqDecXXIwc3hvbp8OOh5J2znnfmluEDTuikeM+qBw8 GpqJO2Uq0r9P/xiStsgEQY8Jf1a/dK0CzEBpA1cVGp7LR3oPlYzLJ2lILWo5Fbw2Y8gcLpK8jMC v0LZgpE397fba X-Google-Smtp-Source: APXvYqwsQmYhYch5YufOFcIRAn2GgC8XIvGa8uaapZ+y5n0WqNvoKJ48RtmN2xXCeoquK1/ND81EADEe00wMyzpHldM= X-Received: by 2002:a1c:1bc3:: with SMTP id b186mr605582wmb.79.1576033120357; Tue, 10 Dec 2019 18:58:40 -0800 (PST) MIME-Version: 1.0 References: <20191202145735.9763-1-fengli@smartx.com> <20191205053833.29068-1-fengli@smartx.com> In-Reply-To: <20191205053833.29068-1-fengli@smartx.com> From: Li Feng Date: Wed, 11 Dec 2019 10:58:28 +0800 Message-ID: To: Maxime Coquelin , Tiwei Bie , Zhihong Wang Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v3] vhost: add config change slave msg support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" ping, any update about this? Thanks, Feng Li Li Feng =E4=BA=8E2019=E5=B9=B412=E6=9C=885=E6=97=A5=E5= =91=A8=E5=9B=9B =E4=B8=8B=E5=8D=881:38=E5=86=99=E9=81=93=EF=BC=9A > > This msg is used to notify qemu that should get the config of backend. > > For example, vhost-user-blk uses this msg to notify guest os the > compacity of backend has changed. > > Signed-off-by: Li Feng > --- > v3: > * Move the declare to rte_vhost.h > * Add the symbol in rte_vhost_version.map > > v2: > * Fix a little log typo. > > lib/librte_vhost/rte_vhost.h | 12 ++++++++++++ > lib/librte_vhost/rte_vhost_version.map | 1 + > lib/librte_vhost/vhost_user.c | 31 ++++++++++++++++++++++++++++= +++ > lib/librte_vhost/vhost_user.h | 1 + > 4 files changed, 45 insertions(+) > > diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h > index 7b5dc87c2..fc28da264 100644 > --- a/lib/librte_vhost/rte_vhost.h > +++ b/lib/librte_vhost/rte_vhost.h > @@ -977,6 +977,18 @@ __rte_experimental > int > rte_vhost_get_vdpa_device_id(int vid); > > +/** > + * Notify the guest that should get config from backend. > + * > + * @param vid > + * vhost device ID > + * @return > + * 0 on success, < 0 on failure > + */ > +__rte_experimental > +int > +rte_vhost_user_slave_config_change(int vid); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rt= e_vhost_version.map > index c512377fe..acf013d6d 100644 > --- a/lib/librte_vhost/rte_vhost_version.map > +++ b/lib/librte_vhost/rte_vhost_version.map > @@ -65,4 +65,5 @@ EXPERIMENTAL { > rte_vhost_clr_inflight_desc_packed; > rte_vhost_get_vhost_ring_inflight; > rte_vhost_get_vring_base_from_inflight; > + rte_vhost_user_slave_config_change; > }; > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.= c > index 0cfb8b792..10f2e47d5 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -2840,6 +2840,37 @@ vhost_user_iotlb_miss(struct virtio_net *dev, uint= 64_t iova, uint8_t perm) > return 0; > } > > +static int > +vhost_user_slave_config_change(struct virtio_net *dev) > +{ > + int ret; > + struct VhostUserMsg msg =3D { > + .request.slave =3D VHOST_USER_SLAVE_CONFIG_CHANGE_MSG, > + .flags =3D VHOST_USER_VERSION, > + .size =3D 0, > + }; > + > + ret =3D send_vhost_message(dev->slave_req_fd, &msg); > + if (ret < 0) { > + RTE_LOG(ERR, VHOST_CONFIG, > + "Failed to send config change (%d)\n", > + ret); > + return ret; > + } > + > + return 0; > +} > + > +int > +rte_vhost_user_slave_config_change(int vid) > +{ > + struct virtio_net *dev; > + dev =3D get_device(vid); > + if (!dev) > + return -ENODEV; > + return vhost_user_slave_config_change(dev); > +} > + > static int vhost_user_slave_set_vring_host_notifier(struct virtio_net *d= ev, > int index, int fd, > uint64_t offset, > diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.= h > index 6563f7315..86c364a93 100644 > --- a/lib/librte_vhost/vhost_user.h > +++ b/lib/librte_vhost/vhost_user.h > @@ -62,6 +62,7 @@ typedef enum VhostUserRequest { > typedef enum VhostUserSlaveRequest { > VHOST_USER_SLAVE_NONE =3D 0, > VHOST_USER_SLAVE_IOTLB_MSG =3D 1, > + VHOST_USER_SLAVE_CONFIG_CHANGE_MSG =3D 2, > VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG =3D 3, > VHOST_USER_SLAVE_MAX > } VhostUserSlaveRequest; > -- > 2.11.0 > --=20 The SmartX email address is only for business purpose. Any sent message=20 that is not related to the business is not authorized or permitted by=20 SmartX. =E6=9C=AC=E9=82=AE=E7=AE=B1=E4=B8=BA=E5=8C=97=E4=BA=AC=E5=BF=97=E5=87=8C=E6= =B5=B7=E7=BA=B3=E7=A7=91=E6=8A=80=E6=9C=89=E9=99=90=E5=85=AC=E5=8F=B8=EF=BC= =88SmartX=EF=BC=89=E5=B7=A5=E4=BD=9C=E9=82=AE=E7=AE=B1. =E5=A6=82=E6=9C=AC= =E9=82=AE=E7=AE=B1=E5=8F=91=E5=87=BA=E7=9A=84=E9=82=AE=E4=BB=B6=E4=B8=8E=E5= =B7=A5=E4=BD=9C=E6=97=A0=E5=85=B3,=E8=AF=A5=E9=82=AE=E4=BB=B6=E6=9C=AA=E5= =BE=97=E5=88=B0=E6=9C=AC=E5=85=AC=E5=8F=B8=E4=BB=BB=E4=BD=95=E7=9A=84=E6=98= =8E=E7=A4=BA=E6=88=96=E9=BB=98=E7=A4=BA=E7=9A=84=E6=8E=88=E6=9D=83.