From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5E72A04DD for ; Thu, 22 Oct 2020 14:52:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D05F9AFD; Thu, 22 Oct 2020 14:52:11 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id D262E9AFD for ; Thu, 22 Oct 2020 14:52:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603371127; 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: in-reply-to:in-reply-to:references:references; bh=ZCTpnLQ8l1jEE5TZHvfGvVeuZUJZafN6TJ/Uw5W4kdg=; b=DM5fOEJ03/O9FQe5ihtXhzqVdXWrBWe0S1QFzjPXjWBSxtEyjJLz1WwYtAFkuIlAyfNcA8 JW2HH0LmB+Bm4So/haiTNReKXsGxPFa8Oa5dtfZwsQob9J2ipDJG00x2RbKnn8roY2l8VS e1ktVj6nIdMlI/r4jcN/5jm2WuotX3k= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-8qnnTXAMOC-9DrGSGN8ADA-1; Thu, 22 Oct 2020 08:52:05 -0400 X-MC-Unique: 8qnnTXAMOC-9DrGSGN8ADA-1 Received: by mail-vs1-f71.google.com with SMTP id z190so297036vsz.22 for ; Thu, 22 Oct 2020 05:52:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZCTpnLQ8l1jEE5TZHvfGvVeuZUJZafN6TJ/Uw5W4kdg=; b=Xopu5oENw2e3CFF1yGirHSASq+LiOrCgUswxuR1kG2us51ASRykhfIOUqdEJ43E44l F++SOjci7SQFih3xUAM1gPeR++NWfWLCUxYvIuf0INzUO3APhHJPA+lS1McJnv1WxiA+ QvDnM2lA/7M24rcq8vfePJ11cPVAQX8KiGtXpMo5toY3x0G+/iRwktGGf8j4vi/dyqrf pYPOaDxUQ86qOiwKxGAKsy1kJPVfiYhXIqCONSo6Axud4A1tFf6kWg5xVrNsJBWHPvi9 Qlh7RdUTdFtFbNcAxs9JgKIbBJpN6dOdLNPE0wH9HHTO4QGtcAYQ6ZKeRGm1Y3NlvFtf o52A== X-Gm-Message-State: AOAM5309sqvyT8TQAzsqrywBZPLFZS73OsHnF1SGFU0skuF7DZ0b8rMS HxIWuNUGPxUK2iNPyqlTgZBDiTiZrbK+OH+Cm1kQ46bZICa2jIcnxd91JSx67uV6oTi05iCJLWs arjWpfsCXSJ9y8NND9IbiA6A= X-Received: by 2002:a67:2fca:: with SMTP id v193mr1393309vsv.18.1603371125451; Thu, 22 Oct 2020 05:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKAijadDOac+4Tclqq0uqfXENygvgFvRNJX6taeXMk7evMYirQa5PndFIR4wFEBt8aMz8bNhNLgwRPJADHjUI= X-Received: by 2002:a67:2fca:: with SMTP id v193mr1393294vsv.18.1603371125208; Thu, 22 Oct 2020 05:52:05 -0700 (PDT) MIME-Version: 1.0 References: <0c755de289f228e67897818639a171cbf1d768ae.1603207676.git.wangyunjian@huawei.com> In-Reply-To: <0c755de289f228e67897818639a171cbf1d768ae.1603207676.git.wangyunjian@huawei.com> From: David Marchand Date: Thu, 22 Oct 2020 14:51:54 +0200 Message-ID: To: wangyunjian Cc: dev , Jeff Guo , Jerin Jacob Kollanukkaran , "Lilijun (Jerry)" , xudingke , dpdk stable , Kevin Traynor , Luca Boccassi Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v5 2/3] eal: return error code when failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" On Wed, Oct 21, 2020 at 1:19 PM wangyunjian wrote: > > From: Yunjian Wang > > Fix return value, using -EAGAIN instead of 0 when the callback is busy > and using -ENOENT instead of 0 when the callback is not found. > > Fixes: a753e53d517b ("eal: add device event monitor framework") > Cc: stable@dpdk.org This API is experimental, its description is vague enough and we can change it in the current release. But I see this as a change in behavior for existing users, not a fix and I would not backport it. Opinions? > > Signed-off-by: Yunjian Wang > Acked-by: Jeff Guo > --- > lib/librte_eal/common/eal_common_dev.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c > index 363a2ca95e..d990bfd20d 100644 > --- a/lib/librte_eal/common/eal_common_dev.c > +++ b/lib/librte_eal/common/eal_common_dev.c > @@ -530,9 +530,15 @@ rte_dev_event_callback_unregister(const char *device_name, > free(event_cb); > ret++; > } else { > - continue; > + ret = -EAGAIN; > + break; > } > } > + > + /* this callback is not be registered */ > + if (ret == 0) > + ret = -ENOENT; > + > rte_spinlock_unlock(&dev_event_lock); > return ret; > } > -- > 2.23.0 > -- David Marchand