Skip to content
Permalink
Browse files

incremental changes

Signed-off-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information...
david-marchand committed Jul 22, 2019
1 parent e389523 commit 374acb3409c206ffcb1bf6b5a7e8bb0bfca4e2b9
@@ -119,12 +119,14 @@ int rte_intr_enable(const struct rte_intr_handle *intr_handle);
int rte_intr_disable(const struct rte_intr_handle *intr_handle);

/**
* It acks an interrupt raised for the specified handle.
* @warning
* @b EXPERIMENTAL: this API may change without prior notice
*
* This function should be called at the end of each interrupt
* handler either from application or driver, so that
* currently raised interrupt is acked and further
* new interrupts are raised.
* It acknowledges an interrupt raised for the specified handle.
*
* This function should be called at the end of each interrupt handler either
* from application or driver, so that currently raised interrupt is acked and
* further new interrupts are raised.
*
* @param intr_handle
* pointer to the interrupt handle.
@@ -201,24 +201,17 @@ vfio_disable_intx(const struct rte_intr_handle *intr_handle) {
static int
vfio_ack_intx(const struct rte_intr_handle *intr_handle)
{
struct vfio_irq_set *irq_set;
char irq_set_buf[IRQ_SET_BUF_LEN];
int len, ret;

len = sizeof(struct vfio_irq_set);
struct vfio_irq_set irq_set;

/* unmask INTx */
irq_set = (struct vfio_irq_set *) irq_set_buf;
memset(irq_set, 0, len);
irq_set->argsz = len;
irq_set->count = 1;
irq_set->flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_UNMASK;
irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
irq_set->start = 0;

ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);

if (ret) {
memset(&irq_set, 0, sizeof(irq_set));
irq_set.argsz = sizeof(irq_set);
irq_set.count = 1;
irq_set.flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_UNMASK;
irq_set.index = VFIO_PCI_INTX_IRQ_INDEX;
irq_set.start = 0;

if (ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, &irq_set)) {
RTE_LOG(ERR, EAL, "Error unmasking INTx interrupts for fd %d\n",
intr_handle->fd);
return -1;
@@ -724,12 +717,15 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)


/**
* PMD generally calls this function at the end of its IRQ callback.
* Internally, it unmasks the interrupt if possible. For INTx, unmasking
* is required as the interrupt is auto-masked prior to invoking
* callback. For MSI/MSI-X, unmasking is typically not needed as the
* interrupt is not auto-masked. In fact, for interrupt handle types
* VFIO_MSIX and VFIO_MSI, this function is no-op.
* PMD generally calls this function at the end of its IRQ callback.
* Internally, it unmasks the interrupt if possible.
*
* For INTx, unmasking is required as the interrupt is auto-masked prior to
* invoking callback.
*
* For MSI/MSI-X, unmasking is typically not needed as the interrupt is not
* auto-masked. In fact, for interrupt handle types VFIO_MSIX and VFIO_MSI,
* this function is no-op.
*/
int
rte_intr_ack(const struct rte_intr_handle *intr_handle)
@@ -741,7 +737,7 @@ rte_intr_ack(const struct rte_intr_handle *intr_handle)
return -1;

switch (intr_handle->type) {
/* Both acking and disabling are same for UIO */
/* Both acking and enabling are same for UIO */
case RTE_INTR_HANDLE_UIO:
if (uio_intr_enable(intr_handle))
return -1;
@@ -754,9 +750,7 @@ rte_intr_ack(const struct rte_intr_handle *intr_handle)
case RTE_INTR_HANDLE_ALARM:
return -1;
#ifdef VFIO_PRESENT
/* Since VFIO_MSIX is implicitly acked
* unlike INTx, we report success
*/
/* VFIO_MSIX is implicitly acked unlike INTx, nothing to do */
case RTE_INTR_HANDLE_VFIO_MSIX:
case RTE_INTR_HANDLE_VFIO_MSI:
return 0;
@@ -403,9 +403,9 @@ EXPERIMENTAL {
rte_realloc_socket;

# added in 19.08
rte_intr_ack;
rte_lcore_cpuset;
rte_lcore_to_cpu_id;
rte_mcfg_timer_lock;
rte_mcfg_timer_unlock;
rte_intr_ack;
};

0 comments on commit 374acb3

Please sign in to comment.
You can’t perform that action at this time.