X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fice_ethdev.c;h=f0dc543575fbe201dec59b4116cf2f75b10e0a9a;hb=76fd789cc7dddbaa2c08065b7c3ca915b5c07e7c;hp=dfd99ace941c17d7a035367c63f9dbba9af5a57a;hpb=295b34f55b001bceb27d9177b55326ccda49351b;p=dpdk.git diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index dfd99ace94..f0dc543575 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -129,10 +129,8 @@ static int ice_xstats_get(struct rte_eth_dev *dev, static int ice_xstats_get_names(struct rte_eth_dev *dev, struct rte_eth_xstat_name *xstats_names, unsigned int limit); -static int ice_dev_filter_ctrl(struct rte_eth_dev *dev, - enum rte_filter_type filter_type, - enum rte_filter_op filter_op, - void *arg); +static int ice_dev_flow_ops_get(struct rte_eth_dev *dev, + const struct rte_flow_ops **ops); static int ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev, struct rte_eth_udp_tunnel *udp_tunnel); static int ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, @@ -215,7 +213,7 @@ static const struct eth_dev_ops ice_eth_dev_ops = { .xstats_get = ice_xstats_get, .xstats_get_names = ice_xstats_get_names, .xstats_reset = ice_stats_reset, - .filter_ctrl = ice_dev_filter_ctrl, + .flow_ops_get = ice_dev_flow_ops_get, .udp_tunnel_port_add = ice_dev_udp_tunnel_port_add, .udp_tunnel_port_del = ice_dev_udp_tunnel_port_del, .tx_done_cleanup = ice_tx_done_cleanup, @@ -809,7 +807,7 @@ ice_init_mac_address(struct rte_eth_dev *dev) (struct rte_ether_addr *)hw->port_info[0].mac.perm_addr); dev->data->mac_addrs = - rte_zmalloc(NULL, sizeof(struct rte_ether_addr), 0); + rte_zmalloc(NULL, sizeof(struct rte_ether_addr) * ICE_NUM_MACADDR_MAX, 0); if (!dev->data->mac_addrs) { PMD_INIT_LOG(ERR, "Failed to allocate memory to store mac address"); @@ -1663,8 +1661,14 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file) pos = rte_pci_find_ext_capability(pci_dev, RTE_PCI_EXT_CAP_ID_DSN); if (pos) { - rte_pci_read_config(pci_dev, &dsn_low, 4, pos + 4); - rte_pci_read_config(pci_dev, &dsn_high, 4, pos + 8); + if (rte_pci_read_config(pci_dev, &dsn_low, 4, pos + 4) < 0) { + PMD_INIT_LOG(ERR, "Failed to read pci config space\n"); + return -1; + } + if (rte_pci_read_config(pci_dev, &dsn_high, 4, pos + 8) < 0) { + PMD_INIT_LOG(ERR, "Failed to read pci config space\n"); + return -1; + } snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE, "ice-%08x%08x.pkg", dsn_high, dsn_low); } else { @@ -1727,7 +1731,11 @@ static int ice_load_pkg(struct rte_eth_dev *dev) struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); - ice_pkg_file_search_path(pci_dev, pkg_file); + err = ice_pkg_file_search_path(pci_dev, pkg_file); + if (err) { + PMD_INIT_LOG(ERR, "failed to search file path\n"); + return err; + } file = fopen(pkg_file, "rb"); if (!file) { @@ -2338,7 +2346,7 @@ hash_cfg_reset(struct ice_rss_hash_cfg *cfg) cfg->hash_flds = 0; cfg->addl_hdrs = 0; cfg->symm = 0; - cfg->hdr_type = ICE_RSS_ANY_HEADERS; + cfg->hdr_type = ICE_RSS_OUTER_HEADERS; } static int @@ -2823,7 +2831,7 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf) __func__, ret); cfg.symm = 0; - cfg.hdr_type = ICE_RSS_ANY_HEADERS; + cfg.hdr_type = ICE_RSS_OUTER_HEADERS; /* Configure RSS for IPv4 with src/dst addr as input set */ if (rss_hf & ETH_RSS_IPV4) { cfg.addl_hdrs = ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER; @@ -4011,20 +4019,16 @@ ice_vsi_config_vlan_filter(struct ice_vsi *vsi, bool on) { struct ice_hw *hw = ICE_VSI_TO_HW(vsi); struct ice_vsi_ctx ctxt; - uint8_t sec_flags, sw_flags2; + uint8_t sw_flags2; int ret = 0; - sec_flags = ICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA << - ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S; sw_flags2 = ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA; - if (on) { - vsi->info.sec_flags |= sec_flags; + if (on) vsi->info.sw_flags2 |= sw_flags2; - } else { - vsi->info.sec_flags &= ~sec_flags; + else vsi->info.sw_flags2 &= ~sw_flags2; - } + vsi->info.sw_id = hw->port_info->sw_id; (void)rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.info.valid_sections = @@ -4451,8 +4455,10 @@ ice_rss_hash_update(struct rte_eth_dev *dev, if (status) return status; - if (rss_conf->rss_hf == 0) + if (rss_conf->rss_hf == 0) { + pf->rss_hf = 0; return 0; + } /* RSS hash configuration */ ice_rss_hash_set(pf, rss_conf->rss_hf); @@ -5259,30 +5265,14 @@ static int ice_xstats_get_names(__rte_unused struct rte_eth_dev *dev, } static int -ice_dev_filter_ctrl(struct rte_eth_dev *dev, - enum rte_filter_type filter_type, - enum rte_filter_op filter_op, - void *arg) +ice_dev_flow_ops_get(struct rte_eth_dev *dev, + const struct rte_flow_ops **ops) { - int ret = 0; - if (!dev) return -EINVAL; - switch (filter_type) { - case RTE_ETH_FILTER_GENERIC: - if (filter_op != RTE_ETH_FILTER_GET) - return -EINVAL; - *(const void **)arg = &ice_flow_ops; - break; - default: - PMD_DRV_LOG(WARNING, "Filter type (%d) not supported", - filter_type); - ret = -EINVAL; - break; - } - - return ret; + *ops = &ice_flow_ops; + return 0; } /* Add UDP tunneling port */