net/ice: fix promiscuous mode
[dpdk.git] / drivers / net / ice / ice_ethdev.c
index 0946b19..1f06a2c 100644 (file)
@@ -1662,6 +1662,18 @@ static int ice_init_rss(struct ice_pf *pf)
        if (ret)
                return -EINVAL;
 
+       /* configure RSS for IPv4 with input set IPv4 src/dst */
+       ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4,
+                             ICE_FLOW_SEG_HDR_IPV4);
+       if (ret)
+               PMD_DRV_LOG(ERR, "%s IPV4 rss flow fail %d", __func__, ret);
+
+       /* configure RSS for IPv6 with input set IPv6 src/dst */
+       ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6,
+                             ICE_FLOW_SEG_HDR_IPV6);
+       if (ret)
+               PMD_DRV_LOG(ERR, "%s IPV6 rss flow fail %d", __func__, ret);
+
        /* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */
        ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV6,
                              ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_IPV6);
@@ -2756,14 +2768,16 @@ ice_promisc_enable(struct rte_eth_dev *dev)
        struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
        struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct ice_vsi *vsi = pf->main_vsi;
+       enum ice_status status;
        uint8_t pmask;
-       uint16_t status;
 
        pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
                ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
        status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0);
-       if (status != ICE_SUCCESS)
+       if (status == ICE_ERR_ALREADY_EXISTS)
+               PMD_DRV_LOG(DEBUG, "Promisc mode has already been enabled");
+       else if (status != ICE_SUCCESS)
                PMD_DRV_LOG(ERR, "Failed to enable promisc, err=%d", status);
 }
 
@@ -2773,7 +2787,7 @@ ice_promisc_disable(struct rte_eth_dev *dev)
        struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
        struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct ice_vsi *vsi = pf->main_vsi;
-       uint16_t status;
+       enum ice_status status;
        uint8_t pmask;
 
        pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
@@ -2790,8 +2804,8 @@ ice_allmulti_enable(struct rte_eth_dev *dev)
        struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
        struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct ice_vsi *vsi = pf->main_vsi;
+       enum ice_status status;
        uint8_t pmask;
-       uint16_t status;
 
        pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
@@ -2806,7 +2820,7 @@ ice_allmulti_disable(struct rte_eth_dev *dev)
        struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
        struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct ice_vsi *vsi = pf->main_vsi;
-       uint16_t status;
+       enum ice_status status;
        uint8_t pmask;
 
        if (dev->data->promiscuous == 1)