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

Function ixgbe_set_vf_macvlan_msg

dpdk/drivers/net/ixgbe/ixgbe_pf.c:794–822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792}
793
794static int
795ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
796{
797 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
798 struct ixgbe_vf_info *vf_info =
799 *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
800 uint8_t *new_mac = (uint8_t *)(&msgbuf[1]);
801 int index = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) >>
802 IXGBE_VT_MSGINFO_SHIFT;
803
804 if (index) {
805 if (!rte_is_valid_assigned_ether_addr(
806 (struct rte_ether_addr *)new_mac)) {
807 PMD_DRV_LOG(ERR, "set invalid mac vf:%d", vf);
808 return -1;
809 }
810
811 vf_info[vf].mac_count++;
812
813 hw->mac.ops.set_rar(hw, vf_info[vf].mac_count,
814 new_mac, vf, IXGBE_RAH_AV);
815 } else {
816 if (vf_info[vf].mac_count) {
817 hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count);
818 vf_info[vf].mac_count = 0;
819 }
820 }
821 return 0;
822}
823
824static int
825ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)

Callers 1

ixgbe_rcv_msg_from_vfFunction · 0.85

Calls 1

Tested by

no test coverage detected