X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fixgbe%2Fixgbe_pf.c;h=493f0f2b9a8f79cc5de6f612295203cd9392d216;hb=3c4270187518;hp=c88d56e245641b786259ff79d421609831a112d5;hpb=35b2d13fd6fdcbd191f2a30d74648faeb1186c65;p=dpdk.git diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index c88d56e245..493f0f2b9a 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -161,16 +161,14 @@ ixgbe_add_tx_flow_control_drop_filter(struct rte_eth_dev *eth_dev) struct ixgbe_ethertype_filter ethertype_filter; if (!hw->mac.ops.set_ethertype_anti_spoofing) { - RTE_LOG(INFO, PMD, "ether type anti-spoofing is not" - " supported.\n"); + PMD_DRV_LOG(INFO, "ether type anti-spoofing is not supported.\n"); return; } i = ixgbe_ethertype_filter_lookup(filter_info, IXGBE_ETHERTYPE_FLOW_CTRL); if (i >= 0) { - RTE_LOG(ERR, PMD, "A ether type filter" - " entity for flow control already exists!\n"); + PMD_DRV_LOG(ERR, "A ether type filter entity for flow control already exists!\n"); return; } @@ -183,8 +181,7 @@ ixgbe_add_tx_flow_control_drop_filter(struct rte_eth_dev *eth_dev) i = ixgbe_ethertype_filter_insert(filter_info, ðertype_filter); if (i < 0) { - RTE_LOG(ERR, PMD, "Cannot find an unused ether type filter" - " entity for flow control.\n"); + PMD_DRV_LOG(ERR, "Cannot find an unused ether type filter entity for flow control.\n"); return; } @@ -415,7 +412,7 @@ ixgbe_disable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); - RTE_LOG(INFO, PMD, "VF %u: disabling multicast promiscuous\n", vf); + PMD_DRV_LOG(INFO, "VF %u: disabling multicast promiscuous\n", vf); vmolr &= ~IXGBE_VMOLR_MPE; @@ -547,6 +544,7 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint32_t new_mtu = msgbuf[1]; uint32_t max_frs; + uint32_t hlreg0; int max_frame = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; /* X540 and X550 support jumbo frames in IOV mode */ @@ -563,6 +561,18 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms max_frs = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) & IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT; if (max_frs < new_mtu) { + hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); + if (new_mtu > RTE_ETHER_MAX_LEN) { + dev->data->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + hlreg0 |= IXGBE_HLREG0_JUMBOEN; + } else { + dev->data->dev_conf.rxmode.offloads &= + ~DEV_RX_OFFLOAD_JUMBO_FRAME; + hlreg0 &= ~IXGBE_HLREG0_JUMBOEN; + } + IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); + max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT; IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs); } @@ -588,7 +598,7 @@ ixgbe_negotiate_vf_api(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) break; } - RTE_LOG(ERR, PMD, "Negotiate invalid api version %u from VF %d\n", + PMD_DRV_LOG(ERR, "Negotiate invalid api version %u from VF %d\n", api_version, vf); return -1; @@ -618,6 +628,7 @@ ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) case ixgbe_mbox_api_20: case ixgbe_mbox_api_11: case ixgbe_mbox_api_12: + case ixgbe_mbox_api_13: break; default: return -1; @@ -635,7 +646,7 @@ ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) switch (eth_conf->txmode.mq_mode) { case ETH_MQ_TX_NONE: case ETH_MQ_TX_DCB: - RTE_LOG(ERR, PMD, "PF must work with virtualization for VF %u" + PMD_DRV_LOG(ERR, "PF must work with virtualization for VF %u" ", but its tx mode = %d\n", vf, eth_conf->txmode.mq_mode); return -1; @@ -670,7 +681,7 @@ ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) break; default: - RTE_LOG(ERR, PMD, "PF work with invalid mode = %d\n", + PMD_DRV_LOG(ERR, "PF work with invalid mode = %d\n", eth_conf->txmode.mq_mode); return -1; } @@ -725,7 +736,7 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); if (!(fctrl & IXGBE_FCTRL_UPE)) { /* VF promisc requires PF in promisc */ - RTE_LOG(ERR, PMD, + PMD_DRV_LOG(ERR, "Enabling VF promisc requires PF in promisc\n"); return -1; } @@ -750,6 +761,37 @@ out: return 0; } +static int +ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) +{ + struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct ixgbe_vf_info *vf_info = + *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); + uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); + int index = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) >> + IXGBE_VT_MSGINFO_SHIFT; + + if (index) { + if (new_mac == NULL) + return -1; + + if (!rte_is_valid_assigned_ether_addr( + (struct rte_ether_addr *)new_mac)) { + PMD_DRV_LOG(ERR, "set invalid mac vf:%d\n", vf); + return -1; + } + + vf_info[vf].mac_count++; + + hw->mac.ops.set_rar(hw, vf_info[vf].mac_count, + new_mac, vf, IXGBE_RAH_AV); + } else { + hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count); + vf_info[vf].mac_count = 0; + } + return 0; +} + static int ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) { @@ -837,6 +879,10 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) if (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED) retval = ixgbe_set_vf_mc_promisc(dev, vf, msgbuf); break; + case IXGBE_VF_SET_MACVLAN: + if (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED) + retval = ixgbe_set_vf_macvlan_msg(dev, vf, msgbuf); + break; default: PMD_DRV_LOG(DEBUG, "Unhandled Msg %8.8x", (unsigned)msgbuf[0]); retval = IXGBE_ERR_MBX;