net/sfc: remove adapter locks from secondary process ops
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 7 Feb 2019 12:17:51 +0000 (12:17 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 7 Feb 2019 15:06:30 +0000 (16:06 +0100)
Adapter lock will become primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/sfc_ethdev.c

index c6bee09..6b00601 100644 (file)
@@ -1071,11 +1071,8 @@ sfc_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id,
                      struct rte_eth_rxq_info *qinfo)
 {
        struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
-       struct sfc_adapter *sa = dev->data->dev_private;
        struct sfc_rxq_info *rxq_info;
 
-       sfc_adapter_lock(sa);
-
        SFC_ASSERT(rx_queue_id < sas->rxq_count);
 
        rxq_info = &sas->rxq_info[rx_queue_id];
@@ -1090,8 +1087,6 @@ sfc_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id,
                qinfo->scattered_rx = 1;
        }
        qinfo->nb_desc = rxq_info->entries;
-
-       sfc_adapter_unlock(sa);
 }
 
 /*
@@ -1103,11 +1098,8 @@ sfc_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id,
                      struct rte_eth_txq_info *qinfo)
 {
        struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
-       struct sfc_adapter *sa = dev->data->dev_private;
        struct sfc_txq_info *txq_info;
 
-       sfc_adapter_lock(sa);
-
        SFC_ASSERT(tx_queue_id < sas->txq_count);
 
        txq_info = &sas->txq_info[tx_queue_id];
@@ -1118,8 +1110,6 @@ sfc_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id,
        qinfo->conf.tx_free_thresh = txq_info->free_thresh;
        qinfo->conf.tx_deferred_start = txq_info->deferred_start;
        qinfo->nb_desc = txq_info->entries;
-
-       sfc_adapter_unlock(sa);
 }
 
 /*
@@ -1421,14 +1411,11 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
                          struct rte_eth_rss_conf *rss_conf)
 {
        struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
-       struct sfc_adapter *sa = dev->data->dev_private;
        struct sfc_rss *rss = &sas->rss;
 
        if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE)
                return -ENOTSUP;
 
-       sfc_adapter_lock(sa);
-
        /*
         * Mapping of hash configuration between RTE and EFX is not one-to-one,
         * hence, conversion is done here to derive a correct set of ETH_RSS
@@ -1440,8 +1427,6 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
        if (rss_conf->rss_key != NULL)
                rte_memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
 
-       sfc_adapter_unlock(sa);
-
        return 0;
 }
 
@@ -1526,7 +1511,6 @@ sfc_dev_rss_reta_query(struct rte_eth_dev *dev,
                       uint16_t reta_size)
 {
        struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
-       struct sfc_adapter *sa = dev->data->dev_private;
        struct sfc_rss *rss = &sas->rss;
        int entry;
 
@@ -1539,8 +1523,6 @@ sfc_dev_rss_reta_query(struct rte_eth_dev *dev,
        if (reta_size != EFX_RSS_TBL_SIZE)
                return -EINVAL;
 
-       sfc_adapter_lock(sa);
-
        for (entry = 0; entry < reta_size; entry++) {
                int grp = entry / RTE_RETA_GROUP_SIZE;
                int grp_idx = entry % RTE_RETA_GROUP_SIZE;
@@ -1549,8 +1531,6 @@ sfc_dev_rss_reta_query(struct rte_eth_dev *dev,
                        reta_conf[grp].reta[grp_idx] = rss->tbl[entry];
        }
 
-       sfc_adapter_unlock(sa);
-
        return 0;
 }