From patchwork Tue Nov 7 18:07:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 741921 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1767482wrr; Tue, 7 Nov 2023 10:08:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAzw1MBJ1ZW04OxX/nn1WazIWdpf7DAuGLrce51G3o/FV21us8ELR5I2ypzeI2AJNQLeCq X-Received: by 2002:a05:6214:246b:b0:66d:1d92:c694 with SMTP id im11-20020a056214246b00b0066d1d92c694mr43109694qvb.58.1699380485693; Tue, 07 Nov 2023 10:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699380485; cv=none; d=google.com; s=arc-20160816; b=lwPXkBWjT7+PoPrwG1bBSDqs3m1jS/tI02URv+hCr27ql5pNW/DQxk2s4NrS1nMyBr Vkzwa08glG9LQoy3v8VFc4++z2sHdr6n2PttX6THyl8FfSPRWdb92GNGgyoMoQidPFH8 UgxOkVM8Y9wf0GKcThrXj6l1VHTzi4KQTWv1omhsYuIY+s0wERgpzYprgNgB3N5FU5dI t40m0+w615pfgnJQoenQzCbB1H7ssUpGIi1rRfwvvDSp4w9JeqNvA7nH8sgNF0AJmq7+ U3VUeIQ/H/cehJ1iZUBl9t+BVaAJkm2K4XD8vmXK015MhOZa+m+r8MqU+gJ/ZVl8hGoM v0PQ== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=+9XW3EHOKM/MWCXapoGb3UX+brT9mes7VJQxcqljpE0=; fh=8P8vqBg15kEl+uTM0qDnKhkhuRKnATOCo5N33kas82w=; b=YKSoUbjKSp9faFv2qW6pOloqqaKtCxzva4sRsotjARxoqUm21D4qbUR6LJcFWpyw/6 A6FpCCVVk2P2bBNI8is21JCF3P0lw1fp5mEUwpxQ9yUGHwJRxAoseE6GQMIt2pGWrWr7 16i56XOsx2wNsX3Q4GUZz3c+8z82SVDn3rkAMHzgcPDZb7kQRqcPYz2ILAzkV56dbs18 7Dvjv7dYWrSeRuhd5hMNMculiSVQnWpyvpxypFOtH4Es4L2yTgOHATHh5lOOSTUgrGTr EqYbTqNtAIIFshOW0X9ZnexDIEzIlGVyG+/epXBcVgSvTy2jEzOsnWSg7l/10NJJQF9t FdUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E7ZJ/AZy"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id qr22-20020a05620a391600b0076caee4b64esi194568qkn.262.2023.11.07.10.08.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2023 10:08:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E7ZJ/AZy"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0QUY-0006kq-9C; Tue, 07 Nov 2023 13:07:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0QUW-0006kC-Fa for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:07:56 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0QUU-000246-MI for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:07:56 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4094301d505so44574275e9.2 for ; Tue, 07 Nov 2023 10:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699380473; x=1699985273; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+9XW3EHOKM/MWCXapoGb3UX+brT9mes7VJQxcqljpE0=; b=E7ZJ/AZy/Q+G7hsYxlXWmfXlCswQqFomxmBur5DUywCstsrZTrDDHRKBKaWR0LSLIi nUUPhhv4KL3kfrTMImwzPmFw6iOY/XOLKmxEmvlI6JHS8wPzmRIHC0Y+L85hKnWaFs8k F1U5n+dJd0AOPF/G/hXRvs6ttow/omvhqabsHuzWet4CnSf22B/hCGSzQrj+qtyKNhWm zf8G4YR+cZbvQWMsed3l9gRRTtyyUz+gkBFQV73QtJYLlVQvUaw3xdciiibXM78TECYD 4d/pYqO2sHht3q3HJDFBCqmwoekdX2/JpTYE5Xk0mCaaDbaWrXEWauZp8hbhhjqlo8d/ r0Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699380473; x=1699985273; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+9XW3EHOKM/MWCXapoGb3UX+brT9mes7VJQxcqljpE0=; b=H94lIfh6FWDpFOw7VLkpxcOCpxueQZkjgXCQo4UwgnaHg8QPIxkeJAL+Rs6lszA3x8 rlfOt11PHPBVHcTQx6mNjB9HF+lP7xHT+yBzwDgV9iW8og9fQpR2d3DYUQw/nhKLowX2 u77Xlj5PGsjiJg0AkBVR3G7fzFS3eyb9OPKuj/f6bz0zW0dcDFhrC7LOKNAljq3cBOuZ 7s1XfSNLDoKeGOqWDBkBYEuHc2xx6IdR5YLWPLC3/eRdKwn01TEkW9qmQWG1n88m8gBJ ZoSGiOKUcQT8MJLr/JbnnNPMzbXpQFl3eA9r1V2dqf9yYEaMRlOvtHFuAkUK7Fu4i+3p xyVw== X-Gm-Message-State: AOJu0YxD6NA7m9FoTNXlKkhQscvFkZ+cgOD3daDR4crBoyTtbQQNfXFu osoZmJtyu6bPOL3NqfNk+Gc0hA== X-Received: by 2002:a05:600c:1384:b0:405:3ae6:2413 with SMTP id u4-20020a05600c138400b004053ae62413mr2925122wmf.25.1699380473122; Tue, 07 Nov 2023 10:07:53 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003fee8793911sm16851906wmq.44.2023.11.07.10.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 10:07:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 665CC5F790; Tue, 7 Nov 2023 18:07:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Viresh Kumar , Eduardo Habkost , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Erik Schilling , Raphael Norwitz , Jason Wang , Eric Blake , Manos Pitsidianakis , Markus Armbruster , virtio-fs@redhat.com, Mark Cave-Ayland , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Gerd Hoffmann , Mathieu Poirier , "Michael S. Tsirkin" , Stefan Hajnoczi , Hanna Reitz , qemu-block@nongnu.org, "Gonglei (Arei)" , Fam Zheng , Kevin Wolf Subject: [PATCH v8 0/7] virtio: cleanup vhost-user-generic and reduce c&p Date: Tue, 7 Nov 2023 18:07:45 +0000 Message-Id: <20231107180752.3458672-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org A lot of our vhost-user stubs are large chunks of boilerplate that do (mostly) the same thing. This series continues the cleanups by splitting the vhost-user-base and vhost-user-generic implementations. After adding a new vq_size property the rng, gpio and i2c vhost-user devices become simple specialisations of the common base defining the ID, number of queues and potentially the config handling. I've also added Manos' vhost-user-sound while I was at it. Changes ------- v8 - scrubbed errant Message-Id v7 - various review comments - move to async teardown (fixes CI failure) v6 - re-base to current master - make vhost-user-device abstract - mention abstractness in docs v5 - addressing comments and tags - improved the docs v4 - dropped the F_TRANSPORT work for another series - added vhost-user-sound Alex Bennée (6): virtio: split into vhost-user-base and vhost-user-device hw/virtio: convert vhost-user-base to async shutdown hw/virtio: derive vhost-user-rng from vhost-user-base hw/virtio: derive vhost-user-gpio from vhost-user-base hw/virtio: derive vhost-user-i2c from vhost-user-base docs/system: add a basic enumeration of vhost-user devices Manos Pitsidianakis (1): hw/virtio: add vhost-user-snd and virtio-snd-pci devices MAINTAINERS | 13 + docs/system/devices/vhost-user-rng.rst | 2 + docs/system/devices/vhost-user.rst | 70 ++- ...{vhost-user-device.h => vhost-user-base.h} | 21 +- include/hw/virtio/vhost-user-gpio.h | 25 +- include/hw/virtio/vhost-user-i2c.h | 14 +- include/hw/virtio/vhost-user-rng.h | 13 +- include/hw/virtio/vhost-user-snd.h | 24 ++ hw/virtio/vhost-user-base.c | 354 +++++++++++++++ hw/virtio/vhost-user-device-pci.c | 13 +- hw/virtio/vhost-user-device.c | 338 +-------------- hw/virtio/vhost-user-gpio.c | 406 +----------------- hw/virtio/vhost-user-i2c.c | 272 +----------- hw/virtio/vhost-user-rng.c | 278 +----------- hw/virtio/vhost-user-snd-pci.c | 75 ++++ hw/virtio/vhost-user-snd.c | 67 +++ hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 23 +- 18 files changed, 719 insertions(+), 1294 deletions(-) rename include/hw/virtio/{vhost-user-device.h => vhost-user-base.h} (71%) create mode 100644 include/hw/virtio/vhost-user-snd.h create mode 100644 hw/virtio/vhost-user-base.c create mode 100644 hw/virtio/vhost-user-snd-pci.c create mode 100644 hw/virtio/vhost-user-snd.c