Adding script to auto build VNFs
[samplevnf.git] / patches / dpdk_custom_patch / rte_pipeline.patch
1 --- lib/librte_pipeline/rte_pipeline.c  2016-08-10 21:50:46.625571187 +0530
2 +++ lib/librte_pipeline/rte_pipeline.c  2016-08-10 21:51:02.333571628 +0530
3 @@ -1241,6 +1241,85 @@
4                 }
5  }
6
7 +void
8 +rte_pipeline_action_handler_port_ext(struct rte_pipeline *p,
9 +                                        uint64_t pkts_mask,
10 +                                        struct rte_pipeline_table_entry **entries);
11 +
12 +void
13 +rte_pipeline_action_handler_port_ext(struct rte_pipeline *p,
14 +                                        uint64_t pkts_mask,
15 +                                        struct rte_pipeline_table_entry **entries)
16 +{
17 +        p->pkts_mask = pkts_mask;
18 +
19 +        if ((pkts_mask & (pkts_mask + 1)) == 0) {
20 +                uint64_t n_pkts = __builtin_popcountll(pkts_mask);
21 +                uint32_t i;
22 +
23 +                for (i = 0; i < n_pkts; i++) {
24 +                        struct rte_mbuf *pkt = p->pkts[i];
25 +                        uint32_t port_out_id = entries[i]->port_id;
26 +                        struct rte_port_out *port_out =
27 +                                &p->ports_out[port_out_id];
28 +
29 +                        /* Output port user actions */
30 +                        if (port_out->f_action == NULL) /* Output port TX */
31 +                                port_out->ops.f_tx(port_out->h_port, pkt);
32 +                        else {
33 +                                uint64_t pkt_mask = 1LLU << i;
34 +
35 +                                port_out->f_action(p,
36 +                                        p->pkts,
37 +                                        pkt_mask,
38 +                                        port_out->arg_ah);
39 +
40 +                                RTE_PIPELINE_STATS_AH_DROP_READ(p,
41 +                                        port_out->n_pkts_dropped_by_ah);
42 +
43 +                                /* Output port TX */
44 +                                if (pkt_mask & p->pkts_mask)
45 +                                        port_out->ops.f_tx(port_out->h_port,
46 +                                                pkt);
47 +                        }
48 +                }
49 +        } else {
50 +                uint32_t i;
51 +
52 +                for (i = 0;  i < RTE_PORT_IN_BURST_SIZE_MAX; i++) {
53 +                        uint64_t pkt_mask = 1LLU << i;
54 +                        struct rte_mbuf *pkt;
55 +                        struct rte_port_out *port_out;
56 +                        uint32_t port_out_id;
57 +
58 +                        if ((pkt_mask & pkts_mask) == 0)
59 +                                continue;
60 +
61 +                        pkt = p->pkts[i];
62 +                        port_out_id = entries[i]->port_id;
63 +                        port_out = &p->ports_out[port_out_id];
64 +
65 +                        /* Output port user actions */
66 +                        if (port_out->f_action == NULL) /* Output port TX */
67 +                                port_out->ops.f_tx(port_out->h_port, pkt);
68 +                        else {
69 +                                port_out->f_action(p,
70 +                                        p->pkts,
71 +                                        pkt_mask,
72 +                                        port_out->arg_ah);
73 +
74 +                                RTE_PIPELINE_STATS_AH_DROP_READ(p,
75 +                                        port_out->n_pkts_dropped_by_ah);
76 +
77 +                                /* Output port TX */
78 +                                if (pkt_mask & p->pkts_mask)
79 +                                        port_out->ops.f_tx(port_out->h_port,
80 +                                                pkt);
81 +                        }
82 +                }
83 +        }
84 +}
85 +
86  static inline void
87  rte_pipeline_action_handler_port_meta(struct rte_pipeline *p,
88                 uint64_t pkts_mask)