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

Function ixgbe_set_vf_mc_promisc

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

Source from the content-addressed store, hash-verified

721}
722
723static int
724ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
725{
726 struct ixgbe_vf_info *vfinfo =
727 *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
728 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
729 int xcast_mode = msgbuf[1]; /* msgbuf contains the flag to enable */
730 u32 vmolr, fctrl, disable, enable;
731
732 switch (vfinfo[vf].api_version) {
733 case ixgbe_mbox_api_12:
734 /* promisc introduced in 1.3 version */
735 if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)
736 return -EOPNOTSUPP;
737 break;
738 /* Fall threw */
739 case ixgbe_mbox_api_13:
740 break;
741 default:
742 return -1;
743 }
744
745 if (vfinfo[vf].xcast_mode == xcast_mode)
746 goto out;
747
748 switch (xcast_mode) {
749 case IXGBEVF_XCAST_MODE_NONE:
750 disable = IXGBE_VMOLR_ROMPE |
751 IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
752 enable = IXGBE_VMOLR_BAM;
753 break;
754 case IXGBEVF_XCAST_MODE_MULTI:
755 disable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
756 enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE;
757 break;
758 case IXGBEVF_XCAST_MODE_ALLMULTI:
759 disable = IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
760 enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_MPE;
761 break;
762 case IXGBEVF_XCAST_MODE_PROMISC:
763 if (hw->mac.type <= ixgbe_mac_82599EB)
764 return -1;
765
766 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
767 if (!(fctrl & IXGBE_FCTRL_UPE)) {
768 /* VF promisc requires PF in promisc */
769 PMD_DRV_LOG(ERR,
770 "Enabling VF promisc requires PF in promisc");
771 return -1;
772 }
773
774 disable = IXGBE_VMOLR_VPE;
775 enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
776 IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE;
777 break;
778 default:
779 return -1;
780 }

Callers 1

ixgbe_rcv_msg_from_vfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected