* Removes MAC address and vlan tag from VMDQ. Ensures that nothing is adding buffers to the RX * queue before disabling RX on the device. */
| 988 | * queue before disabling RX on the device. |
| 989 | */ |
| 990 | static inline void |
| 991 | unlink_vmdq(struct vhost_dev *vdev) |
| 992 | { |
| 993 | unsigned i = 0; |
| 994 | unsigned rx_count; |
| 995 | struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; |
| 996 | |
| 997 | if (vdev->ready == DEVICE_RX) { |
| 998 | /*clear MAC and VLAN settings*/ |
| 999 | rte_eth_dev_mac_addr_remove(ports[0], &vdev->mac_address); |
| 1000 | for (i = 0; i < 6; i++) |
| 1001 | vdev->mac_address.addr_bytes[i] = 0; |
| 1002 | |
| 1003 | vdev->vlan_tag = 0; |
| 1004 | |
| 1005 | /*Clear out the receive buffers*/ |
| 1006 | rx_count = rte_eth_rx_burst(ports[0], |
| 1007 | (uint16_t)vdev->vmdq_rx_q, pkts_burst, MAX_PKT_BURST); |
| 1008 | |
| 1009 | while (rx_count) { |
| 1010 | for (i = 0; i < rx_count; i++) |
| 1011 | rte_pktmbuf_free(pkts_burst[i]); |
| 1012 | |
| 1013 | rx_count = rte_eth_rx_burst(ports[0], |
| 1014 | (uint16_t)vdev->vmdq_rx_q, pkts_burst, MAX_PKT_BURST); |
| 1015 | } |
| 1016 | |
| 1017 | vdev->ready = DEVICE_MAC_LEARNING; |
| 1018 | } |
| 1019 | } |
| 1020 | |
| 1021 | static inline void |
| 1022 | free_pkts(struct rte_mbuf **pkts, uint16_t n) |
no test coverage detected