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

Function vhost_dev_csum_configure

dpdk/drivers/net/vhost/rte_eth_vhost.c:284–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284static void
285vhost_dev_csum_configure(struct rte_eth_dev *eth_dev)
286{
287 struct pmd_internal *internal = eth_dev->data->dev_private;
288 const struct rte_eth_rxmode *rxmode = &eth_dev->data->dev_conf.rxmode;
289 const struct rte_eth_txmode *txmode = &eth_dev->data->dev_conf.txmode;
290
291 internal->rx_sw_csum = false;
292 internal->tx_sw_csum = false;
293
294 /* SW checksum is not compatible with legacy mode */
295 if (!(internal->flags & RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS))
296 return;
297
298 if (internal->features & (1ULL << VIRTIO_NET_F_CSUM)) {
299 if (!(rxmode->offloads &
300 (RTE_ETH_RX_OFFLOAD_UDP_CKSUM | RTE_ETH_RX_OFFLOAD_TCP_CKSUM))) {
301 VHOST_LOG(NOTICE, "Rx csum will be done in SW, may impact performance.\n");
302 internal->rx_sw_csum = true;
303 }
304 }
305
306 if (!(internal->features & (1ULL << VIRTIO_NET_F_GUEST_CSUM))) {
307 if (txmode->offloads &
308 (RTE_ETH_TX_OFFLOAD_UDP_CKSUM | RTE_ETH_TX_OFFLOAD_TCP_CKSUM)) {
309 VHOST_LOG(NOTICE, "Tx csum will be done in SW, may impact performance.\n");
310 internal->tx_sw_csum = true;
311 }
312 }
313}
314
315static void
316vhost_dev_tx_sw_csum(struct rte_mbuf *mbuf)

Callers 2

new_deviceFunction · 0.85
eth_dev_configureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected