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

Function sfc_repr_stop

dpdk/drivers/net/sfc/sfc_repr.c:292–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292static int
293sfc_repr_stop(struct rte_eth_dev *dev)
294{
295 struct sfc_repr *sr = sfc_repr_by_eth_dev(dev);
296 struct sfc_repr_shared *srs;
297 unsigned int i;
298 int ret;
299
300 sfcr_info(sr, "entry");
301
302 SFC_ASSERT(sfc_repr_lock_is_locked(sr));
303
304 switch (sr->state) {
305 case SFC_ETHDEV_STARTED:
306 break;
307 case SFC_ETHDEV_CONFIGURED:
308 sfcr_info(sr, "already stopped");
309 return 0;
310 default:
311 sfcr_err(sr, "stop in unexpected state %u", sr->state);
312 SFC_ASSERT(B_FALSE);
313 ret = -EINVAL;
314 goto fail_bad_state;
315 }
316
317 srs = sfc_repr_shared_by_eth_dev(dev);
318 ret = sfc_repr_proxy_stop_repr(srs->pf_port_id, srs->repr_id);
319 if (ret != 0) {
320 SFC_ASSERT(ret > 0);
321 ret = -ret;
322 goto fail_stop;
323 }
324
325 for (i = 0; i < dev->data->nb_rx_queues; i++)
326 sfc_repr_rx_queue_stop(dev->data->rx_queues[i]);
327
328 for (i = 0; i < dev->data->nb_tx_queues; i++)
329 sfc_repr_tx_queue_stop(dev->data->tx_queues[i]);
330
331 sr->state = SFC_ETHDEV_CONFIGURED;
332 sfcr_info(sr, "done");
333
334 return 0;
335
336fail_bad_state:
337fail_stop:
338 sfcr_err(sr, "%s() failed: %s", __func__, rte_strerror(-ret));
339
340 return ret;
341}
342
343static int
344sfc_repr_dev_stop(struct rte_eth_dev *dev)

Callers 2

sfc_repr_dev_stopFunction · 0.85
sfc_repr_dev_closeFunction · 0.85

Calls 6

sfc_repr_by_eth_devFunction · 0.85
sfc_repr_proxy_stop_reprFunction · 0.85
sfc_repr_rx_queue_stopFunction · 0.85
sfc_repr_tx_queue_stopFunction · 0.85
rte_strerrorFunction · 0.85

Tested by

no test coverage detected