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

Function tap_link_update

dpdk/drivers/net/tap/rte_eth_tap.c:1236–1257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1234}
1235
1236static int
1237tap_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
1238{
1239 struct rte_eth_link *dev_link = &dev->data->dev_link;
1240 struct pmd_internals *pmd = dev->data->dev_private;
1241 struct ifreq ifr = { .ifr_flags = 0 };
1242
1243 if (pmd->remote_if_index) {
1244 tap_ioctl(pmd, SIOCGIFFLAGS, &ifr, 0, REMOTE_ONLY);
1245 if (!(ifr.ifr_flags & IFF_UP) ||
1246 !(ifr.ifr_flags & IFF_RUNNING)) {
1247 dev_link->link_status = RTE_ETH_LINK_DOWN;
1248 return 0;
1249 }
1250 }
1251 tap_ioctl(pmd, SIOCGIFFLAGS, &ifr, 0, LOCAL_ONLY);
1252 dev_link->link_status =
1253 ((ifr.ifr_flags & IFF_UP) && (ifr.ifr_flags & IFF_RUNNING) ?
1254 RTE_ETH_LINK_UP :
1255 RTE_ETH_LINK_DOWN);
1256 return 0;
1257}
1258
1259static int
1260tap_promisc_enable(struct rte_eth_dev *dev)

Callers 1

tap_nl_msg_handlerFunction · 0.85

Calls 1

tap_ioctlFunction · 0.85

Tested by

no test coverage detected