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

Function set_rxtx_funcs

dpdk/drivers/net/virtio/virtio_ethdev.c:1246–1314  ·  view source on GitHub ↗

set rx and tx handlers according to what is supported */

Source from the content-addressed store, hash-verified

1244
1245/* set rx and tx handlers according to what is supported */
1246static void
1247set_rxtx_funcs(struct rte_eth_dev *eth_dev)
1248{
1249 struct virtio_hw *hw = eth_dev->data->dev_private;
1250
1251 eth_dev->tx_pkt_prepare = virtio_xmit_pkts_prepare;
1252 if (virtio_with_packed_queue(hw)) {
1253 PMD_INIT_LOG(INFO,
1254 "virtio: using packed ring %s Tx path on port %u",
1255 hw->use_vec_tx ? "vectorized" : "standard",
1256 eth_dev->data->port_id);
1257 if (hw->use_vec_tx)
1258 eth_dev->tx_pkt_burst = virtio_xmit_pkts_packed_vec;
1259 else
1260 eth_dev->tx_pkt_burst = virtio_xmit_pkts_packed;
1261 } else {
1262 if (hw->use_inorder_tx) {
1263 PMD_INIT_LOG(INFO, "virtio: using inorder Tx path on port %u",
1264 eth_dev->data->port_id);
1265 eth_dev->tx_pkt_burst = virtio_xmit_pkts_inorder;
1266 } else {
1267 PMD_INIT_LOG(INFO, "virtio: using standard Tx path on port %u",
1268 eth_dev->data->port_id);
1269 eth_dev->tx_pkt_burst = virtio_xmit_pkts;
1270 }
1271 }
1272
1273 if (virtio_with_packed_queue(hw)) {
1274 if (hw->use_vec_rx) {
1275 PMD_INIT_LOG(INFO,
1276 "virtio: using packed ring vectorized Rx path on port %u",
1277 eth_dev->data->port_id);
1278 eth_dev->rx_pkt_burst =
1279 &virtio_recv_pkts_packed_vec;
1280 } else if (virtio_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) {
1281 PMD_INIT_LOG(INFO,
1282 "virtio: using packed ring mergeable buffer Rx path on port %u",
1283 eth_dev->data->port_id);
1284 eth_dev->rx_pkt_burst =
1285 &virtio_recv_mergeable_pkts_packed;
1286 } else {
1287 PMD_INIT_LOG(INFO,
1288 "virtio: using packed ring standard Rx path on port %u",
1289 eth_dev->data->port_id);
1290 eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed;
1291 }
1292 } else {
1293 if (hw->use_vec_rx) {
1294 PMD_INIT_LOG(INFO, "virtio: using vectorized Rx path on port %u",
1295 eth_dev->data->port_id);
1296 eth_dev->rx_pkt_burst = virtio_recv_pkts_vec;
1297 } else if (hw->use_inorder_rx) {
1298 PMD_INIT_LOG(INFO,
1299 "virtio: using inorder Rx path on port %u",
1300 eth_dev->data->port_id);
1301 eth_dev->rx_pkt_burst = &virtio_recv_pkts_inorder;
1302 } else if (virtio_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) {
1303 PMD_INIT_LOG(INFO,

Callers 2

eth_virtio_dev_initFunction · 0.85
virtio_dev_startFunction · 0.85

Calls 2

virtio_with_packed_queueFunction · 0.85
virtio_with_featureFunction · 0.85

Tested by

no test coverage detected