[dpdk-dev] [PATCH v6 9/9] interrupts: extend event list
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Mon Oct 25 12:49:32 CEST 2021
Hi David,
With some nits below,
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
2021-10-24 22:04 (UTC+0200), David Marchand:
> From: Harman Kalra <hkalra at marvell.com>
>
> Dynamically allocating the efds and elist array os intr_handle
Typo: "os" -> "of"
> structure, based on size provided by user. Eg size can be
> MSIX interrupts supported by a PCI device.
>
> Signed-off-by: Harman Kalra <hkalra at marvell.com>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> Changes since v5:
> - split from patch5,
>
> ---
[...]
> diff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c
> index 3285c4335f..7feb9da8fa 100644
> --- a/lib/eal/common/eal_common_interrupts.c
> +++ b/lib/eal/common/eal_common_interrupts.c
[...]
> int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd)
> @@ -239,6 +330,12 @@ int rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle,
> {
> CHECK_VALID_INTR_HANDLE(intr_handle);
>
> + if (intr_handle->efds == NULL) {
> + RTE_LOG(ERR, EAL, "Event fd list not allocated\n");
> + rte_errno = EFAULT;
> + goto fail;
> + }
> +
Here and below:
The check for `nb_intr` will already catch not allocated `efds`,
because `nb_intr` is necessarily 0 in this case.
> if (index >= intr_handle->nb_intr) {
> RTE_LOG(ERR, EAL, "Invalid index %d, max limit %d\n", index,
> intr_handle->nb_intr);
> @@ -256,6 +353,12 @@ int rte_intr_efds_index_set(struct rte_intr_handle *intr_handle,
> {
> CHECK_VALID_INTR_HANDLE(intr_handle);
>
> + if (intr_handle->efds == NULL) {
> + RTE_LOG(ERR, EAL, "Event fd list not allocated\n");
> + rte_errno = EFAULT;
> + goto fail;
> + }
> +
> if (index >= intr_handle->nb_intr) {
> RTE_LOG(ERR, EAL, "Invalid size %d, max limit %d\n", index,
> intr_handle->nb_intr);
> @@ -275,6 +378,12 @@ struct rte_epoll_event *rte_intr_elist_index_get(
> {
> CHECK_VALID_INTR_HANDLE(intr_handle);
>
> + if (intr_handle->elist == NULL) {
> + RTE_LOG(ERR, EAL, "Event list not allocated\n");
> + rte_errno = EFAULT;
> + goto fail;
> + }
> +
> if (index >= intr_handle->nb_intr) {
> RTE_LOG(ERR, EAL, "Invalid index %d, max limit %d\n", index,
> intr_handle->nb_intr);
> @@ -292,6 +401,12 @@ int rte_intr_elist_index_set(struct rte_intr_handle *intr_handle,
> {
> CHECK_VALID_INTR_HANDLE(intr_handle);
>
> + if (intr_handle->elist == NULL) {
> + RTE_LOG(ERR, EAL, "Event list not allocated\n");
> + rte_errno = EFAULT;
> + goto fail;
> + }
> +
> if (index >= intr_handle->nb_intr) {
> RTE_LOG(ERR, EAL, "Invalid index %d, max limit %d\n", index,
> intr_handle->nb_intr);
[...]
More information about the dev
mailing list