X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fipn3ke%2Fipn3ke_representor.c;h=01ad92e7313eccd5137b1d17a1050472feb15b54;hb=168c59cfe42b;hp=383198243f89551ccb51de16afd749c198d3d2cd;hpb=70d6b7f550f424df12332fecbf7a619aec81c00d;p=dpdk.git diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index 383198243f..01ad92e731 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -21,6 +21,7 @@ #include #include "ipn3ke_rawdev_api.h" +#include "ipn3ke_flow.h" #include "ipn3ke_logs.h" #include "ipn3ke_ethdev.h" @@ -123,10 +124,11 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev) snprintf(attr_name, IPN3KE_RAWDEV_ATTR_LEN_MAX, "%s", "LineSideBaseMAC"); rawdev->dev_ops->attr_get(rawdev, attr_name, &base_mac); - ether_addr_copy((struct ether_addr *)&base_mac, &rpst->mac_addr); + rte_ether_addr_copy((struct rte_ether_addr *)&base_mac, + &rpst->mac_addr); - ether_addr_copy(&rpst->mac_addr, &dev->data->mac_addrs[0]); - dev->data->mac_addrs->addr_bytes[ETHER_ADDR_LEN - 1] = + rte_ether_addr_copy(&rpst->mac_addr, &dev->data->mac_addrs[0]); + dev->data->mac_addrs->addr_bytes[RTE_ETHER_ADDR_LEN - 1] = (uint8_t)rpst->port_id + 1; if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) { @@ -649,19 +651,19 @@ ipn3ke_rpst_allmulticast_disable(struct rte_eth_dev *ethdev) int ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev); struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev); uint32_t val; - if (!is_valid_assigned_ether_addr(mac_addr)) { + if (!rte_is_valid_assigned_ether_addr(mac_addr)) { IPN3KE_AFU_PMD_ERR("Tried to set invalid MAC address."); return -EINVAL; } if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) { - ether_addr_copy(&mac_addr[0], &rpst->mac_addr); + rte_ether_addr_copy(&mac_addr[0], &rpst->mac_addr); /* Set mac address */ rte_memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t)); @@ -690,7 +692,7 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, uint16_t mtu) uint32_t frame_size = mtu + IPN3KE_ETH_OVERHEAD; /* check if mtu is within the allowed range */ - if (mtu < ETHER_MIN_MTU || + if (mtu < RTE_ETHER_MIN_MTU || frame_size > IPN3KE_MAC_FRAME_SIZE_MAX) return -EINVAL; @@ -710,7 +712,7 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, uint16_t mtu) return -EBUSY; } - if (frame_size > ETHER_MAX_LEN) + if (frame_size > RTE_ETHER_MAX_LEN) dev_data->dev_conf.rxmode.offloads |= (uint64_t)(DEV_RX_OFFLOAD_JUMBO_FRAME); else @@ -734,19 +736,22 @@ ipn3ke_afu_filter_ctrl(struct rte_eth_dev *ethdev, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { - struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev); - struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev); int ret = 0; + struct ipn3ke_hw *hw; + struct ipn3ke_rpst *rpst; if (ethdev == NULL) return -EINVAL; + hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev); + rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev); + if (hw->acc_flow) switch (filter_type) { case RTE_ETH_FILTER_GENERIC: if (filter_op != RTE_ETH_FILTER_GET) return -EINVAL; - *(const void **)arg = NULL; + *(const void **)arg = &ipn3ke_flow_ops; break; default: IPN3KE_AFU_PMD_WARN("Filter type (%d) not supported", @@ -801,6 +806,8 @@ static const struct eth_dev_ops ipn3ke_rpst_dev_ops = { .allmulticast_disable = ipn3ke_rpst_allmulticast_disable, .mac_addr_set = ipn3ke_rpst_mac_addr_set, .mtu_set = ipn3ke_rpst_mtu_set, + + .tm_ops_get = ipn3ke_tm_ops_get, }; static uint16_t ipn3ke_rpst_recv_pkts(__rte_unused void *rx_q, @@ -833,13 +840,16 @@ ipn3ke_rpst_init(struct rte_eth_dev *ethdev, void *init_params) rpst->i40e_pf_eth = NULL; rpst->i40e_pf_eth_port_id = 0xFFFF; - ethdev->data->mac_addrs = rte_zmalloc("ipn3ke", ETHER_ADDR_LEN, 0); + ethdev->data->mac_addrs = rte_zmalloc("ipn3ke", RTE_ETHER_ADDR_LEN, 0); if (!ethdev->data->mac_addrs) { IPN3KE_AFU_PMD_ERR("Failed to " "allocated memory for storing mac address"); return -ENODEV; } + if (rpst->hw->tm_hw_enable) + ipn3ke_tm_init(rpst); + /* Set representor device ops */ ethdev->dev_ops = &ipn3ke_rpst_dev_ops; @@ -853,7 +863,7 @@ ipn3ke_rpst_init(struct rte_eth_dev *ethdev, void *init_params) ethdev->data->nb_tx_queues = 1; ethdev->data->mac_addrs = rte_zmalloc("ipn3ke_afu_representor", - ETHER_ADDR_LEN, + RTE_ETHER_ADDR_LEN, 0); if (!ethdev->data->mac_addrs) { IPN3KE_AFU_PMD_ERR("Failed to "