From patchwork Thu Jul 19 19:13:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Nikolaev X-Patchwork-Id: 142376 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2093319ljj; Thu, 19 Jul 2018 12:13:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfw6R8bI0wRb0uDEziu8FxqP++n+rXwTv+f19RhbZJBGrAomVQ/KTwMVS2zB0aopyrGpcq5 X-Received: by 2002:adf:b243:: with SMTP id y3-v6mr8812824wra.90.1532027606571; Thu, 19 Jul 2018 12:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532027606; cv=none; d=google.com; s=arc-20160816; b=bYuDvPySF5wQfPJnitfspZ9qNKBea4H+F1X+uhU2TeooVy7jBkTZ8VANEVSW0l7i5O wIA4nl0YczVmTC5PAKdn0GM/cfmApS/TuNAzp6CNV9kmR9qt9U2Th5L7DUwVSHbkQp// p/2wA7QOGi9CSUS1CgryMeJH5F0SQoC0tN1J+0/6gyNdr6aQO0ry+4BovyT0GDohRF6D kj4rWpzkuZIkZf+Rnw6jkAxokXD7zfEKeMvHvkKOznyNSmCP0If4lH00aH0zb3Pscj1k ZqSAYxQ3cQahZ9qle5fceUYEc9ux1TYsCPHD4o9QLvaZXHWGBH7VAVh7VMGjIcU25ruf hFBA== 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:message-id:date :cc:to:from:dkim-signature:arc-authentication-results; bh=gdZr0fdCHEYxPzaiQOzXM3djjtpxdn7VeEvvyPrZuqE=; b=FY8tDl7bv0BfZK+WQCptGjVWnfWBU57gkDn8H0VYy8fEpc9JLftyOYqm4lpn1iYird EwU+/rY3WHAju8WCC1pSTMbE4390Zy4AC+VGA2iSP1l4tSlEpgPbxPs64V+xejQ52wYk 3IjmbftFhLPNx74Rfs/CmZbFROLM2UEVB0zPSZt5hVzJPtC34IvFLvScb6xGPi219gmS Lp8YiVoOJmu3NJBZa6ZljhufONO4EkPmLBKiakbO9I7KvOwnI1d3lPss+QVAKHVRdSxU +HEXqg/FiSGlYygCfGGrvHCGjdG2avLjcwTcxoihPRtgDhXpFvHNftOLMXD53KReZSMc rqnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=p3Bwwur4; 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 e17-v6si5307964wrj.406.2018.07.19.12.13.26; Thu, 19 Jul 2018 12:13:26 -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=p3Bwwur4; 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 8D0825A6A; Thu, 19 Jul 2018 21:13:24 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id DA16E5951 for ; Thu, 19 Jul 2018 21:13:22 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id v14-v6so9102125wro.5 for ; Thu, 19 Jul 2018 12:13: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=gdZr0fdCHEYxPzaiQOzXM3djjtpxdn7VeEvvyPrZuqE=; b=p3Bwwur4iWXYXuj77vVcgPPCLaZzq7wfHZEu2oei+gHoIwPZwUFs+8WKMRIjupUeyz E8kux5hP1Pix3HK/CvviU4SRE9Uch9kO0+lb7q4YUEvykpnN78M57/OwIt7CDLAiuhZf rO4n7ZpgxaO3RA9IDEqp8Ka1I2n/CvORnwQMR15OCA2p6ZFbGEMSVjIo/t4qScx8+PWp bk1k9OFpnBy22HxfZ67JFh4lYWirWwK2gVDcfuxnPDM6SgLVoOuRJQa0Y4YhnH3hSW20 bcb26ZoZrJpKo6ivKMX7YHRabmdTHR3qMw7aEx9H8tY6ES+kzaYyFANEDJDSeGzWIkJM +Htg== 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=gdZr0fdCHEYxPzaiQOzXM3djjtpxdn7VeEvvyPrZuqE=; b=lBcS90KzbHPsBE2mWfJZFElrAmw0Ww9e0f57FUo2TuOyZROCFn6sWDD82RL+dzHwCc 6qu85PJ4z2oW7hVfcFdEDLmvR8PGm9XSyvJ9XLOcGvBnKthMdiT1oGL56vlGWWXoTmgI Me3A0oRB3quWqADkOgMs0S7rXtNye1FIUstHsrhrvZtFzDuJlJw1NNRMVhAtnlFQ7VUW T7xzco2XmA6iwsl+RDNHVeTl8uImRTFK6Z39776i9MljgQxZk1X5yonX+ZDwVr7A2Ms/ lgG5ESZpK0XMLboPYsk+vTysy5aTMjTOJM3rAC8RX4upw/Yt6r7/PM854+gr+AjJ18Ol 3o5Q== X-Gm-Message-State: AOUpUlEPa8BM69Ez2rWQMCeYOoyTDG+BG+FcJ3c+1eqfzAFanm+yxL8/ C7g9GqnkuiSiovilFlkLWFfBb1YjtKE= X-Received: by 2002:adf:e642:: with SMTP id b2-v6mr8945617wrn.254.1532027602308; Thu, 19 Jul 2018 12:13:22 -0700 (PDT) Received: from [127.0.1.1] ([82.146.27.14]) by smtp.gmail.com with ESMTPSA id 14-v6sm572030wmg.0.2018.07.19.12.13.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 12:13:21 -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:20 +0300 Message-ID: <153202755842.21481.1772155561595981441.stgit@T460> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 0/5] 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. 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 | 392 ++++++++++++++++++++++------------------- 1 file changed, 208 insertions(+), 184 deletions(-) -- Signature