From patchwork Mon Sep 24 20:16:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Nikolaev X-Patchwork-Id: 45242 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 C48481B171; Mon, 24 Sep 2018 22:17:00 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 273891B170 for ; Mon, 24 Sep 2018 22:17:00 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id y25-v6so3613208wmi.1 for ; Mon, 24 Sep 2018 13:17:00 -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=pOYbJNVyEZnF4AEUoEMq9/ScJh89TgIahrC+PWZ58BE=; b=pndQqIU4KQOMwYU+XQieCBBfVCOCCmumPgbuWXWx8U1WhIXEyRygsyychuTdNazzr/ gkZZh20XzyoQxzomMM4Pju9YZGLaHjJHvwkkg7DHS2OH6dgPDSul+dHuCjSrYJ9QsNOR lMY696q7lbED+Y6VOeeT3HO+y4lxY2I11Uq7/FuKwgDuYXKmG5/MFw4h4WgKjzOao/zi 0ka9/tDRBGyyF1zprBdnXKLEUEFXqXJ/617InN79K5HPAQlqQOpHqlMYDbADJmSPKMdd wIgzXOZFZ2pxSV+3x0TpIJvyiWF9gSVM5N/EIF2a5y/PT/PpSxaFPv8fuT3jp7ioS+lg kEDA== 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=pOYbJNVyEZnF4AEUoEMq9/ScJh89TgIahrC+PWZ58BE=; b=b2SSlKEa4BZDVBjv1GRMPdI/W4Ehs5QTlO/EIg2gJqPKeyw55/P7DGlRbVHzlo+KVE OK0jKPH5MF9mmHdKYGZ2pq3QEpKX3EK7EsdEVsMU5JzNzKzUHz0+5fhoPcZdBz3F9l2l uXCINVykX3hKtnvqmIiMvMC3e9wCcyz9ZLk8OB38GqdViikQBrTrm3kf0OpsW4VN9XkH MjralNBWzdiw0JoAHtVt8QDuMpVqn+sK2u/9Rs3SMtAvjXoLD8oERL2u6DYpcVL5lgrJ 0zXK+QUCtNrOOAy66gw8CJTPnpeKTXwRQs9APsVtlzJyI7h300MJBwaJXXSpqPqdfdlZ kedw== X-Gm-Message-State: ABuFfoiCgjZqc2xR/MeRhWJUel6vYeWIXHE5zBQCqEPJE9QQZWUGKfPE LB07hF7Byqg3TrPmIAzYiNp+piTnqVLV+A== X-Google-Smtp-Source: ACcGV62v5emxYlzDxdVZtjnNgXWHz0hNoHbuGtNPFwdt1NjPJ30yi40WvE/DeFex8e9a1IVVVBlRog== X-Received: by 2002:a1c:545d:: with SMTP id p29-v6mr41776wmi.94.1537820219449; Mon, 24 Sep 2018 13:16:59 -0700 (PDT) Received: from [127.0.1.1] ([82.146.27.14]) by smtp.gmail.com with ESMTPSA id s2-v6sm351444wrn.83.2018.09.24.13.16.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:16:58 -0700 (PDT) From: Nikolay Nikolaev To: maxime.coquelin@redhat.com, anatoly.burakov@intel.com, tiwei.bie@intel.com, zhihong.wang@intel.com Cc: dev@dpdk.org Date: Mon, 24 Sep 2018 23:16:55 +0300 Message-ID: <153782013094.27450.17651924330876922486.stgit@T460> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 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 introduce 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 introduce any functional changes. v6 changes: - Even more fixes to the usage of struct VhostUserMsg in the patches (Anatoly Burakov) v5 changes: - fixed the usage of struct VhostUserMsg in all patches (Anatoly Burakov) v4 changes: - use struct VhostUserMsg as the coding style guide suggests (Anatoly Burakov) - VH_RESULT_FATAL is removed as not needed anymore (Maxime Coquelin) 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 Reviewed-by: Maxime Coquelin --- Nikolay Nikolaev (5): vhost: unify struct 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 | 394 ++++++++++++++++++++++------------------- 1 file changed, 209 insertions(+), 185 deletions(-) -- Signature