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 F370DA0487 for ; Thu, 4 Jul 2019 13:34:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 437311BE07; Thu, 4 Jul 2019 13:34:58 +0200 (CEST) Received: from mail-ua1-f65.google.com (mail-ua1-f65.google.com [209.85.222.65]) by dpdk.org (Postfix) with ESMTP id 868381BE00 for ; Thu, 4 Jul 2019 13:34:56 +0200 (CEST) Received: by mail-ua1-f65.google.com with SMTP id s4so1031007uad.7 for ; Thu, 04 Jul 2019 04:34:56 -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=X4aFszJ95hEijk8PkU+hnQ0Vw0R5TYApuiZXVfZZ/Ck=; b=gDXvtqxHpJsFprWXJYaAzBB4E5b9wfqSEHUrrI5t2QfZJqaqVdZEuU18aa3Z2mfeAQ PDlBdhPvcsArvRmbw7GVj/xe8GMHoMOWsoBFZCuTF2+uyPDg+9xmdko38U6hnLMTC9mB BO77CtSxlJjo85mmvuTer/GtmM9gRdOjCs3ZA4+pPLQaY4NaGOSEV+ypa+DGZx56lzTE Iv23m+V4cFfUC1TdTBJqBEaxo4YGKLUy+miCA7tPtAnP2HvgTvySLtkv9AWKC8jRZtX8 oNw89XQ7cvUN2XvzJC5kfHw2y4L6Y59yrtFfNQMmNK/pGiyH8+lBXMF3Z5tPyGlh/fZx GxGw== X-Gm-Message-State: APjAAAVK6Ky82h/cU59/9Xbc4hGZwuD3OmGU7n6rWQ5R69hZBLYGo1cb WkdFqoiHVjfivrD7nGd3evJvi8nyn57czVXF/e6feg== X-Google-Smtp-Source: APXvYqyoqUfryz1LTIop+nQb+0f5AGfIeTvhiLgXba2rbaVt6heBdK7qdEMF8eVEoIfesLH0C8EPuxfv8I1DupB56eA= X-Received: by 2002:ab0:45e3:: with SMTP id u90mr4380765uau.126.1562240095863; Thu, 04 Jul 2019 04:34:55 -0700 (PDT) MIME-Version: 1.0 References: <1562234612-631-1-git-send-email-arybchenko@solarflare.com> <1562234612-631-2-git-send-email-arybchenko@solarflare.com> In-Reply-To: <1562234612-631-2-git-send-email-arybchenko@solarflare.com> From: David Marchand Date: Thu, 4 Jul 2019 13:34:44 +0200 Message-ID: To: Andrew Rybchenko Cc: Jerin Jacob , Nikhil Rao , Erik Gabriel Carrillo , dev , Dilshod Urazov , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 1/3] eventdev: fix to set positive rte_errno 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" We have fixes for different releases, expect the stable maintainers to ask for help :-) On Thu, Jul 4, 2019 at 12:04 PM Andrew Rybchenko wrote: > From: Dilshod Urazov > > Fixes: c9bf83947e2e ("eventdev: add eth Tx adapter APIs") > v18.11-rc1~724 Fixes: 47d05b292820 ("eventdev: add timer adapter common code") > v18.05-rc1~462 > Fixes: 6750b21bd6af ("eventdev: add default software timer adapter") > v18.05-rc1~460 > Fixes: c75f7897ea35 ("eventdev: set error code in port link/unlink > functions") > v18.02-rc1~202 > Fixes: 7d1acc9dde93 ("eventdev: introduce helper function for enqueue > burst") > v17.08-rc1~90 Fixes: 406aed4e0dd9 ("eventdev: add errno-style return values") > v17.05-rc1~166 > Fixes: c64e1b7b20d2 ("eventdev: add new software event timer adapter") > This last sha1 c64e1b7b20d2 is unknown to my git. Please, can you double check? Cc: stable@dpdk.org > > Signed-off-by: Dilshod Urazov > Signed-off-by: Andrew Rybchenko > --- > lib/librte_eventdev/rte_event_eth_tx_adapter.h | 8 ++++---- > lib/librte_eventdev/rte_event_timer_adapter.c | 18 +++++++++--------- > lib/librte_eventdev/rte_eventdev.c | 16 ++++++++-------- > lib/librte_eventdev/rte_eventdev.h | 26 > +++++++++++++------------- > 4 files changed, 34 insertions(+), 34 deletions(-) > > diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.h > b/lib/librte_eventdev/rte_event_eth_tx_adapter.h > index 9bed12b..c848261 100644 > --- a/lib/librte_eventdev/rte_event_eth_tx_adapter.h > +++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.h > @@ -332,10 +332,10 @@ struct rte_event_eth_tx_adapter_stats { > * *rte_event*. If the return value is less than *nb_events*, the > remaining > * events at the end of ev[] are not consumed and the caller has to > take care > * of them, and rte_errno is set accordingly. Possible errno values > include: > - * - -EINVAL The port ID is invalid, device ID is invalid, an event's > queue > + * - EINVAL The port ID is invalid, device ID is invalid, an event's > queue > * ID is invalid, or an event's sched type doesn't match the > * capabilities of the destination queue. > - * - -ENOSPC The event port was backpressured and unable to enqueue > + * - ENOSPC The event port was backpressured and unable to enqueue > * one or more events. This error code is only applicable to > * closed systems. > */ > @@ -350,12 +350,12 @@ struct rte_event_eth_tx_adapter_stats { > #ifdef RTE_LIBRTE_EVENTDEV_DEBUG > if (dev_id >= RTE_EVENT_MAX_DEVS || > !rte_eventdevs[dev_id].attached) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > > if (port_id >= dev->data->nb_ports) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > #endif > diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c > b/lib/librte_eventdev/rte_event_timer_adapter.c > index 459bc47..5ce399e 100644 > --- a/lib/librte_eventdev/rte_event_timer_adapter.c > +++ b/lib/librte_eventdev/rte_event_timer_adapter.c > @@ -192,17 +192,17 @@ struct rte_event_timer_adapter * > &adapter->data->caps, > &adapter->ops); > if (ret < 0) { > - rte_errno = ret; > + rte_errno = -ret; > goto free_memzone; > } > > if (!(adapter->data->caps & > RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT)) { > - FUNC_PTR_OR_NULL_RET_WITH_ERRNO(conf_cb, -EINVAL); > + FUNC_PTR_OR_NULL_RET_WITH_ERRNO(conf_cb, EINVAL); > ret = conf_cb(adapter->data->id, > adapter->data->event_dev_id, > &adapter->data->event_port_id, conf_arg); > if (ret < 0) { > - rte_errno = ret; > + rte_errno = -ret; > goto free_memzone; > } > } > @@ -214,10 +214,10 @@ struct rte_event_timer_adapter * > adapter->ops = &swtim_ops; > > /* Allow driver to do some setup */ > - FUNC_PTR_OR_NULL_RET_WITH_ERRNO(adapter->ops->init, -ENOTSUP); > + FUNC_PTR_OR_NULL_RET_WITH_ERRNO(adapter->ops->init, ENOTSUP); > ret = adapter->ops->init(adapter); > if (ret < 0) { > - rte_errno = ret; > + rte_errno = -ret; > goto free_memzone; > } > > @@ -509,11 +509,11 @@ struct event_buffer { > *nb_events_flushed = rte_event_enqueue_burst(dev_id, port_id, > &events[tail_idx], n); > if (*nb_events_flushed != n) { > - if (rte_errno == -EINVAL) { > + if (rte_errno == EINVAL) { > EVTIM_LOG_ERR("failed to enqueue invalid event - " > "dropping it"); > (*nb_events_inv)++; > - } else if (rte_errno == -ENOSPC) > + } else if (rte_errno == ENOSPC) > rte_pause(); > } > > @@ -832,7 +832,7 @@ struct swtim { > if (ret < 0) { > if (ret != -EALREADY) { > EVTIM_LOG_ERR("failed to initialize timer > subsystem"); > - rte_errno = ret; > + rte_errno = -ret; > goto free_mempool; > } > } > @@ -840,7 +840,7 @@ struct swtim { > ret = rte_timer_data_alloc(&sw->timer_data_id); > if (ret < 0) { > EVTIM_LOG_ERR("failed to allocate timer data instance"); > - rte_errno = ret; > + rte_errno = -ret; > goto free_mempool; > } > > diff --git a/lib/librte_eventdev/rte_eventdev.c > b/lib/librte_eventdev/rte_eventdev.c > index cc3199f..f44c869 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -889,18 +889,18 @@ > uint16_t *links_map; > int i, diag; > > - RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, -EINVAL, 0); > + RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, EINVAL, 0); > dev = &rte_eventdevs[dev_id]; > > if (*dev->dev_ops->port_link == NULL) { > RTE_EDEV_LOG_ERR("Function not supported\n"); > - rte_errno = -ENOTSUP; > + rte_errno = ENOTSUP; > return 0; > } > > if (!is_valid_port(dev, port_id)) { > RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > > @@ -921,7 +921,7 @@ > > for (i = 0; i < nb_links; i++) > if (queues[i] >= dev->data->nb_queues) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > > @@ -948,18 +948,18 @@ > int i, diag, j; > uint16_t *links_map; > > - RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, -EINVAL, 0); > + RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, EINVAL, 0); > dev = &rte_eventdevs[dev_id]; > > if (*dev->dev_ops->port_unlink == NULL) { > RTE_EDEV_LOG_ERR("Function not supported"); > - rte_errno = -ENOTSUP; > + rte_errno = ENOTSUP; > return 0; > } > > if (!is_valid_port(dev, port_id)) { > RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > > @@ -988,7 +988,7 @@ > nb_unlinks = j; > for (i = 0; i < nb_unlinks; i++) > if (queues[i] >= dev->data->nb_queues) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > > diff --git a/lib/librte_eventdev/rte_eventdev.h > b/lib/librte_eventdev/rte_eventdev.h > index 927f43c..5044a13 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -1318,12 +1318,12 @@ struct rte_eventdev { > > #ifdef RTE_LIBRTE_EVENTDEV_DEBUG > if (dev_id >= RTE_EVENT_MAX_DEVS || > !rte_eventdevs[dev_id].attached) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > > if (port_id >= dev->data->nb_ports) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > #endif > @@ -1372,10 +1372,10 @@ struct rte_eventdev { > * *rte_event*. If the return value is less than *nb_events*, the > remaining > * events at the end of ev[] are not consumed and the caller has to > take care > * of them, and rte_errno is set accordingly. Possible errno values > include: > - * - -EINVAL The port ID is invalid, device ID is invalid, an event's > queue > + * - EINVAL The port ID is invalid, device ID is invalid, an event's > queue > * ID is invalid, or an event's sched type doesn't match the > * capabilities of the destination queue. > - * - -ENOSPC The event port was backpressured and unable to enqueue > + * - ENOSPC The event port was backpressured and unable to enqueue > * one or more events. This error code is only applicable to > * closed systems. > * @see rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH > @@ -1422,10 +1422,10 @@ struct rte_eventdev { > * *rte_event*. If the return value is less than *nb_events*, the > remaining > * events at the end of ev[] are not consumed and the caller has to > take care > * of them, and rte_errno is set accordingly. Possible errno values > include: > - * - -EINVAL The port ID is invalid, device ID is invalid, an event's > queue > + * - EINVAL The port ID is invalid, device ID is invalid, an event's > queue > * ID is invalid, or an event's sched type doesn't match the > * capabilities of the destination queue. > - * - -ENOSPC The event port was backpressured and unable to enqueue > + * - ENOSPC The event port was backpressured and unable to enqueue > * one or more events. This error code is only applicable to > * closed systems. > * @see rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH > @@ -1473,10 +1473,10 @@ struct rte_eventdev { > * *rte_event*. If the return value is less than *nb_events*, the > remaining > * events at the end of ev[] are not consumed and the caller has to > take care > * of them, and rte_errno is set accordingly. Possible errno values > include: > - * - -EINVAL The port ID is invalid, device ID is invalid, an event's > queue > + * - EINVAL The port ID is invalid, device ID is invalid, an event's > queue > * ID is invalid, or an event's sched type doesn't match the > * capabilities of the destination queue. > - * - -ENOSPC The event port was backpressured and unable to enqueue > + * - ENOSPC The event port was backpressured and unable to enqueue > * one or more events. This error code is only applicable to > * closed systems. > * @see rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH > @@ -1595,12 +1595,12 @@ struct rte_eventdev { > > #ifdef RTE_LIBRTE_EVENTDEV_DEBUG > if (dev_id >= RTE_EVENT_MAX_DEVS || > !rte_eventdevs[dev_id].attached) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > > if (port_id >= dev->data->nb_ports) { > - rte_errno = -EINVAL; > + rte_errno = EINVAL; > return 0; > } > #endif > @@ -1673,9 +1673,9 @@ struct rte_eventdev { > * of link[] are not established, and the caller has to take care of them. > * If return value is less than *nb_links* then implementation shall > update the > * rte_errno accordingly, Possible rte_errno values are > - * (-EDQUOT) Quota exceeded(Application tried to link the queue > configured with > + * (EDQUOT) Quota exceeded(Application tried to link the queue configured > with > * RTE_EVENT_QUEUE_CFG_SINGLE_LINK to more than one event ports) > - * (-EINVAL) Invalid parameter > + * (EINVAL) Invalid parameter > * > */ > int > @@ -1720,7 +1720,7 @@ struct rte_eventdev { > * end of queues[] are not unlinked, and the caller has to take care of > them. > * If return value is less than *nb_unlinks* then implementation shall > update > * the rte_errno accordingly, Possible rte_errno values are > - * (-EINVAL) Invalid parameter > + * (EINVAL) Invalid parameter > */ > int > rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, > -- > 1.8.3.1 > > Reviewed-by: David Marchand -- David Marchand