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

Function virtio_pci_devargs_parse

dpdk/drivers/net/virtio/virtio_pci_ethdev.c:164–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162#define VIRTIO_ARG_VDPA "vdpa"
163
164static int
165virtio_pci_devargs_parse(struct rte_devargs *devargs, int *vdpa)
166{
167 struct rte_kvargs *kvlist;
168 int ret = 0;
169
170 if (devargs == NULL)
171 return 0;
172
173 kvlist = rte_kvargs_parse(devargs->args, NULL);
174 if (kvlist == NULL) {
175 PMD_INIT_LOG(ERR, "error when parsing param");
176 return 0;
177 }
178
179 if (rte_kvargs_count(kvlist, VIRTIO_ARG_VDPA) == 1) {
180 /* vdpa mode selected when there's a key-value pair:
181 * vdpa=1
182 */
183 ret = rte_kvargs_process(kvlist, VIRTIO_ARG_VDPA,
184 vdpa_check_handler, vdpa);
185 if (ret < 0)
186 PMD_INIT_LOG(ERR, "Failed to parse %s", VIRTIO_ARG_VDPA);
187 }
188
189 rte_kvargs_free(kvlist);
190
191 return ret;
192}
193
194static int eth_virtio_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
195 struct rte_pci_device *pci_dev)

Callers 1

eth_virtio_pci_probeFunction · 0.85

Calls 4

rte_kvargs_parseFunction · 0.85
rte_kvargs_countFunction · 0.85
rte_kvargs_processFunction · 0.85
rte_kvargs_freeFunction · 0.85

Tested by

no test coverage detected