From patchwork Thu Jul 19 19:13:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Nikolaev X-Patchwork-Id: 43221 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 467D65F12; Thu, 19 Jul 2018 21:13:44 +0200 (CEST) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 6FFCE5B2A for ; Thu, 19 Jul 2018 21:13:43 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id z13-v6so7465710wma.5 for ; Thu, 19 Jul 2018 12:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=WCSiwYONcpbm/m1/uhhMkrStdpQpy+aMGCslI1fCi60=; b=AAoxIMhGKdUATAMcrE9X73y8EizSiCANH7i/MvoWg3oylOHNc7exB0M6I9drGeGdCP Edj9W18mzzQGQJl2vnfYESpJwgVxLwkqvaov+r/nCYYBFTMYYI1UDeJKfNvV0yOCiPQ0 dkqCp2wYOiZS6uMVd5sWxux7HHHJW41sy/75WweEwYrwM21BeoqnP2GfG2lPFuDdXv8J dxJyaTYrgArhMUeidvDhB9IO+KekiMw+sDUZha8MQT9SMR0EVrtva2EuwooVZ4x9pan3 6kmPlDm65TSeWjiz48MMW5SkVqlNz9XmzG9lwntXJebuwb3AXyAang4xQLsqextdVLaF lCxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=WCSiwYONcpbm/m1/uhhMkrStdpQpy+aMGCslI1fCi60=; b=j0Sd7BEbzf/xtD7Yz+WjeUxSe6/ryldPGvJc6VK+M7T1P9QRAlaoJMSY/4BAJ04iMS d97dfC3/a3rqWNFfyH7Ek1y4bgta0EePdvNcykS+OAitteaMlmoUJURnF98X0QIGSN3o Q1Sk61haeKSEJWQVlDNPItOMYlcs20FOxQBAQpKnSNVBRyVWiuuxPOUdIFZ85CLbGYXF HKwkViu2CQHJBvPojFRCeqDUxpCVArSrQO63s1E94zghuYRZbbJxp4pr6d/LgFwwawkM e4L9WIvUcGBvHfQy5vqIzpOtu2t1pVADFjsuT6QEZ/SYwjCfzErRz3b/G6UnJwiiDe/p iMRg== X-Gm-Message-State: AOUpUlEe5iEOTZpsCavqj9S33sjTTxKFa3yArYNQf1N+VAQjdLqONEZm QWuLCUE57J3le0Q6n6PeVIPRhOpG4DQ= X-Google-Smtp-Source: AAOMgpdd/vzmWaH0hyk1CRGRuKLfyk5RIhkAhYyIvRG1J6AhlpCll1Wr0ghX1v0iHMk3r5rSZWi/Bg== X-Received: by 2002:a1c:d607:: with SMTP id n7-v6mr4927274wmg.150.1532027623001; Thu, 19 Jul 2018 12:13:43 -0700 (PDT) Received: from [127.0.1.1] ([82.146.27.14]) by smtp.gmail.com with ESMTPSA id h14-v6sm9296506wro.15.2018.07.19.12.13.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 12:13:42 -0700 (PDT) From: Nikolay Nikolaev To: maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com Cc: dev@dpdk.org Date: Thu, 19 Jul 2018 22:13:41 +0300 Message-ID: <153202762111.21481.10403768024279892271.stgit@T460> In-Reply-To: <153202755842.21481.1772155561595981441.stgit@T460> References: <153202755842.21481.1772155561595981441.stgit@T460> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 3/5] vhost: handle unsupported message types in functions 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" Add new functions to handle the unsupported vhost message types: - vhost_user_set_vring_err - vhost_user_set_log_fd Signed-off-by: Nikolay Nikolaev Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index e97b2d563..b408460f0 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1015,6 +1015,14 @@ vhost_user_set_vring_call(struct virtio_net *dev, VhostUserMsg *msg) vq->callfd = file.fd; } +static void vhost_user_set_vring_err(struct virtio_net *dev __rte_unused, + VhostUserMsg *msg) +{ + if (!(msg->payload.u64 & VHOST_USER_VRING_NOFD_MASK)) + close(msg->fds[0]); + RTE_LOG(INFO, VHOST_CONFIG, "not implemented\n"); +} + static void vhost_user_set_vring_kick(struct virtio_net **pdev, VhostUserMsg *msg) { @@ -1246,6 +1254,13 @@ vhost_user_set_log_base(struct virtio_net *dev, VhostUserMsg *msg) return 0; } +static void +vhost_user_set_log_fd(struct virtio_net *dev __rte_unused, VhostUserMsg *msg) +{ + close(msg->fds[0]); + RTE_LOG(INFO, VHOST_CONFIG, "not implemented.\n"); +} + /* * An rarp packet is constructed and broadcasted to notify switches about * the new location of the migrated VM, so that packets from outside will @@ -1689,8 +1704,7 @@ vhost_user_msg_handler(int vid, int fd) send_vhost_reply(fd, &msg); break; case VHOST_USER_SET_LOG_FD: - close(msg.fds[0]); - RTE_LOG(INFO, VHOST_CONFIG, "not implemented.\n"); + vhost_user_set_log_fd(dev, &msg); break; case VHOST_USER_SET_VRING_NUM: @@ -1716,9 +1730,7 @@ vhost_user_msg_handler(int vid, int fd) break; case VHOST_USER_SET_VRING_ERR: - if (!(msg.payload.u64 & VHOST_USER_VRING_NOFD_MASK)) - close(msg.fds[0]); - RTE_LOG(INFO, VHOST_CONFIG, "not implemented\n"); + vhost_user_set_vring_err(dev, &msg); break; case VHOST_USER_GET_QUEUE_NUM: