X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fixgbe%2Fixgbe_ethdev.c;h=4fd22c5ee39e45815a2620c9282c13631d3d86b3;hb=adce1f86f8d25fc10e9ac32fd59fa0bedce608ad;hp=7efe0052bbfd44f2cd4fea742a418418dc49f315;hpb=a14de8b498d10e23e82d9e6983490b3ffd24c25a;p=dpdk.git diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 7efe0052bb..4fd22c5ee3 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -155,12 +155,6 @@ #define IXGBE_QDE_STRIP_TAG 0x00000004 #define IXGBE_VTEICR_MASK 0x07 -enum ixgbevf_xcast_modes { - IXGBEVF_XCAST_MODE_NONE = 0, - IXGBEVF_XCAST_MODE_MULTI, - IXGBEVF_XCAST_MODE_ALLMULTI, -}; - #define IXGBE_EXVET_VET_EXT_SHIFT 16 #define IXGBE_DMATXCTL_VT_MASK 0xFFFF0000 @@ -253,7 +247,8 @@ static void ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index); static void ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr); static void ixgbe_dcb_init(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config); -static int is_ixgbe_pmd(const char *driver_name); +static bool is_device_supported(struct rte_eth_dev *dev, + struct eth_driver *drv); /* For Virtual Function support */ static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev); @@ -553,6 +548,8 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = { .rx_queue_release = ixgbe_dev_rx_queue_release, .rx_queue_count = ixgbe_dev_rx_queue_count, .rx_descriptor_done = ixgbe_dev_rx_descriptor_done, + .rx_descriptor_status = ixgbe_dev_rx_descriptor_status, + .tx_descriptor_status = ixgbe_dev_tx_descriptor_status, .tx_queue_setup = ixgbe_dev_tx_queue_setup, .tx_queue_release = ixgbe_dev_tx_queue_release, .dev_led_on = ixgbe_dev_led_on, @@ -631,6 +628,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .rx_queue_setup = ixgbe_dev_rx_queue_setup, .rx_queue_release = ixgbe_dev_rx_queue_release, .rx_descriptor_done = ixgbe_dev_rx_descriptor_done, + .rx_descriptor_status = ixgbe_dev_rx_descriptor_status, + .tx_descriptor_status = ixgbe_dev_tx_descriptor_status, .tx_queue_setup = ixgbe_dev_tx_queue_setup, .tx_queue_release = ixgbe_dev_tx_queue_release, .rx_queue_intr_enable = ixgbevf_dev_rx_queue_intr_enable, @@ -898,6 +897,8 @@ ixgbe_pf_reset_hw(struct ixgbe_hw *hw) IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext); IXGBE_WRITE_FLUSH(hw); + if (status == IXGBE_ERR_SFP_NOT_PRESENT) + status = IXGBE_SUCCESS; return status; } @@ -1170,7 +1171,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev) } rte_eth_copy_pci_info(eth_dev, pci_dev); - eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE; + eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE; /* Vendor and Device ID need to be set before init of shared code */ hw->device_id = pci_dev->id.device_id; @@ -1237,6 +1238,9 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev) diag = ixgbe_init_hw(hw); } + if (diag == IXGBE_ERR_SFP_NOT_PRESENT) + diag = IXGBE_SUCCESS; + if (diag == IXGBE_ERR_EEPROM_VERSION) { PMD_INIT_LOG(ERR, "This device is a pre-production adapter/" "LOM. Please be aware there may be issues associated " @@ -1392,6 +1396,9 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev) /* Remove all ntuple filters of the device */ ixgbe_ntuple_filter_uninit(eth_dev); + /* clear all the filters list */ + ixgbe_filterlist_flush(); + return 0; } @@ -1618,7 +1625,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) } rte_eth_copy_pci_info(eth_dev, pci_dev); - eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE; + eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE; hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id; @@ -2451,7 +2458,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev) dev->data->nb_rx_queues * sizeof(int), 0); if (intr_handle->intr_vec == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" - " intr_vec\n", dev->data->nb_rx_queues); + " intr_vec", dev->data->nb_rx_queues); return -ENOMEM; } } @@ -2571,7 +2578,7 @@ skip_link_setup: ixgbe_dev_interrupt_handler, dev); if (dev->data->dev_conf.intr_conf.lsc != 0) PMD_INIT_LOG(INFO, "lsc won't enable because of" - " no intr multiplex\n"); + " no intr multiplex"); } /* check if rxq interrupt is enabled */ @@ -3240,6 +3247,7 @@ ixgbevf_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, /* Extended stats */ for (i = 0; i < IXGBEVF_NB_XSTATS; i++) { + xstats[i].id = i; xstats[i].value = *(uint64_t *)(((char *)hw_stats) + rte_ixgbevf_stats_strings[i].offset); } @@ -3453,7 +3461,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev, dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues; dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues; dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL reg */ - dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS reg */ + dev_info->max_rx_pktlen = 9728; /* includes CRC, cf MAXFRS reg */ dev_info->max_mac_addrs = hw->mac.num_rar_entries; dev_info->max_hash_mac_addrs = IXGBE_VMDQ_NUM_UC_MAC; dev_info->max_vfs = pci_dev->max_vfs; @@ -3783,7 +3791,6 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev, IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private); int64_t timeout; struct rte_eth_link link; - int intr_enable_delay = false; struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -3816,20 +3823,19 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev, timeout = IXGBE_LINK_DOWN_CHECK_TIMEOUT; ixgbe_dev_link_status_print(dev); - - intr_enable_delay = true; - } - - if (intr_enable_delay) { + intr->mask_original = intr->mask; + /* only disable lsc interrupt */ + intr->mask &= ~IXGBE_EIMS_LSC; if (rte_eal_alarm_set(timeout * 1000, ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0) PMD_DRV_LOG(ERR, "Error setting alarm"); - } else { - PMD_DRV_LOG(DEBUG, "enable intr immediately"); - ixgbe_enable_intr(dev); - rte_intr_enable(intr_handle); + else + intr->mask = intr->mask_original; } + PMD_DRV_LOG(DEBUG, "enable intr immediately"); + ixgbe_enable_intr(dev); + rte_intr_enable(intr_handle); return 0; } @@ -3860,6 +3866,8 @@ ixgbe_dev_interrupt_delayed_handler(void *param) IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint32_t eicr; + ixgbe_disable_intr(hw); + eicr = IXGBE_READ_REG(hw, IXGBE_EICR); if (eicr & IXGBE_EICR_MAILBOX) ixgbe_pf_mbx_process(dev); @@ -3882,6 +3890,10 @@ ixgbe_dev_interrupt_delayed_handler(void *param) intr->flags &= ~IXGBE_FLAG_MACSEC; } + /* restore original mask */ + intr->mask = intr->mask_original; + intr->mask_original = 0; + PMD_DRV_LOG(DEBUG, "enable intr in delayed handler S[%08x]", eicr); ixgbe_enable_intr(dev); rte_intr_enable(intr_handle); @@ -4270,7 +4282,7 @@ ixgbe_dev_rss_reta_update(struct rte_eth_dev *dev, if (reta_size != sp_reta_size) { PMD_DRV_LOG(ERR, "The size of hash lookup table configured " "(%d) doesn't match the number hardware can supported " - "(%d)\n", reta_size, sp_reta_size); + "(%d)", reta_size, sp_reta_size); return -EINVAL; } @@ -4317,7 +4329,7 @@ ixgbe_dev_rss_reta_query(struct rte_eth_dev *dev, if (reta_size != sp_reta_size) { PMD_DRV_LOG(ERR, "The size of hash lookup table configured " "(%d) doesn't match the number hardware can supported " - "(%d)\n", reta_size, sp_reta_size); + "(%d)", reta_size, sp_reta_size); return -EINVAL; } @@ -4368,16 +4380,14 @@ ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) ixgbe_add_rar(dev, addr, 0, 0); } -static int -is_ixgbe_pmd(const char *driver_name) +static bool +is_device_supported(struct rte_eth_dev *dev, struct eth_driver *drv) { - if (!strstr(driver_name, "ixgbe")) - return -ENOTSUP; + if (strcmp(dev->driver->pci_drv.driver.name, + drv->pci_drv.driver.name)) + return false; - if (strstr(driver_name, "ixgbe_vf")) - return -ENOTSUP; - - return 0; + return true; } int @@ -4389,17 +4399,17 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, int rar_entry; uint8_t *new_mac = (uint8_t *)(mac_addr); struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -4577,7 +4587,7 @@ ixgbevf_dev_start(struct rte_eth_dev *dev) dev->data->nb_rx_queues * sizeof(int), 0); if (intr_handle->intr_vec == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" - " intr_vec\n", dev->data->nb_rx_queues); + " intr_vec", dev->data->nb_rx_queues); return -ENOMEM; } } @@ -4890,17 +4900,17 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (on > 1) @@ -4920,17 +4930,17 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (on > 1) @@ -4949,17 +4959,17 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) struct ixgbe_hw *hw; uint32_t ctrl; struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (vlan_id > ETHER_MAX_VLAN_ID) @@ -4985,14 +4995,12 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) struct ixgbe_hw *hw; uint32_t ctrl; struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; if (on > 1) @@ -5019,14 +5027,12 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) int i; int num_queues = (int)(IXGBE_QDE_IDX_MASK >> IXGBE_QDE_IDX_SHIFT); struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; if (on > 1) @@ -5049,18 +5055,18 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) struct ixgbe_hw *hw; uint32_t reg_value; struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; /* only support VF's 0 to 63 */ - if ((vf >= dev_info.max_vfs) || (vf > 63)) + if ((vf >= pci_dev->max_vfs) || (vf > 63)) return -EINVAL; if (on > 1) @@ -5082,19 +5088,21 @@ int rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; + struct ixgbe_hw *hw; uint16_t queues_per_pool; uint32_t q; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (on > 1) @@ -5110,8 +5118,12 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) * first 124 queues 0-123 will be allocated to VF's and only * the last 4 queues 123-127 will be assigned to the PF. */ - - queues_per_pool = dev_info.vmdq_queue_num / dev_info.max_vmdq_pools; + if (hw->mac.type == ixgbe_mac_82598EB) + queues_per_pool = (uint16_t)hw->mac.max_rx_queues / + ETH_16_POOLS; + else + queues_per_pool = (uint16_t)hw->mac.max_rx_queues / + ETH_64_POOLS; for (q = 0; q < queues_per_pool; q++) (*dev->dev_ops->vlan_strip_queue_set)(dev, @@ -5124,19 +5136,19 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t { int val = 0; struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; struct ixgbe_hw *hw; uint32_t vmolr; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (on > 1) @@ -5169,7 +5181,7 @@ int rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; uint32_t reg, addr; uint32_t val; const uint8_t bit1 = 0x1; @@ -5178,12 +5190,12 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (on > 1) @@ -5219,7 +5231,7 @@ int rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; + struct rte_pci_device *pci_dev; uint32_t reg, addr; uint32_t val; const uint8_t bit1 = 0x1; @@ -5229,12 +5241,12 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (on > 1) @@ -5270,7 +5282,6 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; int ret = 0; uint16_t vf_idx; struct ixgbe_hw *hw; @@ -5278,9 +5289,8 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0)) @@ -5306,7 +5316,6 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *dev; - struct rte_eth_dev_info dev_info; struct ixgbe_hw *hw; struct ixgbe_vf_info *vfinfo; struct rte_eth_link link; @@ -5320,13 +5329,13 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + pci_dev = IXGBE_DEV_TO_PCI(dev); rte_eth_link_get_nowait(port, &link); - if (is_ixgbe_pmd(dev_info.driver_name) != 0) + if (!is_device_supported(dev, &rte_ixgbe_pmd)) return -ENOTSUP; - if (vf >= dev_info.max_vfs) + if (vf >= pci_dev->max_vfs) return -EINVAL; if (tx_rate > link.link_speed) @@ -5335,7 +5344,6 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, if (q_msk == 0) return 0; - pci_dev = IXGBE_DEV_TO_PCI(dev); hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool; @@ -5948,13 +5956,6 @@ ixgbevf_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) hw->mac.ops.set_rar(hw, 0, (void *)addr, 0, 0); } -#define MAC_TYPE_FILTER_SUP(type) do {\ - if ((type) != ixgbe_mac_82599EB && (type) != ixgbe_mac_X540 &&\ - (type) != ixgbe_mac_X550 && (type) != ixgbe_mac_X550EM_x &&\ - (type) != ixgbe_mac_X550EM_a)\ - return -ENOTSUP;\ -} while (0) - int ixgbe_syn_filter_set(struct rte_eth_dev *dev, struct rte_eth_syn_filter *filter, @@ -6044,7 +6045,7 @@ ixgbe_syn_filter_handle(struct rte_eth_dev *dev, (struct rte_eth_syn_filter *)arg); break; default: - PMD_DRV_LOG(ERR, "unsupported operation %u\n", filter_op); + PMD_DRV_LOG(ERR, "unsupported operation %u", filter_op); ret = -EINVAL; break; } @@ -6222,11 +6223,6 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) return 0; } -#define MAC_TYPE_FILTER_SUP_EXT(type) do {\ - if ((type) != ixgbe_mac_82599EB && (type) != ixgbe_mac_X540)\ - return -ENOTSUP;\ -} while (0) - static inline struct ixgbe_5tuple_filter * ixgbe_5tuple_filter_lookup(struct ixgbe_5tuple_filter_list *filter_list, struct ixgbe_5tuple_filter_info *key) @@ -8187,7 +8183,7 @@ int ixgbe_disable_sec_tx_path_generic(struct ixgbe_hw *hw) /* For informational purposes only */ if (i >= IXGBE_MAX_SECTX_POLL) PMD_DRV_LOG(DEBUG, "Tx unit being enabled before security " - "path fully disabled. Continuing with init.\n"); + "path fully disabled. Continuing with init."); return IXGBE_SUCCESS; } @@ -8220,6 +8216,10 @@ rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; + + if (!is_device_supported(dev, &rte_ixgbe_pmd)) + return -ENOTSUP; + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); /* Stop the data paths */ @@ -8299,6 +8299,10 @@ rte_pmd_ixgbe_macsec_disable(uint8_t port) RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; + + if (!is_device_supported(dev, &rte_ixgbe_pmd)) + return -ENOTSUP; + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); /* Stop the data paths */ @@ -8359,6 +8363,10 @@ rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; + + if (!is_device_supported(dev, &rte_ixgbe_pmd)) + return -ENOTSUP; + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); ctrl = mac[0] | (mac[1] << 8) | (mac[2] << 16) | (mac[3] << 24); @@ -8380,6 +8388,10 @@ rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; + + if (!is_device_supported(dev, &rte_ixgbe_pmd)) + return -ENOTSUP; + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); ctrl = mac[0] | (mac[1] << 8) | (mac[2] << 16) | (mac[3] << 24); @@ -8403,6 +8415,10 @@ rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; + + if (!is_device_supported(dev, &rte_ixgbe_pmd)) + return -ENOTSUP; + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (idx != 0 && idx != 1) @@ -8455,6 +8471,10 @@ rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; + + if (!is_device_supported(dev, &rte_ixgbe_pmd)) + return -ENOTSUP; + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (idx != 0 && idx != 1)