From patchwork Sat Sep 15 05:20:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Nikolaev X-Patchwork-Id: 146753 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1446176ljw; Fri, 14 Sep 2018 22:21:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdalvSDT8RTsqYhAWBTv3dgdSY4w0tkEaXX4FrOZgoeKgff487IF7qcM6zMHvk8xJAqaBj2s X-Received: by 2002:a5d:434c:: with SMTP id u12-v6mr11846040wrr.189.1536988859969; Fri, 14 Sep 2018 22:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536988859; cv=none; d=google.com; s=arc-20160816; b=LE5Zz1b5CjEr5EqtUQckXbdAuwhQM0d6sZNmHIwAOyI7iYkL6LnJaZzxlgnsRtvqj8 fNR0ji128Da6Dy6qx5cyNkXcNACMK7lKEpcrXhdywNGIDA42zxvO2IgfAE7D18pYaC+k j7/A74nKV5ZCCdzlwtVorNh7+NpaZcqcPDRFOwsCNl2E44v8L3E0pRZnaao6zbyijMxV AYCxIylzQKWML0K54wRkv5RhNaB/Mw/Pa0Uni3awAT77j35v6iAHFqxz/vyyD5iDIvsz eNkVQsekhg5VMa6AWWVK9cu0yClZffJQUHckQoxcZAKtWuDYmRtv45Ti9KGNIjEr9ZSU E98g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:user-agent:references :in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=wSyLR66ibmeohSkyjhR+kIs69sar6ev7WV4Pnz8Oy5Y=; b=GZ+6sRAu3ll9ekk5fCLHznyuZbssd339yOvd9Sb7vQ/17l8GHdcPUdTkqUHKau/QBs lBej0HJ/XNhoUEEuHTAvwYcFV+BtEaOedi2G4oXThdw3sIL2ge7QTfCnP4b12auBVxs2 txcHMsw1d3eQdscBCGyj5E3T62zlDc+uzDjnYiWKTt3YNxvs2VjUPddIretc7g5mkcMO 4nUZ3eZMxRmTRqZGJEHboU6JDmVcUjkfDkPUJZcZEgyhd6WlYQP8W3gVffyZyCbd9OuA BuEq3nsU5L4YHtMZOOUurmUANvHJTW3u8K+YC/vp39u6y0mAU/FcIXBnegsuYJzgkClc Gvag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=OHayr3e1; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id a85-v6si859648wme.181.2018.09.14.22.20.59; Fri, 14 Sep 2018 22:20:59 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=OHayr3e1; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 461D55689; Sat, 15 Sep 2018 07:20:47 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 4C996532C for ; Sat, 15 Sep 2018 07:20:43 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id 20-v6so12339905wrb.12 for ; Fri, 14 Sep 2018 22:20: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=wSyLR66ibmeohSkyjhR+kIs69sar6ev7WV4Pnz8Oy5Y=; b=OHayr3e1ejOlHnAsCRH91rZUob31mx9Ulc/2UT9KoE9s7mOUByjJUbUbkouexeK4q/ HzZd1DiHdOX7ylUCmZqZYEI5IjAzrvCJ3y85tl/dbEuG6xjFREdLVSa8RZsrJBazyKNM JIi4jTbANWSBFPCVDsBoqBb/+pevHfsL8tm3L6BJ/w+OGbpmHZHq3ha3P6iQMBh4oRi2 8TWgPM3VRlGxwkha7nuXfcffPaXC5Imx2d1M2TcH8yBO1tM0dVE6S5OqSDYHgDfAWLbP 2yhP1lWofWKkyx4PVNln9bd2AayA+x8YjNeOnktO7eeQY/1CnfnBodZQ5NvaPgzJ7B1c frJQ== 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=wSyLR66ibmeohSkyjhR+kIs69sar6ev7WV4Pnz8Oy5Y=; b=oKXKihcmkSMCDgDdZ2t6lNKNpTfjxQ9BZKKxT5pRCB1TuiJhpYjZZ4PzAkP6q94YRG NFVCN+TNmDVRvlCZRqQN/HGr1G0ddKNpqs/IiNS/CPVx9ZT/KAqyDBMQH+b3EdOuqJrV Q90ILJea90XVzGuKJMLJBaoXKXMpQnhbgbwSZMzDSsRvzsJkFQ7xkoO8w/OBjKYFeXP5 EQAJXEol2rVVfEy2Pfwmz3szl4GQw+9DNT6jKk5hsZFGAC5ZXZ+ax45m8gbPni1AUy9V PdT3n2e3H8NM7Gmya6uGooOGjq3yTOs0XAcdi9U5ha3Kv2U3GAlUAw0xZjrbG2uEQnX9 YcQg== X-Gm-Message-State: APzg51BpBjM6mPa5A4/noPZ/qUfAfGSIaj/E/ESnlgyNhsAyKSmDhzSh J+yEwse2UaBsqU8jCxIOPwTCpmXIExrn3Q== X-Received: by 2002:adf:add0:: with SMTP id w74-v6mr12399288wrc.73.1536988842801; Fri, 14 Sep 2018 22:20:42 -0700 (PDT) Received: from [127.0.1.1] ([82.146.27.14]) by smtp.gmail.com with ESMTPSA id j133-v6sm1996725wmd.12.2018.09.14.22.20.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 22:20:42 -0700 (PDT) From: Nikolay Nikolaev To: maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com Cc: dev@dpdk.org Date: Sat, 15 Sep 2018 08:20:40 +0300 Message-ID: <153698884084.23049.3225944257155202776.stgit@T460> In-Reply-To: <153698873346.23049.10966616323159180622.stgit@T460> References: <153698873346.23049.10966616323159180622.stgit@T460> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 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 --- 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 3a00d53cf..c38b0fd70 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1022,6 +1022,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 int vhost_user_set_vring_kick(struct virtio_net **pdev, VhostUserMsg *msg) { @@ -1259,6 +1267,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 @@ -1703,8 +1718,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: @@ -1732,9 +1746,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: