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

Function tap_promisc_enable

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

Source from the content-addressed store, hash-verified

1257}
1258
1259static int
1260tap_promisc_enable(struct rte_eth_dev *dev)
1261{
1262 struct pmd_internals *pmd = dev->data->dev_private;
1263 struct ifreq ifr = { .ifr_flags = IFF_PROMISC };
1264 int ret;
1265
1266 ret = tap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 1, LOCAL_AND_REMOTE);
1267 if (ret != 0)
1268 return ret;
1269
1270 if (pmd->remote_if_index && !pmd->flow_isolate) {
1271 dev->data->promiscuous = 1;
1272 ret = tap_flow_implicit_create(pmd, TAP_REMOTE_PROMISC);
1273 if (ret != 0) {
1274 /* Rollback promisc flag */
1275 tap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 0, LOCAL_AND_REMOTE);
1276 /*
1277 * rte_eth_dev_promiscuous_enable() rollback
1278 * dev->data->promiscuous in the case of failure.
1279 */
1280 return ret;
1281 }
1282 }
1283
1284 return 0;
1285}
1286
1287static int
1288tap_promisc_disable(struct rte_eth_dev *dev)

Callers

nothing calls this directly

Calls 2

tap_ioctlFunction · 0.85
tap_flow_implicit_createFunction · 0.85

Tested by

no test coverage detected