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 8FFD245A82; Wed, 2 Oct 2024 21:18:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3DE440616; Wed, 2 Oct 2024 21:18:52 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 2D713402C5 for ; Wed, 2 Oct 2024 21:18:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727896730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I33yt/Cdiq04EHWZLclVc0pVVJckx8eZ7Ca3QWZr4Os=; b=FuZ0rTXf37IVpSxzGBDybqQgO78jx44WRza+pbC8JIivVIxt9fI47TTh7J3SEZ8+l79MFH 8zMudI+rVHztC1Hs4XXEU1Pdlgj+M7IKUAql8Pd2p7rzqgS0lPQomkaWg116BA8o7LSVDN KkMyrPBfzaDDex/Vj5uqsgAap8Oj+Kg= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-550-gBBZYZ9YOPyZ6Ls93T8OGw-1; Wed, 02 Oct 2024 15:18:48 -0400 X-MC-Unique: gBBZYZ9YOPyZ6Ls93T8OGw-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-5389ef4c213so57301e87.3 for ; Wed, 02 Oct 2024 12:18:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727896727; x=1728501527; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I33yt/Cdiq04EHWZLclVc0pVVJckx8eZ7Ca3QWZr4Os=; b=WCNGLRAH/oj/mojGLwskaswuEHhm6dgYydmXIeldslnY5rEM60CQjM/+jPnSydcEPo tbjQm5tXVFU+SG+N2yH6QNp0dQ36G+KQrUczUmF9vdZYF4y2qmTe6hijTLd3OlaFxMKP rFVZ0eyxzUSV6plRMqEL/FntS9Cy4Y9c6yS6fl+FSYx5YL9R6ahfiaYv79xohlyn5yxJ zGpYjwpGsCz0xjFrly/QcWd93jM1gTMXqjM89JOOL700rahlG7mQlaioSWB285d0INkY h0n1wK8mSyjuLHQn/swRuA5cun24DZi9GBslmESVYVWC8UUL8lpwrlXmReQrs21iKCtx bIKA== X-Forwarded-Encrypted: i=1; AJvYcCVvBxHycC///mKYx5VtWaptQYGtV6QzckilDfPZVq01SfaHzHlzJ/rMbluTF3IbNv7Kot8=@dpdk.org X-Gm-Message-State: AOJu0YyF/eeFT1+urUEP97TwdzHOScW3bLU8j2Lq1hsZnB+sobbRKMpr k9pOW5zDJC8N9cGw+YNL2VfQ5Jq7Xl9tokMb7mcC8VQJ4+VvIUaSBTvoa1+I9v7Puv2aSl9UoEj mOfqJq7iGaNm5nDR6Gf/n5rB8Cdr20X2OH6P/N2lu3hVCMWQBgu+qgp+Xsy4mkDbON2h4Y+LIxg sE5MG/vnumGv2RCMI= X-Received: by 2002:a05:6512:3994:b0:533:44e7:1b2a with SMTP id 2adb3069b0e04-539a0793eedmr2902878e87.40.1727896727181; Wed, 02 Oct 2024 12:18:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXKhcgt7G+ZPUXm2RYgNQizbGGJ24nT8OL4MdVCt3fYDeQFEgmMpcGnmkK658ce32YaZUBzCdGxvBZgsXv9+U= X-Received: by 2002:a05:6512:3994:b0:533:44e7:1b2a with SMTP id 2adb3069b0e04-539a0793eedmr2902861e87.40.1727896726753; Wed, 02 Oct 2024 12:18:46 -0700 (PDT) MIME-Version: 1.0 References: <20241002155709.2522273-1-david.marchand@redhat.com> <20241002155709.2522273-3-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Wed, 2 Oct 2024 21:18:35 +0200 Message-ID: Subject: Re: [PATCH 2/2] ethdev: fix race on ports for telemetry commands To: Robin Jarry Cc: Bruce Richardson , dev@dpdk.org, ktraynor@redhat.com, stable@dpdk.org, Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Keith Wiles , Ciara Power X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Wed, Oct 2, 2024 at 9:09=E2=80=AFPM Robin Jarry wrot= e: > >> An alternative to this macro-fu, is to just define a single ethdev > >> telemetry function, and within that, take the lock and then dispatch t= o the > >> appropriate subfunction based upon the actual command coming in. The > >> dispatch may be slightly slower due to the additional text matching (o= nly > >> from byte 8 onwards, so very short strings), but I think the code coul= d be > >> a simpler in C rather than in macros, and the perf impact for telemetr= y is > >> likely to be negligible, compared to the overhead of the socket I/O et= c. > > > > Hopefully, dispatching performance is not important here. > > I was going to suggest adding a rte_spinlock_t* parameter to a new > telemetry register function that would need to be held while the > callback is invoked. Or if we want to keep doors open to other kinds of > lock, a wrapper callback. Well, as you had experimented this approach, we know this does not work: the ethdev lock is in dpdk shared memory which is not available yet at the time RTE_INIT() is called. A single callback is strange, I guess you mean pre/post callbacks then. --=20 David Marchand