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

Function cpfl_repr_devargs_process

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

Source from the content-addressed store, hash-verified

93}
94
95int
96cpfl_repr_devargs_process(struct cpfl_adapter_ext *adapter, struct cpfl_devargs *devargs)
97{
98 int ret, i, j;
99
100 /* check and refine repr args */
101 for (i = 0; i < devargs->repr_args_num; i++) {
102 struct rte_eth_devargs *eth_da = &devargs->repr_args[i];
103
104 /* set default host_id to host */
105 if (eth_da->nb_mh_controllers == 0) {
106 eth_da->nb_mh_controllers = 1;
107 eth_da->mh_controllers[0] = CPFL_HOST_ID_HOST;
108 } else {
109 for (j = 0; j < eth_da->nb_mh_controllers; j++) {
110 if (eth_da->mh_controllers[j] > CPFL_HOST_ID_ACC) {
111 PMD_INIT_LOG(ERR, "Invalid Host ID %d",
112 eth_da->mh_controllers[j]);
113 return -EINVAL;
114 }
115 }
116 }
117
118 /* set default pf to APF */
119 if (eth_da->nb_ports == 0) {
120 eth_da->nb_ports = 1;
121 eth_da->ports[0] = CPFL_PF_TYPE_APF;
122 } else {
123 for (j = 0; j < eth_da->nb_ports; j++) {
124 if (eth_da->ports[j] > CPFL_PF_TYPE_CPF) {
125 PMD_INIT_LOG(ERR, "Invalid Host ID %d",
126 eth_da->ports[j]);
127 return -EINVAL;
128 }
129 }
130 }
131
132 ret = cpfl_repr_devargs_process_one(adapter, eth_da);
133 if (ret != 0)
134 return ret;
135 }
136
137 return 0;
138}
139
140static int
141cpfl_repr_allowlist_del(struct cpfl_adapter_ext *adapter,

Callers 2

cpfl_pci_probe_firstFunction · 0.85
cpfl_pci_probe_againFunction · 0.85

Calls 1

Tested by

no test coverage detected