MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mana_intr_install

Function mana_intr_install

dpdk/drivers/net/mana/mana.c:1072–1119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070}
1071
1072static int
1073mana_intr_install(struct rte_eth_dev *eth_dev, struct mana_priv *priv)
1074{
1075 int ret;
1076 struct ibv_context *ctx = priv->ib_ctx;
1077
1078 priv->intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);
1079 if (!priv->intr_handle) {
1080 DRV_LOG(ERR, "Failed to allocate intr_handle");
1081 rte_errno = ENOMEM;
1082 return -ENOMEM;
1083 }
1084
1085 ret = rte_intr_fd_set(priv->intr_handle, -1);
1086 if (ret)
1087 goto free_intr;
1088
1089 ret = mana_fd_set_non_blocking(ctx->async_fd);
1090 if (ret) {
1091 DRV_LOG(ERR, "Failed to change async_fd to NONBLOCK");
1092 goto free_intr;
1093 }
1094
1095 ret = rte_intr_fd_set(priv->intr_handle, ctx->async_fd);
1096 if (ret)
1097 goto free_intr;
1098
1099 ret = rte_intr_type_set(priv->intr_handle, RTE_INTR_HANDLE_EXT);
1100 if (ret)
1101 goto free_intr;
1102
1103 ret = rte_intr_callback_register(priv->intr_handle,
1104 mana_intr_handler, priv);
1105 if (ret) {
1106 DRV_LOG(ERR, "Failed to register intr callback");
1107 rte_intr_fd_set(priv->intr_handle, -1);
1108 goto free_intr;
1109 }
1110
1111 eth_dev->intr_handle = priv->intr_handle;
1112 return 0;
1113
1114free_intr:
1115 rte_intr_instance_free(priv->intr_handle);
1116 priv->intr_handle = NULL;
1117
1118 return ret;
1119}
1120
1121static int
1122mana_proc_priv_init(struct rte_eth_dev *dev)

Callers 1

mana_probe_portFunction · 0.85

Calls 6

rte_intr_instance_allocFunction · 0.85
rte_intr_fd_setFunction · 0.85
mana_fd_set_non_blockingFunction · 0.85
rte_intr_type_setFunction · 0.85
rte_intr_instance_freeFunction · 0.85

Tested by

no test coverage detected