net/nfp: modify RSS logic
Now NFP NIC support two type of RSS logic, NFP_NET_CFG_CTRL_RSS and NFP_NET_CFG_CTRL_RSS2, use NFP_NET_CFG_CTRL_RSS2 if NIC capability support, otherwise use NFP_NET_CFG_CTRL_RSS. Signed-off-by: Jin Liu <jin.liu@corigine.com> Signed-off-by: Diana Wang <na.wang@corigine.com> Signed-off-by: Peng Zhang <peng.zhang@corigine.com> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
This commit is contained in:
parent
bd132ac99a
commit
3ece835a40
@ -171,7 +171,7 @@ nfp_net_configure(struct rte_eth_dev *dev)
|
|||||||
|
|
||||||
/* Checking RX mode */
|
/* Checking RX mode */
|
||||||
if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS &&
|
if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS &&
|
||||||
!(hw->cap & NFP_NET_CFG_CTRL_RSS)) {
|
!(hw->cap & NFP_NET_CFG_CTRL_RSS_ANY)) {
|
||||||
PMD_INIT_LOG(INFO, "RSS not supported");
|
PMD_INIT_LOG(INFO, "RSS not supported");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -769,7 +769,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
|
|||||||
.nb_mtu_seg_max = NFP_TX_MAX_MTU_SEG,
|
.nb_mtu_seg_max = NFP_TX_MAX_MTU_SEG,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (hw->cap & NFP_NET_CFG_CTRL_RSS) {
|
if (hw->cap & NFP_NET_CFG_CTRL_RSS_ANY) {
|
||||||
dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
|
dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
|
||||||
|
|
||||||
dev_info->flow_type_rss_offloads = RTE_ETH_RSS_IPV4 |
|
dev_info->flow_type_rss_offloads = RTE_ETH_RSS_IPV4 |
|
||||||
@ -1080,7 +1080,7 @@ nfp_net_reta_update(struct rte_eth_dev *dev,
|
|||||||
uint32_t update;
|
uint32_t update;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
|
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = nfp_net_rss_reta_write(dev, reta_conf, reta_size);
|
ret = nfp_net_rss_reta_write(dev, reta_conf, reta_size);
|
||||||
@ -1108,7 +1108,7 @@ nfp_net_reta_query(struct rte_eth_dev *dev,
|
|||||||
|
|
||||||
hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||||
|
|
||||||
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
|
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) {
|
if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) {
|
||||||
@ -1206,7 +1206,7 @@ nfp_net_rss_hash_update(struct rte_eth_dev *dev,
|
|||||||
rss_hf = rss_conf->rss_hf;
|
rss_hf = rss_conf->rss_hf;
|
||||||
|
|
||||||
/* Checking if RSS is enabled */
|
/* Checking if RSS is enabled */
|
||||||
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS)) {
|
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY)) {
|
||||||
if (rss_hf != 0) { /* Enable RSS? */
|
if (rss_hf != 0) { /* Enable RSS? */
|
||||||
PMD_DRV_LOG(ERR, "RSS unsupported");
|
PMD_DRV_LOG(ERR, "RSS unsupported");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -1241,7 +1241,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
|
|||||||
|
|
||||||
hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||||
|
|
||||||
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
|
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
rss_hf = rss_conf->rss_hf;
|
rss_hf = rss_conf->rss_hf;
|
||||||
|
@ -119,6 +119,7 @@
|
|||||||
#define NFP_NET_CFG_MACADDR 0x0024
|
#define NFP_NET_CFG_MACADDR 0x0024
|
||||||
|
|
||||||
#define NFP_NET_CFG_CTRL_LSO_ANY (NFP_NET_CFG_CTRL_LSO | NFP_NET_CFG_CTRL_LSO2)
|
#define NFP_NET_CFG_CTRL_LSO_ANY (NFP_NET_CFG_CTRL_LSO | NFP_NET_CFG_CTRL_LSO2)
|
||||||
|
#define NFP_NET_CFG_CTRL_RSS_ANY (NFP_NET_CFG_CTRL_RSS | NFP_NET_CFG_CTRL_RSS2)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read-only words (0x0030 - 0x0050):
|
* Read-only words (0x0030 - 0x0050):
|
||||||
|
@ -123,7 +123,10 @@ nfp_net_start(struct rte_eth_dev *dev)
|
|||||||
if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) {
|
if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) {
|
||||||
nfp_net_rss_config_default(dev);
|
nfp_net_rss_config_default(dev);
|
||||||
update |= NFP_NET_CFG_UPDATE_RSS;
|
update |= NFP_NET_CFG_UPDATE_RSS;
|
||||||
new_ctrl |= NFP_NET_CFG_CTRL_RSS;
|
if (hw->cap & NFP_NET_CFG_CTRL_RSS2)
|
||||||
|
new_ctrl |= NFP_NET_CFG_CTRL_RSS2;
|
||||||
|
else
|
||||||
|
new_ctrl |= NFP_NET_CFG_CTRL_RSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable device */
|
/* Enable device */
|
||||||
|
@ -95,7 +95,10 @@ nfp_netvf_start(struct rte_eth_dev *dev)
|
|||||||
if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) {
|
if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) {
|
||||||
nfp_net_rss_config_default(dev);
|
nfp_net_rss_config_default(dev);
|
||||||
update |= NFP_NET_CFG_UPDATE_RSS;
|
update |= NFP_NET_CFG_UPDATE_RSS;
|
||||||
new_ctrl |= NFP_NET_CFG_CTRL_RSS;
|
if (hw->cap & NFP_NET_CFG_CTRL_RSS2)
|
||||||
|
new_ctrl |= NFP_NET_CFG_CTRL_RSS2;
|
||||||
|
else
|
||||||
|
new_ctrl |= NFP_NET_CFG_CTRL_RSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable device */
|
/* Enable device */
|
||||||
|
@ -135,7 +135,7 @@ nfp_net_set_hash(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd,
|
|||||||
uint32_t hash = 0;
|
uint32_t hash = 0;
|
||||||
uint32_t hash_type = 0;
|
uint32_t hash_type = 0;
|
||||||
|
|
||||||
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
|
if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* this is true for new firmwares */
|
/* this is true for new firmwares */
|
||||||
|
Loading…
Reference in New Issue
Block a user