net/sfc: fix meson build warning with gcc
[dpdk.git] / drivers / net / enic / enic_main.c
index 69ad425..98d4775 100644 (file)
@@ -343,8 +343,8 @@ enic_alloc_consistent(void *priv, size_t size,
        struct enic *enic = (struct enic *)priv;
        struct enic_memzone_entry *mze;
 
-       rz = rte_memzone_reserve_aligned((const char *)name,
-                                        size, SOCKET_ID_ANY, 0, ENIC_ALIGN);
+       rz = rte_memzone_reserve_aligned((const char *)name, size,
+                       SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG, ENIC_ALIGN);
        if (!rz) {
                pr_err("%s : Failed to allocate memory requested for %s\n",
                        __func__, name);
@@ -888,9 +888,8 @@ int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
                instance++);
 
        wq->cqmsg_rz = rte_memzone_reserve_aligned((const char *)name,
-                                                  sizeof(uint32_t),
-                                                  SOCKET_ID_ANY, 0,
-                                                  ENIC_ALIGN);
+                       sizeof(uint32_t), SOCKET_ID_ANY,
+                       RTE_MEMZONE_IOVA_CONTIG, ENIC_ALIGN);
        if (!wq->cqmsg_rz)
                return -ENOMEM;
 
@@ -983,9 +982,10 @@ static int enic_dev_wait(struct vnic_dev *vdev,
 static int enic_dev_open(struct enic *enic)
 {
        int err;
+       int flags = CMD_OPENF_IG_DESCCACHE;
 
        err = enic_dev_wait(enic->vdev, vnic_dev_open,
-               vnic_dev_open_done, 0);
+               vnic_dev_open_done, flags);
        if (err)
                dev_err(enic_get_dev(enic),
                        "vNIC device open failed, err %d\n", err);
@@ -1174,10 +1174,22 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)
                        rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_IPV4;
                if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
                        rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV4;
+               if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) {
+                       /*
+                        * 'TCP' is not a typo. HW does not have a separate
+                        * enable bit for UDP RSS. The TCP bit enables both TCP
+                        * and UDP RSS..
+                        */
+                       rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV4;
+               }
                if (rss_hf & ETH_RSS_IPV6)
                        rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_IPV6;
                if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP)
                        rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV6;
+               if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) {
+                       /* Again, 'TCP' is not a typo. */
+                       rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV6;
+               }
                if (rss_hf & ETH_RSS_IPV6_EX)
                        rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_IPV6_EX;
                if (rss_hf & ETH_RSS_IPV6_TCP_EX)
@@ -1428,6 +1440,8 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
        /* free and reallocate RQs with the new MTU */
        for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {
                rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];
+               if (!rq->in_use)
+                       continue;
 
                enic_free_rq(rq);
                rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,