From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D3A443BF8; Mon, 26 Feb 2024 21:56:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B81A42E4A; Mon, 26 Feb 2024 21:56:55 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 5049040293 for ; Mon, 26 Feb 2024 21:56:50 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1dc0d11d1b7so27758635ad.2 for ; Mon, 26 Feb 2024 12:56:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1708981009; x=1709585809; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=BJIh7k391Jm/rhK3rfovwkroz8Z15cGfr5XBmA3eikg=; b=YNnx1ckXCc6iRgVrY7oPaApykKkOZ12wrxM0/+szizwqs9kjS18NfOQPGYpKMRxj60 n4Qh8J2PSDqkTBGhc5MCAlKQLiobEcVZ+mt8OK4FhbulI8EepvAAKWZonEWztz1qzOxM 0wmFqFcfGjicPWHXONznFAUG5v1kvdaiRTOgWcXCT243VZeXg2Xi+IoDRD6C/3pikW5X 3jB6N9O265RiFWyydnu48wT0Fo9EMZBartYR+XA4pzxjocH4Nc62iE4oMgVl3DjkRHlE Vz5K2WPwHZs9/NyZOx4xYrUAqOAyMu3mL0uwjzDJDDrm6etRw0gx8GguJ+CUmy6DZyZh Ihlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708981009; x=1709585809; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BJIh7k391Jm/rhK3rfovwkroz8Z15cGfr5XBmA3eikg=; b=FPbOf2Ez5aVxyZAOrWQP1XtJhZtbBhFk3rheZCDq/W4mJObosC5k8X9ES87n+otApd 6lvzB5VWXZgEZyttKtAdqTl50GH0IvjBEuFOrglxLcOKG5bO2YrmX6FO4H9ricoWgsQn HjeRwVvcLKWg+b3El9dwsugWkKWCEUZtO6mco1yJTpwbxBOsD2GxABDp3CSPIUI0UEVE TxGpsbhH+oQzg+Zy9xlB6X8qI3+wAGACihab4jcmeGDkYN93kdvYSQATlQi99LKOzhWx APGPKd+60mqOhTTLlaTRU1kcQp+87j+p+DVg6nrBzeoSnX4S1T0J6o/3bWp1sfmy8y2D 00rA== X-Forwarded-Encrypted: i=1; AJvYcCVzRxqMWwfPYC1VPQNH61A+J4y0qtZ6NgMXbFUrOC2+Q6sBUMNhWp5Uo7LUbyk+M8R9WJu1DPficGzSreA= X-Gm-Message-State: AOJu0YxvXe7Fks7sCjc/A8GyRxFjdj+3G6JmMoYTITiKZNC1M6hd7LLM sZ1w5f81pF4nr125B5TiUn65f+D2B5IZO0fFZ5MM7eeU65ikxIbVyOrb111Tbq4= X-Google-Smtp-Source: AGHT+IGTjOu0CL/o1zasIdRcqAoUWxVryl+GDWvsIFES2/ZUeGn2ZnHb3mDxdUm2NL3/udeMNwdUeg== X-Received: by 2002:a17:902:ea0e:b0:1dc:30ab:406b with SMTP id s14-20020a170902ea0e00b001dc30ab406bmr9313297plg.13.1708981009519; Mon, 26 Feb 2024 12:56:49 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id o5-20020a170902e00500b001dbb14e6feesm113257plo.189.2024.02.26.12.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:56:49 -0800 (PST) Date: Mon, 26 Feb 2024 12:56:47 -0800 From: Stephen Hemminger To: Maxime Coquelin Cc: David Marchand , dev@dpdk.org, echaudro@redhat.com, Chenbo Xia Subject: Re: [PATCH v3] vhost: enhance virtqueue access lock asserts Message-ID: <20240226125647.1dc7cbc2@hermes.local> In-Reply-To: <2a0e05a5-c388-4cbb-9ec5-25c60ffe8aaa@redhat.com> References: <20231205094536.2816720-5-david.marchand@redhat.com> <20240226170553.824632-1-david.marchand@redhat.com> <2a0e05a5-c388-4cbb-9ec5-25c60ffe8aaa@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, 26 Feb 2024 20:40:57 +0100 Maxime Coquelin wrote: > > + > > +/* vhost_user_msg_handler() locks all qps based on a handler's lock_all_qps. > > + * Later, a handler may need to ensure the vq has been locked (for example, > > + * when calling lock annotated helpers). > > + * > > + * Note: unfortunately, static_assert() does not see an array content as a > > + * constant expression. Because of this, we can't simply check for > > + * vhost_user_msg_handler[].lock_all_qps. > > + * Instead, define an enum for each handler. > > + */ > > +#define VHOST_USER_ASSERT_LOCK(dev, vq, id) do { \ > > + RTE_BUILD_BUG_ON(id ## _LOCK_ALL_QPS == false); \ Rather than the opaque output of RTE_BUILD_BUG_ON, please use static_assert() directly.