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 61F88A04F5; Thu, 5 Dec 2019 05:02:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 381351BF7F; Thu, 5 Dec 2019 05:02:09 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id C14824C9D for ; Thu, 5 Dec 2019 05:02:07 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id z3so1780014wru.3 for ; Wed, 04 Dec 2019 20:02:07 -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=B0WgAgbeAvQQ9KNTTO7v27zUyAdd/bYIhMPkg0ZyB6w=; b=j0g2GLq3dEqlpLxLQJauLh07EM5tVhy9vnJqd+NqIyMUZKIe+41O25PR3+Zl8/1T6p ZjSv4+Cb03xuTkNNBEmk082aOVT1F1C6mZcDHQ97Qm2AhexjngCoIqhyIzx38hfcxRbk mw1vswPQuXqY0GAQOG2qGgsjC2Mh0Dwiatn9+1QFRacLY98aHBudKCOMCpW3P5YK8N/A GUwrfHZ0gkXuDegUrCZ+OIFNoT610E8xEnWUOF6TR7U19uzmYEFmBRMJRV8AkiZNCMiu xhd+6RVBudSbBv1e6gkgi9n8u4ahhjEPC6mitDPl4JZsgPZaNkvxLd0rLjOnPT6tQT/Q Dr+g== 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=B0WgAgbeAvQQ9KNTTO7v27zUyAdd/bYIhMPkg0ZyB6w=; b=rSvTN9+lvhJjzZP0cawHFT9TlAYWC6vCNOMkjOd5gD4i6xYnU4zpFRumMpzJmc5IDd QqLD8nT2EV7dlMB/xzd/EnIzOn8rYVZ0ibt6tpAkcQVH6YQaB9L72aTjRqADwvsCf/Pm ibqjImMyeAlWOVI5y03GIkHQ2FnFEpECyeYzSzgJjdlEW31ypj9jT3xUUl2hRW0yzC72 vavOpHBCq4MwQObvdkf20d+zsY+nxzW6Ej8IhRtXobYRNG3xcxwqORYCP7nRl1AmPtO6 O6gqJHrtsPa9C0WxC1666rnztYWbmqkdz9dOlngKG+Zt13xYJk9iBZhkqBH41+vCb7am 6Svg== X-Gm-Message-State: APjAAAUW2kijrwuwQyeOfFToaewaT3bzu+Jtgm4YIPP9Twij3B0SAMgf h/1ihOZzd6knfnVInlJ7Gga63zumMn6fZbygwv1Dhjgx5Zn8KcmY0qq4obt51mpY2IH+xpHng1i 3UDnuUTmiv9gy X-Google-Smtp-Source: APXvYqyCDaXynUp8nkCLRLrBFO0fBE9KHlK7OOP5VLsJeIGVkU4siuzL0JiwZ6aiQMdM2a5zyhXiSivJjt9ytUN3z7I= X-Received: by 2002:adf:db01:: with SMTP id s1mr7100304wri.372.1575518526892; Wed, 04 Dec 2019 20:02:06 -0800 (PST) MIME-Version: 1.0 References: <20191202145735.9763-1-fengli@smartx.com> <20191204051320.26326-1-fengli@smartx.com> <20191204093029.GA460974@___> <20191205020703.GA481044@___> In-Reply-To: <20191205020703.GA481044@___> From: Li Feng Date: Thu, 5 Dec 2019 12:01:55 +0800 Message-ID: To: Tiwei Bie Cc: Maxime Coquelin , Zhihong Wang , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v2] 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" Tiwei Bie =E4=BA=8E2019=E5=B9=B412=E6=9C=885=E6=97=A5= =E5=91=A8=E5=9B=9B =E4=B8=8A=E5=8D=8810:06=E5=86=99=E9=81=93=EF=BC=9A > > On Wed, Dec 04, 2019 at 05:43:50PM +0800, Li Feng wrote: > > Hi Tiwei, > > Thanks for your reply. > > Yes, this new API currently is for vhost-user-blk in the SPDK project. > > I see. Thanks for the clarification. > In this case, it should be declared in rte_vhost.h instead > of vhost_user.h which is an internal header. And the symbol > should be added to rte_vhost_version.map as well. > OK, one more question, should I add `__rte_experimental` tag before the declare? > > > > There is a patch in SPDK to use this API. > > Could you share the link to the SPDK patch? > The patch is here: https://review.gerrithub.io/c/spdk/spdk/+/476704 Thanks. Feng Li > Thanks, > Tiwei > > > > > Thanks, > > > > Feng Li > > > > Tiwei Bie =E4=BA=8E2019=E5=B9=B412=E6=9C=884=E6= =97=A5=E5=91=A8=E4=B8=89 =E4=B8=8B=E5=8D=885:30=E5=86=99=E9=81=93=EF=BC=9A > > > > > > On Wed, Dec 04, 2019 at 01:13:20PM +0800, Li Feng wrote: > > > > This msg is used to notify qemu that should get the config of backe= nd. > > > > > > > > For example, vhost-user-blk uses this msg to notify guest os the > > > > compacity of backend has changed. > > > > > > > > Signed-off-by: Li Feng > > > > --- > > > > v2: > > > > * Fix a little log typo. > > > > > > > > lib/librte_vhost/vhost_user.c | 31 +++++++++++++++++++++++++++++++ > > > > lib/librte_vhost/vhost_user.h | 2 ++ > > > > 2 files changed, 33 insertions(+) > > > > > > > > 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= , uint64_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 *dev, > > > > 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..5c1bb2138 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; > > > > @@ -158,6 +159,7 @@ typedef struct VhostUserMsg { > > > > /* vhost_user.c */ > > > > int vhost_user_msg_handler(int vid, int fd); > > > > int vhost_user_iotlb_miss(struct virtio_net *dev, uint64_t iova, u= int8_t perm); > > > > +int rte_vhost_user_slave_config_change(int vid); > > > > > > This is supposed to be an API for external backends? > > > > > > Thanks, > > > Tiwei > > > > > > > > > > > /* socket.c */ > > > > int read_fd_message(int sockfd, char *buf, int buflen, int *fds, i= nt max_fds, > > > > -- > > > > 2.11.0 > > > > > > > > > > > > -- > > > > The SmartX email address is only for business purpose. Any sent mes= sage > > > > that is not related to the business is not authorized or permitted = by > > > > 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= . > > > > > > > > > > > > -- > > The SmartX email address is only for business purpose. Any sent message > > that is not related to the business is not authorized or permitted by > > 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. > > > > --=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.