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 5D85745B42 for ; Tue, 15 Oct 2024 10:04:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BB52400EF; Tue, 15 Oct 2024 10:04:42 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 4AE67400EF for ; Tue, 15 Oct 2024 10:04:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728979480; 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=WqKwJKpEiW+TfvescIhud6ToI0EZGVg0jut01EkmxLodG4GfSf+p0o62kPZZk0eB9UUxsD 4+5jpzoPhAKw72W30G+A8Zgpx/XKT929eNwlydNRG6a73XwJYGfE0lns0vf48KMQ8ZAIKf jVeKlORnVcAQjDKXJrf1nqhLGM2n1MA= 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-457-dp1dg-gPN9WsaNQ-BFVKbg-1; Tue, 15 Oct 2024 04:04:39 -0400 X-MC-Unique: dp1dg-gPN9WsaNQ-BFVKbg-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-43057c9b32bso32868725e9.0 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=RBaydy05uhEYrhihcftT5GV2MSOP7a5XZRPI1s0wkgq6b6A3YZ2PJRX4qWmeqgmv53 3+j6QPPqN7gJKdWX60foHuMueN9FRcoN2ygPftKc88WlWU17v0IUgen2zLzxwTdUiH1q sJzCguWcXD7l9RZ71F6B83teP8O47BdLCbuYmqO2YqZ2JAap0kuVGISzVdixvHSLAHeB Lz29UTVRxsBncpHmQMscOYor7HhUm0gc+BjoLc7bNKgWZdtDPoYPXxhAP+LdHfoNp7s1 w5lX0mPs68G9T7PTX6qLBepmDXr3/nlflKuao0LNitYLi+3SOt8bw8GY5TiKLBYDATAe lAAg== X-Forwarded-Encrypted: i=1; AJvYcCU8pI80hauoAAlAaVMKjlGL67ICCzhyTOB6VYs/a1NirYIb6te+0vdmbTnbDzPLttBEuMhmwTY=@dpdk.org X-Gm-Message-State: AOJu0YxPtYexAfzeLjbHeCeaokthI7ctRLCkNHEWmRnXd8t2ezt6ialX WnR2zpWRKf/5NWaEIEGeQ1l5ePaFNb60hdcjDaOPcawJx2lpvbP7XIdtI1uewvzAVj8XNevwWQ4 9UcHJtif5zcAt3wfhKbUqBJRmUeXsOjdb3bye5sU+q+Wa X-Received: by 2002:a05:600c:5021:b0:430:5356:ac92 with SMTP id 5b1f17b1804b1-4311deaea4dmr121690385e9.7.1728979478566; 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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.