427c72b1d2662ddb2ef98630d82c8751ee5ab62f
[dpdk.git] / examples / l3fwd / l3fwd_lpm.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2016 Intel Corporation
3  */
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <stdint.h>
8 #include <inttypes.h>
9 #include <sys/types.h>
10 #include <string.h>
11 #include <sys/queue.h>
12 #include <stdarg.h>
13 #include <errno.h>
14 #include <getopt.h>
15 #include <stdbool.h>
16 #include <sys/socket.h>
17 #include <arpa/inet.h>
18
19 #include <rte_debug.h>
20 #include <rte_ether.h>
21 #include <rte_ethdev.h>
22 #include <rte_cycles.h>
23 #include <rte_mbuf.h>
24 #include <rte_ip.h>
25 #include <rte_tcp.h>
26 #include <rte_udp.h>
27 #include <rte_lpm.h>
28 #include <rte_lpm6.h>
29
30 #include "l3fwd.h"
31 #include "l3fwd_event.h"
32
33 #include "l3fwd_route.h"
34
35 #define IPV4_L3FWD_LPM_MAX_RULES         1024
36 #define IPV4_L3FWD_LPM_NUMBER_TBL8S (1 << 8)
37 #define IPV6_L3FWD_LPM_MAX_RULES         1024
38 #define IPV6_L3FWD_LPM_NUMBER_TBL8S (1 << 16)
39
40 static struct rte_lpm *ipv4_l3fwd_lpm_lookup_struct[NB_SOCKETS];
41 static struct rte_lpm6 *ipv6_l3fwd_lpm_lookup_struct[NB_SOCKETS];
42
43 static inline uint16_t
44 lpm_get_ipv4_dst_port(const struct rte_ipv4_hdr *ipv4_hdr,
45                       uint16_t portid,
46                       struct rte_lpm *ipv4_l3fwd_lookup_struct)
47 {
48         uint32_t dst_ip = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
49         uint32_t next_hop;
50
51         if (rte_lpm_lookup(ipv4_l3fwd_lookup_struct, dst_ip, &next_hop) == 0)
52                 return next_hop;
53         else
54                 return portid;
55 }
56
57 static inline uint16_t
58 lpm_get_ipv6_dst_port(const struct rte_ipv6_hdr *ipv6_hdr,
59                       uint16_t portid,
60                       struct rte_lpm6 *ipv6_l3fwd_lookup_struct)
61 {
62         const uint8_t *dst_ip = ipv6_hdr->dst_addr;
63         uint32_t next_hop;
64
65         if (rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, dst_ip, &next_hop) == 0)
66                 return next_hop;
67         else
68                 return portid;
69 }
70
71 static __rte_always_inline uint16_t
72 lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
73                 uint16_t portid)
74 {
75         struct rte_ipv6_hdr *ipv6_hdr;
76         struct rte_ipv4_hdr *ipv4_hdr;
77         struct rte_ether_hdr *eth_hdr;
78
79         if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
80
81                 eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
82                 ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
83
84                 return lpm_get_ipv4_dst_port(ipv4_hdr, portid,
85                                              qconf->ipv4_lookup_struct);
86         } else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
87
88                 eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
89                 ipv6_hdr = (struct rte_ipv6_hdr *)(eth_hdr + 1);
90
91                 return lpm_get_ipv6_dst_port(ipv6_hdr, portid,
92                                              qconf->ipv6_lookup_struct);
93         }
94
95         return portid;
96 }
97
98 /*
99  * lpm_get_dst_port optimized routine for packets where dst_ipv4 is already
100  * precalculated. If packet is ipv6 dst_addr is taken directly from packet
101  * header and dst_ipv4 value is not used.
102  */
103 static __rte_always_inline uint16_t
104 lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
105         uint32_t dst_ipv4, uint16_t portid)
106 {
107         uint32_t next_hop;
108         struct rte_ipv6_hdr *ipv6_hdr;
109         struct rte_ether_hdr *eth_hdr;
110
111         if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
112                 return (uint16_t) ((rte_lpm_lookup(qconf->ipv4_lookup_struct,
113                                                    dst_ipv4, &next_hop) == 0)
114                                    ? next_hop : portid);
115
116         } else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
117
118                 eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
119                 ipv6_hdr = (struct rte_ipv6_hdr *)(eth_hdr + 1);
120
121                 return (uint16_t) ((rte_lpm6_lookup(qconf->ipv6_lookup_struct,
122                                 ipv6_hdr->dst_addr, &next_hop) == 0)
123                                 ? next_hop : portid);
124
125         }
126
127         return portid;
128 }
129
130 #if defined(RTE_ARCH_X86)
131 #include "l3fwd_lpm_sse.h"
132 #elif defined __ARM_NEON
133 #include "l3fwd_lpm_neon.h"
134 #elif defined(RTE_ARCH_PPC_64)
135 #include "l3fwd_lpm_altivec.h"
136 #else
137 #include "l3fwd_lpm.h"
138 #endif
139
140 /* main processing loop */
141 int
142 lpm_main_loop(__rte_unused void *dummy)
143 {
144         struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
145         unsigned lcore_id;
146         uint64_t prev_tsc, diff_tsc, cur_tsc;
147         int i, nb_rx;
148         uint16_t portid;
149         uint8_t queueid;
150         struct lcore_conf *qconf;
151         const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
152                 US_PER_S * BURST_TX_DRAIN_US;
153
154         lcore_id = rte_lcore_id();
155         qconf = &lcore_conf[lcore_id];
156
157         if (qconf->n_rx_queue == 0) {
158                 RTE_LOG(INFO, L3FWD, "lcore %u has nothing to do\n", lcore_id);
159                 return 0;
160         }
161
162         RTE_LOG(INFO, L3FWD, "entering main loop on lcore %u\n", lcore_id);
163
164         for (i = 0; i < qconf->n_rx_queue; i++) {
165
166                 portid = qconf->rx_queue_list[i].port_id;
167                 queueid = qconf->rx_queue_list[i].queue_id;
168                 RTE_LOG(INFO, L3FWD,
169                         " -- lcoreid=%u portid=%u rxqueueid=%hhu\n",
170                         lcore_id, portid, queueid);
171         }
172
173         cur_tsc = rte_rdtsc();
174         prev_tsc = cur_tsc;
175
176         while (!force_quit) {
177
178                 /*
179                  * TX burst queue drain
180                  */
181                 diff_tsc = cur_tsc - prev_tsc;
182                 if (unlikely(diff_tsc > drain_tsc)) {
183
184                         for (i = 0; i < qconf->n_tx_port; ++i) {
185                                 portid = qconf->tx_port_id[i];
186                                 if (qconf->tx_mbufs[portid].len == 0)
187                                         continue;
188                                 send_burst(qconf,
189                                         qconf->tx_mbufs[portid].len,
190                                         portid);
191                                 qconf->tx_mbufs[portid].len = 0;
192                         }
193
194                         prev_tsc = cur_tsc;
195                 }
196
197                 /*
198                  * Read packet from RX queues
199                  */
200                 for (i = 0; i < qconf->n_rx_queue; ++i) {
201                         portid = qconf->rx_queue_list[i].port_id;
202                         queueid = qconf->rx_queue_list[i].queue_id;
203                         nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst,
204                                 MAX_PKT_BURST);
205                         if (nb_rx == 0)
206                                 continue;
207
208 #if defined RTE_ARCH_X86 || defined __ARM_NEON \
209                          || defined RTE_ARCH_PPC_64
210                         l3fwd_lpm_send_packets(nb_rx, pkts_burst,
211                                                 portid, qconf);
212 #else
213                         l3fwd_lpm_no_opt_send_packets(nb_rx, pkts_burst,
214                                                         portid, qconf);
215 #endif /* X86 */
216                 }
217
218                 cur_tsc = rte_rdtsc();
219         }
220
221         return 0;
222 }
223
224 static __rte_always_inline uint16_t
225 lpm_process_event_pkt(const struct lcore_conf *lconf, struct rte_mbuf *mbuf)
226 {
227         mbuf->port = lpm_get_dst_port(lconf, mbuf, mbuf->port);
228
229 #if defined RTE_ARCH_X86 || defined __ARM_NEON \
230         || defined RTE_ARCH_PPC_64
231         process_packet(mbuf, &mbuf->port);
232 #else
233
234         struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf,
235                         struct rte_ether_hdr *);
236 #ifdef DO_RFC_1812_CHECKS
237         struct rte_ipv4_hdr *ipv4_hdr;
238         if (RTE_ETH_IS_IPV4_HDR(mbuf->packet_type)) {
239                 /* Handle IPv4 headers.*/
240                 ipv4_hdr = rte_pktmbuf_mtod_offset(mbuf,
241                                 struct rte_ipv4_hdr *,
242                                 sizeof(struct rte_ether_hdr));
243
244                 if (is_valid_ipv4_pkt(ipv4_hdr, mbuf->pkt_len)
245                                 < 0) {
246                         mbuf->port = BAD_PORT;
247                         continue;
248                 }
249                 /* Update time to live and header checksum */
250                 --(ipv4_hdr->time_to_live);
251                 ++(ipv4_hdr->hdr_checksum);
252         }
253 #endif
254         /* dst addr */
255         *(uint64_t *)&eth_hdr->d_addr = dest_eth_addr[mbuf->port];
256
257         /* src addr */
258         rte_ether_addr_copy(&ports_eth_addr[mbuf->port],
259                         &eth_hdr->s_addr);
260 #endif
261         return mbuf->port;
262 }
263
264 static __rte_always_inline void
265 lpm_event_loop_single(struct l3fwd_event_resources *evt_rsrc,
266                 const uint8_t flags)
267 {
268         const int event_p_id = l3fwd_get_free_event_port(evt_rsrc);
269         const uint8_t tx_q_id = evt_rsrc->evq.event_q_id[
270                 evt_rsrc->evq.nb_queues - 1];
271         const uint8_t event_d_id = evt_rsrc->event_d_id;
272         struct lcore_conf *lconf;
273         unsigned int lcore_id;
274         struct rte_event ev;
275
276         if (event_p_id < 0)
277                 return;
278
279         lcore_id = rte_lcore_id();
280         lconf = &lcore_conf[lcore_id];
281
282         RTE_LOG(INFO, L3FWD, "entering %s on lcore %u\n", __func__, lcore_id);
283         while (!force_quit) {
284                 if (!rte_event_dequeue_burst(event_d_id, event_p_id, &ev, 1, 0))
285                         continue;
286
287                 if (lpm_process_event_pkt(lconf, ev.mbuf) == BAD_PORT) {
288                         rte_pktmbuf_free(ev.mbuf);
289                         continue;
290                 }
291
292                 if (flags & L3FWD_EVENT_TX_ENQ) {
293                         ev.queue_id = tx_q_id;
294                         ev.op = RTE_EVENT_OP_FORWARD;
295                         while (rte_event_enqueue_burst(event_d_id, event_p_id,
296                                                 &ev, 1) && !force_quit)
297                                 ;
298                 }
299
300                 if (flags & L3FWD_EVENT_TX_DIRECT) {
301                         rte_event_eth_tx_adapter_txq_set(ev.mbuf, 0);
302                         while (!rte_event_eth_tx_adapter_enqueue(event_d_id,
303                                                 event_p_id, &ev, 1, 0) &&
304                                         !force_quit)
305                                 ;
306                 }
307         }
308 }
309
310 static __rte_always_inline void
311 lpm_event_loop_burst(struct l3fwd_event_resources *evt_rsrc,
312                 const uint8_t flags)
313 {
314         const int event_p_id = l3fwd_get_free_event_port(evt_rsrc);
315         const uint8_t tx_q_id = evt_rsrc->evq.event_q_id[
316                 evt_rsrc->evq.nb_queues - 1];
317         const uint8_t event_d_id = evt_rsrc->event_d_id;
318         const uint16_t deq_len = evt_rsrc->deq_depth;
319         struct rte_event events[MAX_PKT_BURST];
320         struct lcore_conf *lconf;
321         unsigned int lcore_id;
322         int i, nb_enq, nb_deq;
323
324         if (event_p_id < 0)
325                 return;
326
327         lcore_id = rte_lcore_id();
328
329         lconf = &lcore_conf[lcore_id];
330
331         RTE_LOG(INFO, L3FWD, "entering %s on lcore %u\n", __func__, lcore_id);
332
333         while (!force_quit) {
334                 /* Read events from RX queues */
335                 nb_deq = rte_event_dequeue_burst(event_d_id, event_p_id,
336                                 events, deq_len, 0);
337                 if (nb_deq == 0) {
338                         rte_pause();
339                         continue;
340                 }
341
342                 for (i = 0; i < nb_deq; i++) {
343                         if (flags & L3FWD_EVENT_TX_ENQ) {
344                                 events[i].queue_id = tx_q_id;
345                                 events[i].op = RTE_EVENT_OP_FORWARD;
346                         }
347
348                         if (flags & L3FWD_EVENT_TX_DIRECT)
349                                 rte_event_eth_tx_adapter_txq_set(events[i].mbuf,
350                                                                  0);
351
352                         lpm_process_event_pkt(lconf, events[i].mbuf);
353                 }
354
355                 if (flags & L3FWD_EVENT_TX_ENQ) {
356                         nb_enq = rte_event_enqueue_burst(event_d_id, event_p_id,
357                                         events, nb_deq);
358                         while (nb_enq < nb_deq && !force_quit)
359                                 nb_enq += rte_event_enqueue_burst(event_d_id,
360                                                 event_p_id, events + nb_enq,
361                                                 nb_deq - nb_enq);
362                 }
363
364                 if (flags & L3FWD_EVENT_TX_DIRECT) {
365                         nb_enq = rte_event_eth_tx_adapter_enqueue(event_d_id,
366                                         event_p_id, events, nb_deq, 0);
367                         while (nb_enq < nb_deq && !force_quit)
368                                 nb_enq += rte_event_eth_tx_adapter_enqueue(
369                                                 event_d_id, event_p_id,
370                                                 events + nb_enq,
371                                                 nb_deq - nb_enq, 0);
372                 }
373         }
374 }
375
376 static __rte_always_inline void
377 lpm_event_loop(struct l3fwd_event_resources *evt_rsrc,
378                  const uint8_t flags)
379 {
380         if (flags & L3FWD_EVENT_SINGLE)
381                 lpm_event_loop_single(evt_rsrc, flags);
382         if (flags & L3FWD_EVENT_BURST)
383                 lpm_event_loop_burst(evt_rsrc, flags);
384 }
385
386 int __rte_noinline
387 lpm_event_main_loop_tx_d(__rte_unused void *dummy)
388 {
389         struct l3fwd_event_resources *evt_rsrc =
390                                         l3fwd_get_eventdev_rsrc();
391
392         lpm_event_loop(evt_rsrc, L3FWD_EVENT_TX_DIRECT | L3FWD_EVENT_SINGLE);
393         return 0;
394 }
395
396 int __rte_noinline
397 lpm_event_main_loop_tx_d_burst(__rte_unused void *dummy)
398 {
399         struct l3fwd_event_resources *evt_rsrc =
400                                         l3fwd_get_eventdev_rsrc();
401
402         lpm_event_loop(evt_rsrc, L3FWD_EVENT_TX_DIRECT | L3FWD_EVENT_BURST);
403         return 0;
404 }
405
406 int __rte_noinline
407 lpm_event_main_loop_tx_q(__rte_unused void *dummy)
408 {
409         struct l3fwd_event_resources *evt_rsrc =
410                                         l3fwd_get_eventdev_rsrc();
411
412         lpm_event_loop(evt_rsrc, L3FWD_EVENT_TX_ENQ | L3FWD_EVENT_SINGLE);
413         return 0;
414 }
415
416 int __rte_noinline
417 lpm_event_main_loop_tx_q_burst(__rte_unused void *dummy)
418 {
419         struct l3fwd_event_resources *evt_rsrc =
420                                         l3fwd_get_eventdev_rsrc();
421
422         lpm_event_loop(evt_rsrc, L3FWD_EVENT_TX_ENQ | L3FWD_EVENT_BURST);
423         return 0;
424 }
425
426 void
427 setup_lpm(const int socketid)
428 {
429         struct rte_lpm6_config config;
430         struct rte_lpm_config config_ipv4;
431         unsigned i;
432         int ret;
433         char s[64];
434         char abuf[INET6_ADDRSTRLEN];
435
436         /* create the LPM table */
437         config_ipv4.max_rules = IPV4_L3FWD_LPM_MAX_RULES;
438         config_ipv4.number_tbl8s = IPV4_L3FWD_LPM_NUMBER_TBL8S;
439         config_ipv4.flags = 0;
440         snprintf(s, sizeof(s), "IPV4_L3FWD_LPM_%d", socketid);
441         ipv4_l3fwd_lpm_lookup_struct[socketid] =
442                         rte_lpm_create(s, socketid, &config_ipv4);
443         if (ipv4_l3fwd_lpm_lookup_struct[socketid] == NULL)
444                 rte_exit(EXIT_FAILURE,
445                         "Unable to create the l3fwd LPM table on socket %d\n",
446                         socketid);
447
448         /* populate the LPM table */
449         for (i = 0; i < RTE_DIM(ipv4_l3fwd_route_array); i++) {
450                 struct in_addr in;
451
452                 /* skip unused ports */
453                 if ((1 << ipv4_l3fwd_route_array[i].if_out &
454                                 enabled_port_mask) == 0)
455                         continue;
456
457                 ret = rte_lpm_add(ipv4_l3fwd_lpm_lookup_struct[socketid],
458                         ipv4_l3fwd_route_array[i].ip,
459                         ipv4_l3fwd_route_array[i].depth,
460                         ipv4_l3fwd_route_array[i].if_out);
461
462                 if (ret < 0) {
463                         rte_exit(EXIT_FAILURE,
464                                 "Unable to add entry %u to the l3fwd LPM table on socket %d\n",
465                                 i, socketid);
466                 }
467
468                 in.s_addr = htonl(ipv4_l3fwd_route_array[i].ip);
469                 printf("LPM: Adding route %s / %d (%d)\n",
470                        inet_ntop(AF_INET, &in, abuf, sizeof(abuf)),
471                         ipv4_l3fwd_route_array[i].depth,
472                         ipv4_l3fwd_route_array[i].if_out);
473         }
474
475         /* create the LPM6 table */
476         snprintf(s, sizeof(s), "IPV6_L3FWD_LPM_%d", socketid);
477
478         config.max_rules = IPV6_L3FWD_LPM_MAX_RULES;
479         config.number_tbl8s = IPV6_L3FWD_LPM_NUMBER_TBL8S;
480         config.flags = 0;
481         ipv6_l3fwd_lpm_lookup_struct[socketid] = rte_lpm6_create(s, socketid,
482                                 &config);
483         if (ipv6_l3fwd_lpm_lookup_struct[socketid] == NULL)
484                 rte_exit(EXIT_FAILURE,
485                         "Unable to create the l3fwd LPM table on socket %d\n",
486                         socketid);
487
488         /* populate the LPM table */
489         for (i = 0; i < RTE_DIM(ipv6_l3fwd_route_array); i++) {
490
491                 /* skip unused ports */
492                 if ((1 << ipv6_l3fwd_route_array[i].if_out &
493                                 enabled_port_mask) == 0)
494                         continue;
495
496                 ret = rte_lpm6_add(ipv6_l3fwd_lpm_lookup_struct[socketid],
497                         ipv6_l3fwd_route_array[i].ip,
498                         ipv6_l3fwd_route_array[i].depth,
499                         ipv6_l3fwd_route_array[i].if_out);
500
501                 if (ret < 0) {
502                         rte_exit(EXIT_FAILURE,
503                                 "Unable to add entry %u to the l3fwd LPM table on socket %d\n",
504                                 i, socketid);
505                 }
506
507                 printf("LPM: Adding route %s / %d (%d)\n",
508                        inet_ntop(AF_INET6, ipv6_l3fwd_route_array[i].ip,
509                                  abuf, sizeof(abuf)),
510                        ipv6_l3fwd_route_array[i].depth,
511                        ipv6_l3fwd_route_array[i].if_out);
512         }
513 }
514
515 int
516 lpm_check_ptype(int portid)
517 {
518         int i, ret;
519         int ptype_l3_ipv4 = 0, ptype_l3_ipv6 = 0;
520         uint32_t ptype_mask = RTE_PTYPE_L3_MASK;
521
522         ret = rte_eth_dev_get_supported_ptypes(portid, ptype_mask, NULL, 0);
523         if (ret <= 0)
524                 return 0;
525
526         uint32_t ptypes[ret];
527
528         ret = rte_eth_dev_get_supported_ptypes(portid, ptype_mask, ptypes, ret);
529         for (i = 0; i < ret; ++i) {
530                 if (ptypes[i] & RTE_PTYPE_L3_IPV4)
531                         ptype_l3_ipv4 = 1;
532                 if (ptypes[i] & RTE_PTYPE_L3_IPV6)
533                         ptype_l3_ipv6 = 1;
534         }
535
536         if (ptype_l3_ipv4 == 0)
537                 printf("port %d cannot parse RTE_PTYPE_L3_IPV4\n", portid);
538
539         if (ptype_l3_ipv6 == 0)
540                 printf("port %d cannot parse RTE_PTYPE_L3_IPV6\n", portid);
541
542         if (ptype_l3_ipv4 && ptype_l3_ipv6)
543                 return 1;
544
545         return 0;
546
547 }
548
549 static inline void
550 lpm_parse_ptype(struct rte_mbuf *m)
551 {
552         struct rte_ether_hdr *eth_hdr;
553         uint32_t packet_type = RTE_PTYPE_UNKNOWN;
554         uint16_t ether_type;
555
556         eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
557         ether_type = eth_hdr->ether_type;
558         if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4))
559                 packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
560         else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6))
561                 packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
562
563         m->packet_type = packet_type;
564 }
565
566 uint16_t
567 lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused,
568                    struct rte_mbuf *pkts[], uint16_t nb_pkts,
569                    uint16_t max_pkts __rte_unused,
570                    void *user_param __rte_unused)
571 {
572         unsigned int i;
573
574         if (unlikely(nb_pkts == 0))
575                 return nb_pkts;
576         rte_prefetch0(rte_pktmbuf_mtod(pkts[0], struct ether_hdr *));
577         for (i = 0; i < (unsigned int) (nb_pkts - 1); ++i) {
578                 rte_prefetch0(rte_pktmbuf_mtod(pkts[i+1],
579                         struct ether_hdr *));
580                 lpm_parse_ptype(pkts[i]);
581         }
582         lpm_parse_ptype(pkts[i]);
583
584         return nb_pkts;
585 }
586
587 /* Return ipv4/ipv6 lpm fwd lookup struct. */
588 void *
589 lpm_get_ipv4_l3fwd_lookup_struct(const int socketid)
590 {
591         return ipv4_l3fwd_lpm_lookup_struct[socketid];
592 }
593
594 void *
595 lpm_get_ipv6_l3fwd_lookup_struct(const int socketid)
596 {
597         return ipv6_l3fwd_lpm_lookup_struct[socketid];
598 }