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,
.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,
(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");
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 {
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) {
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
__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;
{
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 =
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);
}
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 */