net/qede: fix missing UDP protocol in RSS offload types
[dpdk.git] / drivers / net / qede / qede_ethdev.c
index bd190d0..798783b 100644 (file)
@@ -769,7 +769,7 @@ static int qede_init_vport(struct qede_dev *qdev)
        int rc;
 
        start.remove_inner_vlan = 1;
-       start.gro_enable = 0;
+       start.enable_lro = qdev->enable_lro;
        start.mtu = ETHER_MTU + QEDE_ETH_OVERHEAD;
        start.vport_id = 0;
        start.drop_ttl0 = false;
@@ -866,11 +866,6 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
        if (rxmode->enable_scatter == 1)
                eth_dev->data->scattered_rx = 1;
 
-       if (rxmode->enable_lro == 1) {
-               DP_ERR(edev, "LRO is not supported\n");
-               return -EINVAL;
-       }
-
        if (!rxmode->hw_strip_crc)
                DP_INFO(edev, "L2 CRC stripping is always enabled in hw\n");
 
@@ -878,6 +873,13 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
                DP_INFO(edev, "IP/UDP/TCP checksum offload is always enabled "
                              "in hw\n");
 
+       if (rxmode->enable_lro) {
+               qdev->enable_lro = true;
+               /* Enable scatter mode for LRO */
+               if (!rxmode->enable_scatter)
+                       eth_dev->data->scattered_rx = 1;
+       }
+
        /* Check for the port restart case */
        if (qdev->state != QEDE_DEV_INIT) {
                rc = qdev->ops->vport_stop(edev, 0);
@@ -924,6 +926,15 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
                return -EINVAL;
        }
 
+       /* Flow director mode check */
+       rc = qede_check_fdir_support(eth_dev);
+       if (rc) {
+               qdev->ops->vport_stop(edev, 0);
+               qede_dealloc_fp_resc(eth_dev);
+               return -EINVAL;
+       }
+       SLIST_INIT(&qdev->fdir_info.fdir_list_head);
+
        SLIST_INIT(&qdev->vlan_list_head);
 
        /* Add primary mac for PF */
@@ -948,13 +959,15 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 static const struct rte_eth_desc_lim qede_rx_desc_lim = {
        .nb_max = NUM_RX_BDS_MAX,
        .nb_min = 128,
-       .nb_align = 128 /* lowest common multiple */
+       .nb_align = 128 /* lowest common multiple */
 };
 
 static const struct rte_eth_desc_lim qede_tx_desc_lim = {
        .nb_max = NUM_TX_BDS_MAX,
        .nb_min = 256,
-       .nb_align = 256
+       .nb_align = 256,
+       .nb_seg_max = ETH_TX_MAX_BDS_PER_LSO_PACKET,
+       .nb_mtu_seg_max = ETH_TX_MAX_BDS_PER_NON_LSO_PACKET
 };
 
 static void
@@ -996,12 +1009,16 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
                                     DEV_RX_OFFLOAD_IPV4_CKSUM  |
                                     DEV_RX_OFFLOAD_UDP_CKSUM   |
                                     DEV_RX_OFFLOAD_TCP_CKSUM   |
-                                    DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM);
+                                    DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+                                    DEV_RX_OFFLOAD_TCP_LRO);
+
        dev_info->tx_offload_capa = (DEV_TX_OFFLOAD_VLAN_INSERT |
                                     DEV_TX_OFFLOAD_IPV4_CKSUM  |
                                     DEV_TX_OFFLOAD_UDP_CKSUM   |
                                     DEV_TX_OFFLOAD_TCP_CKSUM   |
-                                    DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM);
+                                    DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+                                    DEV_TX_OFFLOAD_TCP_TSO |
+                                    DEV_TX_OFFLOAD_VXLAN_TNL_TSO);
 
        memset(&link, 0, sizeof(struct qed_link_output));
        qdev->ops->common->get_link(edev, &link);
@@ -1124,6 +1141,8 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
 
        PMD_INIT_FUNC_TRACE(edev);
 
+       qede_fdir_dealloc_resc(eth_dev);
+
        /* dev_stop() shall cleanup fp resources in hw but without releasing
         * dma memories and sw structures so that dev_start() can be called
         * by the app without reconfiguration. However, in dev_close() we
@@ -1478,6 +1497,8 @@ static void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf)
        *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV4_TCP)  ? ECORE_RSS_IPV4_TCP : 0;
        *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV6_TCP)  ? ECORE_RSS_IPV6_TCP : 0;
        *rss_caps |= (hf & ETH_RSS_IPV6_TCP_EX)       ? ECORE_RSS_IPV6_TCP : 0;
+       *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV4_UDP)  ? ECORE_RSS_IPV4_UDP : 0;
+       *rss_caps |= (hf & ETH_RSS_NONFRAG_IPV6_UDP)  ? ECORE_RSS_IPV6_UDP : 0;
 }
 
 static int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
@@ -1962,11 +1983,13 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev,
                }
                break;
        case RTE_ETH_FILTER_FDIR:
+               return qede_fdir_filter_conf(eth_dev, filter_op, arg);
+       case RTE_ETH_FILTER_NTUPLE:
+               return qede_ntuple_filter_conf(eth_dev, filter_op, arg);
        case RTE_ETH_FILTER_MACVLAN:
        case RTE_ETH_FILTER_ETHERTYPE:
        case RTE_ETH_FILTER_FLEXIBLE:
        case RTE_ETH_FILTER_SYN:
-       case RTE_ETH_FILTER_NTUPLE:
        case RTE_ETH_FILTER_HASH:
        case RTE_ETH_FILTER_L2_TUNNEL:
        case RTE_ETH_FILTER_MAX:
@@ -2057,6 +2080,7 @@ static void qede_update_pf_params(struct ecore_dev *edev)
 
        memset(&pf_params, 0, sizeof(struct ecore_pf_params));
        pf_params.eth_pf_params.num_cons = QEDE_PF_NUM_CONNS;
+       pf_params.eth_pf_params.num_arfs_filters = QEDE_RFS_MAX_FLTR;
        qed_ops->common->update_pf_params(edev, &pf_params);
 }
 
@@ -2093,6 +2117,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
        eth_dev->rx_pkt_burst = qede_recv_pkts;
        eth_dev->tx_pkt_burst = qede_xmit_pkts;
+       eth_dev->tx_pkt_prepare = qede_xmit_prep_pkts;
 
        if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
                DP_NOTICE(edev, false,