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

Function destroy_device

dpdk/examples/vdpa/main.c:131–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static void
132destroy_device(int vid)
133{
134 struct rte_device *dev;
135 char ifname[MAX_PATH_LEN];
136 int i;
137
138 rte_vhost_get_ifname(vid, ifname, sizeof(ifname));
139 for (i = 0; i < MAX_VDPA_SAMPLE_PORTS; i++) {
140 if (strncmp(ifname, vports[i].ifname, MAX_PATH_LEN))
141 continue;
142
143 dev = rte_vdpa_get_rte_device(vports[i].dev);
144 if (!dev) {
145 RTE_LOG(ERR, VDPA,
146 "Failed to get generic device for port %d\n", i);
147 continue;
148 }
149
150 printf("\ndestroy port %s, device: %s\n", ifname, rte_dev_name(dev));
151 break;
152 }
153}
154
155static const struct rte_vhost_device_ops vdpa_sample_devops = {
156 .new_device = new_device,

Callers

nothing calls this directly

Calls 5

rte_vhost_get_ifnameFunction · 0.85
strncmpFunction · 0.85
rte_vdpa_get_rte_deviceFunction · 0.85
rte_dev_nameFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected