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 4E90645A03; Tue, 24 Sep 2024 17:50:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3F3F402BE; Tue, 24 Sep 2024 17:50:34 +0200 (CEST) Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by mails.dpdk.org (Postfix) with ESMTP id BEC314028E for ; Tue, 24 Sep 2024 17:50:32 +0200 (CEST) Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6c354091616so47586326d6.0 for ; Tue, 24 Sep 2024 08:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727193032; x=1727797832; 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=s3FnfaGoLqhc9IBQpEmmRmx8QHw6QTF0Y/QJRrQ2kWY=; b=2QAB6MYKN4baP91oeyTrhgsTg1quh7UXoAMAx1UAZ4DQvBLkvqkXHQqn3B5cMGAEZt nShyy1ZCNin1NeJaHX2qZo8eHFK9VgkBz7pwpDZ8CNkDGX+Qb397Q9z4/Hmio6ar0G1A FeS+J6mPdPQhUMBotE7zoZ2sIwdRVbJ4px6AIwrhore6CKfyXTxWJmcybM8NVb38TBcA fcCNtioTkIJ/rlqidrb7mTeUKeyhMtoYAQJxarvnae5EtupNtfpEw5XD39zNZb4oTuP0 fsEyReBcvNb125jHXH7VkTgfpIjGmAw2hls9MhCVEC37k/1aMZskWAvPZKUISR6jFOUQ MhaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727193032; x=1727797832; 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=s3FnfaGoLqhc9IBQpEmmRmx8QHw6QTF0Y/QJRrQ2kWY=; b=h+Rn7Vixgqu7k419n7dSE19IONQxPU6pwMEy0yiAxXUV0PbelKrl6F7UQOKx9xkOZG 2kP6S7scbU7BGaQMQoJ8rTf70OXp1dikk6REnI4r1WOluPzlJG6O/oCvZ4aC01IYWPIY AcLMG2y9lz363e5+1skXc6wmXac8sbpsk2oMC+8VGqEDtn8GWFupPuKCSdVjDB+VGzZ2 /oRujHQRKLl/2Q82sgYTR2hB72gzC1PEfynyBUQBjrPxZtPb9s/Z7wFEd/eZhnEROb73 08zguM89Aa4NGBB8MvhpakXiULZ08AXvVkzuakycty4ume+c31N3Z9ys1ndQczAVVcC3 Xnsg== X-Forwarded-Encrypted: i=1; AJvYcCV3gaoEjpdhP59wP7JvhpvCZ582IXJSO+3OUlCNubuR00z5Ns39o5CvseTCihi4nIG6d0o=@dpdk.org X-Gm-Message-State: AOJu0YymEk8O1G/ZALnofTEGX6kVgofIW6xBEZC7m9gqfRZtF7Q/Ml87 L3rn4CgGJJ5NGs6icaeQbLauwgFQo9i/iDJ45vqnj9ZBcfLA84fxl7fssQkVXd8= X-Google-Smtp-Source: AGHT+IGMYFluJEM7ny8PPqGDtv5QOgEGhfv/qf7Hp5Vh+Ix1DcoUva6xuorHugq89eUVMpZAg9Quzw== X-Received: by 2002:a05:6214:4908:b0:6c4:79df:a2e5 with SMTP id 6a1803df08f44-6c7bd506c20mr217128086d6.20.1727193032030; Tue, 24 Sep 2024 08:50:32 -0700 (PDT) Received: from fedora ([173.242.185.50]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cb0f552cedsm7572276d6.88.2024.09.24.08.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 08:50:31 -0700 (PDT) Date: Tue, 24 Sep 2024 08:50:29 -0700 From: Stephen Hemminger To: longli@linuxonhyperv.com Cc: Tyler Retzlaff , dev@dpdk.org, Malcolm Bumgardner , stable@dpdk.org, Long Li Subject: Re: [PATCH] eal: fix device unregister for event registered with device_name NULL Message-ID: <20240924085029.6a033be4@fedora> In-Reply-To: <1721331448-9225-1-git-send-email-longli@linuxonhyperv.com> References: <1721331448-9225-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) 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 Thu, 18 Jul 2024 12:37:28 -0700 longli@linuxonhyperv.com wrote: > From: Malcolm Bumgardner > > In the device event unregister code, it unconditionally remove all > callbacks which are registered with device_name set to NULL. This results > in many callbacks uncorrectly removed. > > Fix this by only removing callbacks with matching cb_fn and cb_arg. > > Signed-off-by: Malcolm Bumgardner > > Fixes: a753e53d517b ("eal: add device event monitor framework") > Cc: stable@dpdk.org > Signed-off-by: Long Li > --- > lib/eal/common/eal_common_dev.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) This patch solves the problem in the netvsc driver. The netvsc driver registers a device event callback to discover when the VF is added/removed. When the netvsc driver is stoppped, it unregisters this callback. The bug is that the rte_dev code would end up removing all callbacks, including the callback for other netvsc devices. Perhaps a bugzilla entry or more direct example would have gotten more attention on this. Reviewed-by: Stephen Hemminger