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 9CCB245B42; Tue, 15 Oct 2024 10:04:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83C30402C3; Tue, 15 Oct 2024 10:04:44 +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 7571E402C3 for ; Tue, 15 Oct 2024 10:04:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728979483; 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=BBNdAi2b4ImYQzYnWQA0jR83EkumsxdCBe1JWASF4Cw=; b=XwicToFO77bQSwTtRPFakvh1ZhcBe5yLdiUrTHaAokBMPi10/lkCE8PJf7wFXy1acm57gZ D3ZuR5vrBkWPPuXUrvhPjDBt/XDhcbEcDIxIAAFpSVYFQGVoutivWVIvniQjXjx6+DWKEu j9cnWcxDkH8ZdSeRGOO3smi2UyLO21Y= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-694-Y3vul1tFOPO6cxRn9LeAJQ-1; Tue, 15 Oct 2024 04:04:39 -0400 X-MC-Unique: Y3vul1tFOPO6cxRn9LeAJQ-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-430581bd920so32761865e9.3 for ; Tue, 15 Oct 2024 01:04:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728979478; x=1729584278; h=in-reply-to:references:user-agent:cc:subject:to:from:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BBNdAi2b4ImYQzYnWQA0jR83EkumsxdCBe1JWASF4Cw=; b=WfXvp1UWItl0UMrX12joafk1TxeoIbfAetQeTTvIIV6sKkQvWBe/oAKdLoArakHHSi VEJMd3VcAqiElYT8JLwJTSKTM15Q+ZIsGLoEDEkKCnea01QmmNdCtSIWea5ECfPhcXKA LhvACyv25PLbdDkFZLC1x3kdag6dbPmZI9SdLVy2wuNM8b8hLRNGROMjMPgeVtT6bUYb YLayCiY53FN0pHYVxV+GsoJoi3qWonYcZmV055tHrW6Ll3zRNWEif2b51wMJu3uxDKSd CcHRCdFrczp8uCXzViyMz5sCWcBugSvLWxoleOzbAIiuHtJOoM7HhJQtjFy3r/0gJO+X VJcg== X-Gm-Message-State: AOJu0Yw6ELUV+YXqSoD/pf6n7oo2hc1hGZtW0QiDd9vPsqQ7jFUxld9x l8xJeqirgEbbooSl4gnu0mJChC/1EFg3AKW93I4DO9cluFBzmMVt0AvqPrQavWXTza1XUbR1V4S 2wF6Hqm15hkSQTRmIyerP9omd+B6bKI8oKpil4XtI X-Received: by 2002:a05:600c:5021:b0:430:5356:ac92 with SMTP id 5b1f17b1804b1-4311deaea4dmr121690275e9.7.1728979478557; Tue, 15 Oct 2024 01:04:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtIq9K6vIhVqwg8SfmnucKGGpR3fFeji7dKhQ9iLLzr0VHbf2QUvUOEePbDh3SMrFQp+ajJw== X-Received: by 2002:a05:600c:5021:b0:430:5356:ac92 with SMTP id 5b1f17b1804b1-4311deaea4dmr121690075e9.7.1728979478176; Tue, 15 Oct 2024 01:04:38 -0700 (PDT) Received: from localhost (2a01cb00025433006239e1f47a0b2371.ipv6.abo.wanadoo.fr. [2a01:cb00:254:3300:6239:e1f4:7a0b:2371]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d7fa8b15dsm904049f8f.47.2024.10.15.01.04.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Oct 2024 01:04:37 -0700 (PDT) Mime-Version: 1.0 Date: Tue, 15 Oct 2024 10:04:37 +0200 Message-Id: From: "Robin Jarry" To: "David Marchand" , "Stephen Hemminger" Subject: Re: [PATCH dpdk v3 2/2] ethdev: fix potential race in telemetry endpoints Cc: , "Thomas Monjalon" , "Ferruh Yigit" , "Andrew Rybchenko" , "Ciara Power" , "Bruce Richardson" , "Keith Wiles" , User-Agent: aerc/0.18.2-81-g43ce621f36dd References: <20241002155709.2522273-1-david.marchand@redhat.com> <20241014193237.1992382-1-rjarry@redhat.com> <20241014193237.1992382-3-rjarry@redhat.com> <20241014130124.32c7b4bf@hermes.local> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed 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 David Marchand, Oct 15, 2024 at 10:02: > On Mon, Oct 14, 2024 at 10:01=E2=80=AFPM Stephen Hemminger >> If this happens often, and the function takes a long time (like doing i/= o) >> it might be worth changing this to reader/writer in future. > > Yes, this was an option mentionned when we discussed the issue in Montr= =C3=A9al. > For now, a spinlock seems enough. As far as I know, no ethdev telemetry endpoint handlers do any i/o. They=20 only access stuff in memory. >> Also, would be best to add a comment here as to what is being protected >> if you do another version. > > I can add something when applying, like: > > @@ -1400,6 +1400,7 @@ static int eth_dev_telemetry_do(const char *cmd, > const char *params, > { > int ret; > telemetry_cb fn =3D arg; > + /* Protect against port removal while invoking callback, > calling ethdev API. */ > rte_spinlock_lock(rte_mcfg_ethdev_get_lock()); > ret =3D fn(cmd, params, d); > rte_spinlock_unlock(rte_mcfg_ethdev_get_lock()); Ack, thank you.