net/hns3: fix return value for unsupported tuple
[dpdk.git] / drivers / net / softnic / rte_eth_softnic_thread.c
index d61846e..ec8bef4 100644 (file)
 #include "rte_eth_softnic_internals.h"
 
 /**
- * Master thread: data plane thread init
+ * Main thread: data plane thread init
  */
 void
 softnic_thread_free(struct pmd_internals *softnic)
 {
        uint32_t i;
 
-       RTE_LCORE_FOREACH_SLAVE(i) {
+       RTE_LCORE_FOREACH_WORKER(i) {
                struct softnic_thread *t = &softnic->thread[i];
 
                /* MSGQs */
-               if (t->msgq_req)
-                       rte_ring_free(t->msgq_req);
+               rte_ring_free(t->msgq_req);
 
-               if (t->msgq_rsp)
-                       rte_ring_free(t->msgq_rsp);
+               rte_ring_free(t->msgq_rsp);
        }
 }
 
@@ -78,7 +76,7 @@ softnic_thread_init(struct pmd_internals *softnic)
                        return -1;
                }
 
-               /* Master thread records */
+               /* Main thread records */
                t->msgq_req = msgq_req;
                t->msgq_rsp = msgq_rsp;
                t->service_id = UINT32_MAX;
@@ -99,7 +97,7 @@ softnic_thread_init(struct pmd_internals *softnic)
 static inline int
 thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id)
 {
-       if (thread_id == rte_get_master_lcore())
+       if (thread_id == rte_get_main_lcore())
                return 0; /* FALSE */
 
        if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE))
@@ -129,14 +127,12 @@ thread_sc_service_up(struct pmd_internals *softnic, uint32_t thread_id)
        struct softnic_thread *t = &softnic->thread[thread_id];
        struct rte_eth_dev *dev;
        int status;
-       uint16_t port_id;
 
        /* service params */
-       status = rte_eth_dev_get_port_by_name(softnic->params.name, &port_id);
-       if (status)
-               return status;
+       dev = rte_eth_dev_get_by_name(softnic->params.name);
+       if (!dev)
+               return -EINVAL;
 
-       dev = &rte_eth_devices[port_id];
        snprintf(service_params.name, sizeof(service_params.name), "%s_%u",
                softnic->params.name,
                thread_id);
@@ -209,7 +205,7 @@ pipeline_is_running(struct pipeline *p)
 }
 
 /**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
  */
 enum thread_req_type {
        THREAD_REQ_PIPELINE_ENABLE = 0,
@@ -243,7 +239,7 @@ struct thread_msg_rsp {
 };
 
 /**
- * Master thread
+ * Main thread
  */
 static struct thread_msg_req *
 thread_msg_alloc(void)
@@ -587,7 +583,7 @@ thread_msg_handle(struct softnic_thread_data *t)
 }
 
 /**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
  */
 enum pipeline_req_type {
        /* Port IN */
@@ -753,7 +749,7 @@ struct pipeline_msg_rsp {
 };
 
 /**
- * Master thread
+ * Main thread
  */
 static struct pipeline_msg_req *
 pipeline_msg_alloc(void)
@@ -835,8 +831,6 @@ softnic_pipeline_port_in_stats_read(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -884,8 +878,6 @@ softnic_pipeline_port_in_enable(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -931,8 +923,6 @@ softnic_pipeline_port_in_disable(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -986,8 +976,6 @@ softnic_pipeline_port_out_stats_read(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1043,8 +1031,6 @@ softnic_pipeline_table_stats_read(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1323,8 +1309,6 @@ softnic_pipeline_table_rule_add(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1407,8 +1391,6 @@ softnic_pipeline_table_rule_add_default(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1565,8 +1547,6 @@ fail:
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1630,8 +1610,6 @@ softnic_pipeline_table_rule_delete(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1680,8 +1658,6 @@ softnic_pipeline_table_rule_delete_default(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1740,8 +1716,6 @@ softnic_pipeline_table_rule_stats_read(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1821,10 +1795,6 @@ softnic_pipeline_table_mtr_profile_add(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL) {
-               free(mp);
-               return -1;
-       }
 
        /* Read response */
        status = rsp->status;
@@ -1880,8 +1850,6 @@ softnic_pipeline_table_mtr_profile_delete(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -1943,8 +1911,6 @@ softnic_pipeline_table_rule_mtr_read(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -2008,8 +1974,6 @@ softnic_pipeline_table_dscp_table_update(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;
@@ -2073,8 +2037,6 @@ softnic_pipeline_table_rule_ttl_read(struct pmd_internals *softnic,
 
        /* Send request and wait for response */
        rsp = pipeline_msg_send_recv(p, req);
-       if (rsp == NULL)
-               return -1;
 
        /* Read response */
        status = rsp->status;