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 B3F25A04DD; Thu, 22 Oct 2020 14:52:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C985EA94D; Thu, 22 Oct 2020 14:52:13 +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 0C1B4A939 for ; Thu, 22 Oct 2020 14:52:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603371129; 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=FV0k2we89S+MxVB9CLT06oYKAifXfNXG7ylbvPhk40EXGXvDm0Mv5edMiYF/d/kUEtTGQF TTpa7a3fNKMuW8nSU26/bh+3kcBfFqBec/KtcKEWxnGa+2U3XAMZHSWIu/tOxQzEiqLLcC IOo6+iP/WoOHiVxc9wC5h+0bSYWwKOE= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-aBz_JPgwNsqHbBAvW-ucUg-1; Thu, 22 Oct 2020 08:52:05 -0400 X-MC-Unique: aBz_JPgwNsqHbBAvW-ucUg-1 Received: by mail-vk1-f197.google.com with SMTP id h184so277262vkh.3 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=f7wVM285V6Em8YlBd7WmmV7DNhFtvSzNyn6T8dpyTZX2KECa1SWX/ti8aF9c7SpGUZ NvgpzcvqL0oKBTCBGw7ZDysgo5MlFVasoH9c7mRcQpCxoa7c1cyNXCNkETzeEjB6cxV/ vD6iXDLChWPzgEuFeKzZfFhH6qv6h7ZV+RuJfLwYKDW06s0RlR0KWdDLUh/IE2tG2ndn v3eFlljgPWyYTAi4vzofWpOHRiYrVfl4iARajKl+gVYvUZZazUTYlVSTb7g0t/7VThr7 Ytd6XzaorzuwNS0pAPfyLCq4dgXEVlJ75yQXUrPEsJ73nTKbCFIMKGAro2AycWrmjjm3 U7YQ== X-Gm-Message-State: AOAM533HPS8STaw6biKoPWiA+lu6Yyr51QcQCg2nCxcIxiewgXlH4QSJ XVlYHj12nmpnAGr6p2sJCkoTSFzy+So/FvQ5w6alkPC0n+/P4pHp9grvaNp6gCl3x/K+cw1Q6q1 NYy312ZaZcx6YsfJNWPE= X-Received: by 2002:a67:2fca:: with SMTP id v193mr1393308vsv.18.1603371125450; 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-dev] [PATCH v5 2/3] eal: return error code when failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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