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

Function cpfl_repr_devargs_process_one

dpdk/drivers/net/cpfl/cpfl_representor.c:48–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48static int
49cpfl_repr_devargs_process_one(struct cpfl_adapter_ext *adapter,
50 struct rte_eth_devargs *eth_da)
51{
52 struct cpfl_repr_id repr_id;
53 int ret, c, p, v;
54
55 for (c = 0; c < eth_da->nb_mh_controllers; c++) {
56 for (p = 0; p < eth_da->nb_ports; p++) {
57 repr_id.type = eth_da->type;
58 if (eth_da->type == RTE_ETH_REPRESENTOR_PF) {
59 repr_id.host_id = eth_da->mh_controllers[c];
60 repr_id.pf_id = eth_da->ports[p];
61 repr_id.vf_id = 0;
62 ret = cpfl_repr_allowlist_add(adapter, &repr_id);
63 if (ret == -EEXIST)
64 continue;
65 if (ret) {
66 PMD_DRV_LOG(ERR, "Failed to add PF repr to allowlist, "
67 "host_id = %d, pf_id = %d.",
68 repr_id.host_id, repr_id.pf_id);
69 return ret;
70 }
71 } else if (eth_da->type == RTE_ETH_REPRESENTOR_VF) {
72 for (v = 0; v < eth_da->nb_representor_ports; v++) {
73 repr_id.host_id = eth_da->mh_controllers[c];
74 repr_id.pf_id = eth_da->ports[p];
75 repr_id.vf_id = eth_da->representor_ports[v];
76 ret = cpfl_repr_allowlist_add(adapter, &repr_id);
77 if (ret == -EEXIST)
78 continue;
79 if (ret) {
80 PMD_DRV_LOG(ERR, "Failed to add VF repr to allowlist, "
81 "host_id = %d, pf_id = %d, vf_id = %d.",
82 repr_id.host_id,
83 repr_id.pf_id,
84 repr_id.vf_id);
85 return ret;
86 }
87 }
88 }
89 }
90 }
91
92 return 0;
93}
94
95int
96cpfl_repr_devargs_process(struct cpfl_adapter_ext *adapter, struct cpfl_devargs *devargs)

Callers 1

Calls 1

cpfl_repr_allowlist_addFunction · 0.85

Tested by

no test coverage detected