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

Function virtio_get_monitor_addr

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

Source from the content-addressed store, hash-verified

999}
1000
1001static int
1002virtio_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
1003{
1004 struct virtnet_rx *rxvq = rx_queue;
1005 struct virtqueue *vq = virtnet_rxq_to_vq(rxvq);
1006 struct virtio_hw *hw;
1007
1008 if (vq == NULL)
1009 return -EINVAL;
1010
1011 hw = vq->hw;
1012 if (virtio_with_packed_queue(hw)) {
1013 struct vring_packed_desc *desc;
1014 desc = vq->vq_packed.ring.desc;
1015 pmc->addr = &desc[vq->vq_used_cons_idx].flags;
1016 if (vq->vq_packed.used_wrap_counter)
1017 pmc->opaque[CLB_VAL_IDX] =
1018 VRING_PACKED_DESC_F_AVAIL_USED;
1019 else
1020 pmc->opaque[CLB_VAL_IDX] = 0;
1021 pmc->opaque[CLB_MSK_IDX] = VRING_PACKED_DESC_F_AVAIL_USED;
1022 pmc->opaque[CLB_MATCH_IDX] = 1;
1023 pmc->size = sizeof(desc[vq->vq_used_cons_idx].flags);
1024 } else {
1025 pmc->addr = &vq->vq_split.ring.used->idx;
1026 pmc->opaque[CLB_VAL_IDX] = vq->vq_used_cons_idx
1027 & (vq->vq_nentries - 1);
1028 pmc->opaque[CLB_MSK_IDX] = vq->vq_nentries - 1;
1029 pmc->opaque[CLB_MATCH_IDX] = 0;
1030 pmc->size = sizeof(vq->vq_split.ring.used->idx);
1031 }
1032 pmc->fn = virtio_monitor_callback;
1033
1034 return 0;
1035}
1036
1037static int
1038virtio_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)

Callers

nothing calls this directly

Calls 1

virtio_with_packed_queueFunction · 0.85

Tested by

no test coverage detected