mbuf: remove rte_ctrlmbuf
[dpdk.git] / examples / ip_pipeline / cmdline.c
index e10a0cf..a56335e 100644 (file)
@@ -345,7 +345,7 @@ cmd_link_enable_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        req->type = APP_MSG_REQ_RX_PORT_ENABLE;
        req->rx_up.port = params->port;
 
@@ -358,7 +358,7 @@ cmd_link_enable_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        /* Check response */
        if (resp->result != 0)
                printf("Request LINK_UP failed (%u)\n", resp->result);
@@ -433,7 +433,7 @@ cmd_link_disable_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        req->type = APP_MSG_REQ_RX_PORT_DISABLE;
        req->rx_down.port = params->port;
 
@@ -446,7 +446,7 @@ cmd_link_disable_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -543,7 +543,7 @@ cmd_arp_add_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        req->type = APP_MSG_REQ_ARP_ADD;
        req->arp_add.out_iface = rule.arp.key.out_iface;
        req->arp_add.nh_ip = rule.arp.key.nh_ip;
@@ -558,7 +558,7 @@ cmd_arp_add_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -672,7 +672,7 @@ cmd_arp_del_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        req->type = APP_MSG_REQ_ARP_DEL;
        req->arp_del.out_iface = rule.arp.key.out_iface;
        req->arp_del.nh_ip = rule.arp.key.nh_ip;
@@ -686,7 +686,7 @@ cmd_arp_del_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -834,7 +834,7 @@ cmd_route_add_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        req->type = APP_MSG_REQ_RT_ADD;
        req->routing_add.ip = rule.routing.key.ip;
        req->routing_add.depth = rule.routing.key.depth;
@@ -850,7 +850,7 @@ cmd_route_add_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -972,7 +972,7 @@ cmd_route_del_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        req->type = APP_MSG_REQ_RT_DEL;
        req->routing_del.ip = rule.routing.key.ip;
        req->routing_del.depth = rule.routing.key.depth;
@@ -986,7 +986,7 @@ cmd_route_del_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -1149,7 +1149,7 @@ cmd_firewall_add_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) msg->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data(msg);
        req->type = APP_MSG_REQ_FW_ADD;
        req->firewall_add.add_params.priority = rule.firewall.priority;
        req->firewall_add.add_params.field_value[1].value.u32 =
@@ -1183,7 +1183,7 @@ cmd_firewall_add_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, (void **) &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) msg->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data(msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -1347,7 +1347,7 @@ cmd_firewall_del_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) msg->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data(msg);
        memset(&req->firewall_del, 0, sizeof(req->firewall_del));
        req->type = APP_MSG_REQ_FW_DEL;
        req->firewall_del.delete_params.field_value[1].value.u32 =
@@ -1380,7 +1380,7 @@ cmd_firewall_del_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, (void **) &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) msg->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data(msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -1525,7 +1525,7 @@ cmd_flow_add_all_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        memset(req, 0, sizeof(struct app_msg_req));
 
        req->type = APP_MSG_REQ_FC_ADD_ALL;
@@ -1539,7 +1539,7 @@ cmd_flow_add_all_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -1641,7 +1641,7 @@ cmd_flow_add_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        memset(req, 0, sizeof(struct app_msg_req));
 
        req->type = APP_MSG_REQ_FC_ADD;
@@ -1663,7 +1663,7 @@ cmd_flow_add_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)
@@ -1790,7 +1790,7 @@ cmd_flow_del_parsed(
                rte_panic("Unable to allocate new message\n");
 
        /* Fill request message */
-       req = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;
+       req = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
        memset(req, 0, sizeof(struct app_msg_req));
 
        req->type = APP_MSG_REQ_FC_DEL;
@@ -1811,7 +1811,7 @@ cmd_flow_del_parsed(
        do {
                status = rte_ring_sc_dequeue(ring_resp, &msg);
        } while (status != 0);
-       resp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;
+       resp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);
 
        /* Check response */
        if (resp->result != 0)