From patchwork Sat Sep 15 05:20:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Nikolaev X-Patchwork-Id: 44749 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 41CA62BD8; Sat, 15 Sep 2018 07:20:24 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id A6B442BD5 for ; Sat, 15 Sep 2018 07:20:22 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id z96-v6so12387831wrb.8 for ; Fri, 14 Sep 2018 22:20:22 -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:user-agent:mime-version :content-transfer-encoding; bh=KtoIyVzEbjlqzpCjB71bKSe5n6FofRPxvg+k6JBkEVE=; b=S26DJZD/Cy+pjPEPS3nYHFLmyjmEky+1UyKto4RPGUZXlr0OriPFPqYYQjbNaB3kDB OaBRLVi0JPU9LINqqheQbNwFhcsCWzkaV7NVul6HPy6j+MkInL5K7t6w/VMHypKAbb/l aJLlIFq4LVX5QtgxP9YxFkAq4JZdwmOwSfmxhCZh3LHz/2aElaRf0iKhEO0Z2koJEDza bRu3+uUtW0n2TU2ejUBMZzyr3Jnto2MdG2WKFu2VhM8nKaxhyL1foDKu/NeA1rhiGUrq tflEG0HTbQBFngZAXdD5xJb+asqQMkvlOubc6Wr4MuTUNn1wFOgu3lGsI0cofiNlL6LM yYXw== 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:user-agent :mime-version:content-transfer-encoding; bh=KtoIyVzEbjlqzpCjB71bKSe5n6FofRPxvg+k6JBkEVE=; b=SdRUAtfKh6y8B3cEkhlFpN9ZlCjGff5XDbEp2gIxT03In0eLUNevro4ovntj2vabGv T7X3fKmSNBtDVNOK3aVSx9Zo5A0RUhPhSXSindBvEoijDPn9Xx6GRxO+bUB8L3MxN+TL vIp2QUhg8j3fjIZDpTEwRmvXUgNxe3oTtoxTQgTLlPnO3slUgrvtAtIDrQIdnRSG1jIm W4vZ93uCXcTZ6oDrYow4938wtpSJk6NAIUeuo5zWzW0ZGfZ8uqexYOMLiEW4s6NdBtAb dU9LrTxmKlflpFYNLT853NqkODZOquE+nGSCgilVZZNZyZloTPm7CeAXq6Edoe5xwafG rfIA== X-Gm-Message-State: APzg51Bl+Y9/DoGMOrjP1AcYz/cbdkMygpOTqKs8IuLoNQFmRJt4jrHV 3xjdOFSrbmlAkEl3FVb64y6bNJgsPyrylQ== X-Google-Smtp-Source: ANB0VdYdHxrGOB2vjMMJaDoZPhQxmD0D+84HK8M+19OYdSPIShxZrgtUgdFPLgx05D5l5TfUegOinw== X-Received: by 2002:adf:f8ca:: with SMTP id f10-v6mr12633765wrq.237.1536988821858; Fri, 14 Sep 2018 22:20:21 -0700 (PDT) Received: from [127.0.1.1] ([82.146.27.14]) by smtp.gmail.com with ESMTPSA id h82-v6sm795284wme.11.2018.09.14.22.20.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 22:20:21 -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:19 +0300 Message-ID: <153698873346.23049.10966616323159180622.stgit@T460> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 0/5] vhost: vhost_user.c code cleanup 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" vhost: vhost_user.c code cleanup This patchesries introduces a set of code redesigns in vhost_user.c. The goal is to unify and simplify vhost-user message handling. The patches do not intend to make any functional changes. v3 changes: - rebased on top of git://dpdk.org/next/dpdk-next-virtio dead0602 - introduce VH_RESULT_FATAL (Maxime Coquelin) - vhost_user_set_features return VH_RESULT_FATAL on failure. This allows keeping the propagate error logic (Ilya Maximets) - fixed vhost_user_set_vring_kick and vhost_user_set_protocol_features return VH_RESULT_ERR upon failure - fixed missing break in case VH_RESULT_ERR (Ilya Maximets) - fixed a type on the description of 2/5 patch (Maxime Coquelin) v2 changes: - Fix the comments by Tiwei Bie - Keep the old behavior - Fall through when the callback returns VH_RESULT_ERR - Fall through if the request is out of range --- Nikolay Nikolaev (5): vhost: unify VhostUserMsg usage vhost: make message handling functions prepare the reply vhost: handle unsupported message types in functions vhost: unify message handling function signature vhost: message handling implemented as a callback array lib/librte_vhost/vhost_user.c | 402 ++++++++++++++++++++++------------------- 1 file changed, 216 insertions(+), 186 deletions(-) -- Signature