}
static void
-avp_dev_interrupt_handler(struct rte_intr_handle *intr_handle,
- void *data)
+avp_dev_interrupt_handler(void *data)
{
struct rte_eth_dev *eth_dev = data;
struct rte_pci_device *pci_dev = AVP_DEV_TO_PCI(eth_dev);
status);
/* re-enable UIO interrupt handling */
- ret = rte_intr_enable(intr_handle);
+ ret = rte_intr_enable(&pci_dev->intr_handle);
if (ret < 0) {
PMD_DRV_LOG(ERR, "Failed to re-enable UIO interrupts, ret=%d\n",
ret);
}
static __rte_unused void
-bnx2x_interrupt_handler(struct rte_intr_handle *handle, void *param)
+bnx2x_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
+ struct bnx2x_softc *sc = dev->data->dev_private;
bnx2x_interrupt_action(dev);
- rte_intr_enable(handle);
+ rte_intr_enable(&sc->pci_dev->intr_handle);
}
/*
* Interrupts
*/
-static void bnxt_int_handler(struct rte_intr_handle *handle __rte_unused,
- void *param)
+static void bnxt_int_handler(void *param)
{
struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
static int eth_em_interrupt_get_status(struct rte_eth_dev *dev);
static int eth_em_interrupt_action(struct rte_eth_dev *dev,
struct rte_intr_handle *handle);
-static void eth_em_interrupt_handler(struct rte_intr_handle *handle,
- void *param);
+static void eth_em_interrupt_handler(void *param);
static int em_hw_init(struct e1000_hw *hw);
static int em_hardware_init(struct e1000_hw *hw);
* void
*/
static void
-eth_em_interrupt_handler(struct rte_intr_handle *handle,
- void *param)
+eth_em_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
eth_em_interrupt_get_status(dev);
- eth_em_interrupt_action(dev, handle);
+ eth_em_interrupt_action(dev, dev->intr_handle);
_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
}
static int eth_igb_interrupt_get_status(struct rte_eth_dev *dev);
static int eth_igb_interrupt_action(struct rte_eth_dev *dev,
struct rte_intr_handle *handle);
-static void eth_igb_interrupt_handler(struct rte_intr_handle *handle,
- void *param);
+static void eth_igb_interrupt_handler(void *param);
static int igb_hardware_init(struct e1000_hw *hw);
static void igb_hw_control_acquire(struct e1000_hw *hw);
static void igb_hw_control_release(struct e1000_hw *hw);
static void eth_igb_write_ivar(struct e1000_hw *hw, uint8_t msix_vector,
uint8_t index, uint8_t offset);
static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev);
-static void eth_igbvf_interrupt_handler(struct rte_intr_handle *handle,
- void *param);
+static void eth_igbvf_interrupt_handler(void *param);
static void igbvf_mbx_process(struct rte_eth_dev *dev);
/*
* void
*/
static void
-eth_igb_interrupt_handler(struct rte_intr_handle *handle, void *param)
+eth_igb_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
eth_igb_interrupt_get_status(dev);
- eth_igb_interrupt_action(dev, handle);
+ eth_igb_interrupt_action(dev, dev->intr_handle);
}
static int
}
static void
-eth_igbvf_interrupt_handler(struct rte_intr_handle *handle,
- void *param)
+eth_igbvf_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
eth_igbvf_interrupt_get_status(dev);
- eth_igbvf_interrupt_action(dev, handle);
+ eth_igbvf_interrupt_action(dev, dev->intr_handle);
}
static int
}
static void
-enic_intr_handler(__rte_unused struct rte_intr_handle *handle,
- void *arg)
+enic_intr_handler(void *arg)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)arg;
struct enic *enic = pmd_priv(dev);
* void
*/
static void
-fm10k_dev_interrupt_handler_pf(
- struct rte_intr_handle *handle,
- void *param)
+fm10k_dev_interrupt_handler_pf(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
FM10K_WRITE_REG(hw, FM10K_ITR(0), FM10K_ITR_AUTOMASK |
FM10K_ITR_MASK_CLEAR);
/* Re-enable interrupt from host side */
- rte_intr_enable(handle);
+ rte_intr_enable(dev->intr_handle);
}
/**
* void
*/
static void
-fm10k_dev_interrupt_handler_vf(
- struct rte_intr_handle *handle,
- void *param)
+fm10k_dev_interrupt_handler_vf(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
FM10K_WRITE_REG(hw, FM10K_VFITR(0), FM10K_ITR_AUTOMASK |
FM10K_ITR_MASK_CLEAR);
/* Re-enable interrupt from host side */
- rte_intr_enable(handle);
+ rte_intr_enable(dev->intr_handle);
}
/* Mailbox message handler in VF */
uint64_t *offset,
uint64_t *stat);
static void i40e_pf_config_irq0(struct i40e_hw *hw, bool no_queue);
-static void i40e_dev_interrupt_handler(struct rte_intr_handle *handle,
- void *param);
+static void i40e_dev_interrupt_handler(void *param);
static int i40e_res_pool_init(struct i40e_res_pool_info *pool,
uint32_t base, uint32_t num);
static void i40e_res_pool_destroy(struct i40e_res_pool_info *pool);
* void
*/
static void
-i40e_dev_interrupt_handler(struct rte_intr_handle *intr_handle,
- void *param)
+i40e_dev_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
done:
/* Enable interrupt */
i40e_pf_enable_irq0(hw);
- rte_intr_enable(intr_handle);
+ rte_intr_enable(dev->intr_handle);
}
static int
* void
*/
static void
-i40evf_dev_interrupt_handler(struct rte_intr_handle *intr_handle,
- void *param)
+i40evf_dev_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
done:
i40evf_enable_irq0(hw);
- rte_intr_enable(intr_handle);
+ rte_intr_enable(dev->intr_handle);
}
static int
static int ixgbe_dev_interrupt_get_status(struct rte_eth_dev *dev);
static int ixgbe_dev_interrupt_action(struct rte_eth_dev *dev,
struct rte_intr_handle *handle);
-static void ixgbe_dev_interrupt_handler(struct rte_intr_handle *handle,
- void *param);
+static void ixgbe_dev_interrupt_handler(void *param);
static void ixgbe_dev_interrupt_delayed_handler(void *param);
static void ixgbe_add_rar(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
uint32_t index, uint32_t pool);
struct timespec *timestamp);
static int ixgbe_timesync_write_time(struct rte_eth_dev *dev,
const struct timespec *timestamp);
-static void ixgbevf_dev_interrupt_handler(struct rte_intr_handle *handle,
- void *param);
+static void ixgbevf_dev_interrupt_handler(void *param);
static int ixgbe_dev_l2_tunnel_eth_type_conf
(struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
* void
*/
static void
-ixgbe_dev_interrupt_handler(struct rte_intr_handle *handle,
- void *param)
+ixgbe_dev_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
ixgbe_dev_interrupt_get_status(dev);
- ixgbe_dev_interrupt_action(dev, handle);
+ ixgbe_dev_interrupt_action(dev, dev->intr_handle);
}
static int
}
static void
-ixgbevf_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
- void *param)
+ixgbevf_dev_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
static void
mlx4_dev_link_status_handler(void *);
static void
-mlx4_dev_interrupt_handler(struct rte_intr_handle *, void *);
+mlx4_dev_interrupt_handler(void *);
/**
* Link status handler.
* Callback argument.
*/
static void
-mlx4_dev_interrupt_handler(struct rte_intr_handle *intr_handle, void *cb_arg)
+mlx4_dev_interrupt_handler(void *cb_arg)
{
struct rte_eth_dev *dev = cb_arg;
struct priv *priv = dev->data->dev_private;
int ret;
- (void)intr_handle;
priv_lock(priv);
ret = priv_dev_link_status_handler(priv, dev);
priv_unlock(priv);
int mlx5_ibv_device_to_pci_addr(const struct ibv_device *,
struct rte_pci_addr *);
void mlx5_dev_link_status_handler(void *);
-void mlx5_dev_interrupt_handler(struct rte_intr_handle *, void *);
+void mlx5_dev_interrupt_handler(void *);
void priv_dev_interrupt_handler_uninstall(struct priv *, struct rte_eth_dev *);
void priv_dev_interrupt_handler_install(struct priv *, struct rte_eth_dev *);
int mlx5_set_link_down(struct rte_eth_dev *dev);
* Callback argument.
*/
void
-mlx5_dev_interrupt_handler(struct rte_intr_handle *intr_handle, void *cb_arg)
+mlx5_dev_interrupt_handler(void *cb_arg)
{
struct rte_eth_dev *dev = cb_arg;
struct priv *priv = dev->data->dev_private;
int ret;
- (void)intr_handle;
priv_lock(priv);
ret = priv_dev_link_status_handler(priv, dev);
priv_unlock(priv);
/* Prototypes */
static void nfp_net_close(struct rte_eth_dev *dev);
static int nfp_net_configure(struct rte_eth_dev *dev);
-static void nfp_net_dev_interrupt_handler(struct rte_intr_handle *handle,
- void *param);
+static void nfp_net_dev_interrupt_handler(void *param);
static void nfp_net_dev_interrupt_delayed_handler(void *param);
static int nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static void nfp_net_infos_get(struct rte_eth_dev *dev,
}
static void
-nfp_net_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
- void *param)
+nfp_net_dev_interrupt_handler(void *param)
{
int64_t timeout;
struct rte_eth_link link;
}
static void
-qede_interrupt_handler(struct rte_intr_handle *handle, void *param)
+qede_interrupt_handler(void *param)
{
struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
struct qede_dev *qdev = eth_dev->data->dev_private;
struct ecore_dev *edev = &qdev->edev;
qede_interrupt_action(ECORE_LEADING_HWFN(edev));
- if (rte_intr_enable(handle))
+ if (rte_intr_enable(eth_dev->intr_handle))
DP_ERR(edev, "rte_intr_enable failed\n");
}
}
static void
-sfc_intr_line_handler(struct rte_intr_handle *intr_handle, void *cb_arg)
+sfc_intr_line_handler(void *cb_arg)
{
struct sfc_adapter *sa = (struct sfc_adapter *)cb_arg;
efx_nic_t *enp = sa->nic;
boolean_t fatal;
uint32_t qmask;
unsigned int lsc_seq = sa->port.lsc_seq;
+ struct rte_pci_device *pci_dev = SFC_DEV_TO_PCI(sa->eth_dev);
sfc_log_init(sa, "entry");
if (qmask & (1 << sa->mgmt_evq_index))
sfc_intr_handle_mgmt_evq(sa);
- if (rte_intr_enable(intr_handle) != 0)
+ if (rte_intr_enable(&pci_dev->intr_handle) != 0)
sfc_err(sa, "cannot reenable interrupts");
sfc_log_init(sa, "done");
}
static void
-sfc_intr_message_handler(struct rte_intr_handle *intr_handle, void *cb_arg)
+sfc_intr_message_handler(void *cb_arg)
{
struct sfc_adapter *sa = (struct sfc_adapter *)cb_arg;
efx_nic_t *enp = sa->nic;
boolean_t fatal;
unsigned int lsc_seq = sa->port.lsc_seq;
+ struct rte_pci_device *pci_dev = SFC_DEV_TO_PCI(sa->eth_dev);
sfc_log_init(sa, "entry");
sfc_intr_handle_mgmt_evq(sa);
- if (rte_intr_enable(intr_handle) != 0)
+ if (rte_intr_enable(&pci_dev->intr_handle) != 0)
sfc_err(sa, "cannot reenable interrupts");
sfc_log_init(sa, "done");
}
static void
-tap_dev_intr_handler(struct rte_intr_handle *intr_handle __rte_unused,
- void *cb_arg)
+tap_dev_intr_handler(void *cb_arg)
{
struct rte_eth_dev *dev = cb_arg;
struct pmd_internals *pmd = dev->data->dev_private;
* if link state changed.
*/
void
-virtio_interrupt_handler(struct rte_intr_handle *handle,
- void *param)
+virtio_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = param;
struct virtio_hw *hw = dev->data->dev_private;
isr = vtpci_isr(hw);
PMD_DRV_LOG(INFO, "interrupt status = %#x", isr);
- if (rte_intr_enable(handle) < 0)
+ if (rte_intr_enable(dev->intr_handle) < 0)
PMD_DRV_LOG(ERR, "interrupt enable failed");
if (isr & VIRTIO_PCI_ISR_CONFIG) {
int eth_virtio_dev_init(struct rte_eth_dev *eth_dev);
-void virtio_interrupt_handler(struct rte_intr_handle *handle, void *param);
+void virtio_interrupt_handler(void *param);
#endif /* _VIRTIO_ETHDEV_H_ */
struct rte_intr_handle;
/** Function to be registered for the specific interrupt */
-typedef void (*rte_intr_callback_fn)(struct rte_intr_handle *intr_handle,
- void *cb_arg);
+typedef void (*rte_intr_callback_fn)(void *cb_arg);
#include <exec-env/rte_interrupts.h>
static struct rte_intr_handle intr_handle = {.fd = -1 };
static int handler_registered = 0;
-static void eal_alarm_callback(struct rte_intr_handle *hdl, void *arg);
+static void eal_alarm_callback(void *arg);
int
rte_eal_alarm_init(void)
}
static void
-eal_alarm_callback(struct rte_intr_handle *hdl __rte_unused,
- void *arg __rte_unused)
+eal_alarm_callback(void *arg __rte_unused)
{
struct timespec now;
struct alarm_entry *ap;
rte_spinlock_unlock(&intr_lock);
/* call the actual callback */
- active_cb.cb_fn(&src->intr_handle,
- active_cb.cb_arg);
+ active_cb.cb_fn(active_cb.cb_arg);
/*get the lock back. */
rte_spinlock_lock(&intr_lock);
* Callback for the test interrupt.
*/
static void
-test_interrupt_callback(struct rte_intr_handle *intr_handle, void *arg)
+test_interrupt_callback(void *arg)
{
+ struct rte_intr_handle *intr_handle = (struct rte_intr_handle *)arg;
if (test_intr_type >= TEST_INTERRUPT_HANDLE_MAX) {
printf("invalid interrupt type\n");
flag = -1;
* Callback for the test interrupt.
*/
static void
-test_interrupt_callback_1(struct rte_intr_handle *intr_handle,
- __attribute__((unused)) void *arg)
+test_interrupt_callback_1(void *arg)
{
+ struct rte_intr_handle *intr_handle = (struct rte_intr_handle *)arg;
if (test_interrupt_handle_sanity_check(intr_handle) < 0) {
printf("null or invalid intr_handle for %s\n", __func__);
flag = -1;
test_intr_handle = intr_handles[intr_type];
test_intr_type = intr_type;
if (rte_intr_callback_register(&test_intr_handle,
- test_interrupt_callback, NULL) < 0) {
+ test_interrupt_callback, &test_intr_handle) < 0) {
printf("fail to register callback\n");
return -1;
}
rte_delay_ms(TEST_INTERRUPT_CHECK_INTERVAL);
if (rte_intr_callback_unregister(&test_intr_handle,
- test_interrupt_callback, NULL) < 0)
+ test_interrupt_callback, &test_intr_handle) < 0)
return -1;
if (flag == 0) {
/* check if it will fail to register cb with invalid intr_handle */
test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_INVALID];
if (rte_intr_callback_register(&test_intr_handle,
- test_interrupt_callback, NULL) == 0) {
+ test_interrupt_callback, &test_intr_handle) == 0) {
printf("unexpectedly register successfully with invalid "
"intr_handle\n");
goto out;
/* check if it will fail to register without callback */
test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID];
- if (rte_intr_callback_register(&test_intr_handle, NULL, NULL) == 0) {
+ if (rte_intr_callback_register(&test_intr_handle, NULL, &test_intr_handle) == 0) {
printf("unexpectedly register successfully with "
"null callback\n");
goto out;
/* check if it will fail to unregister cb with invalid intr_handle */
test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_INVALID];
if (rte_intr_callback_unregister(&test_intr_handle,
- test_interrupt_callback, NULL) > 0) {
+ test_interrupt_callback, &test_intr_handle) > 0) {
printf("unexpectedly unregister successfully with "
"invalid intr_handle\n");
goto out;
/* check if it is ok to register the same intr_handle twice */
test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID];
if (rte_intr_callback_register(&test_intr_handle,
- test_interrupt_callback, NULL) < 0) {
+ test_interrupt_callback, &test_intr_handle) < 0) {
printf("it fails to register test_interrupt_callback\n");
goto out;
}
if (rte_intr_callback_register(&test_intr_handle,
- test_interrupt_callback_1, NULL) < 0) {
+ test_interrupt_callback_1, &test_intr_handle) < 0) {
printf("it fails to register test_interrupt_callback_1\n");
goto out;
}
goto out;
}
if (rte_intr_callback_unregister(&test_intr_handle,
- test_interrupt_callback, NULL) <= 0) {
+ test_interrupt_callback, &test_intr_handle) <= 0) {
printf("it fails to unregister test_interrupt_callback\n");
goto out;
}