aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/srmpls
AgeCommit message (Collapse)AuthorFilesLines
2020-12-14misc: move to new pool_foreach macrosDamjan Marion2-4/+4
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-15misc: removed executable bits from source filesRay Kinsella3-0/+0
Identified and removed executable bit from source files in the tree. find . -perm 755 -name *.[ch] -exec chmod a-x {} \; Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I00710d59fcc46ce5be5233109af4c8077daff74b
2020-03-23sr: srv6 API cleanupJakub Grajciar1-11/+3
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I3c348ad2fca8bb3d9a246af7a2aa9dc9c33f57c3 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-26sr: API cleanupJakub Grajciar2-47/+56
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I6238ec79b916c23c07c3f7e2ac8e635f5a0d6112 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-18misc: fix coverity warningsDave Barach1-1/+1
Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I402b1b06db736b2a7a242ce70ffd409c7c0a4fc2
2020-01-10sr: feature YAML files for Segment Routingpcamaril1-0/+9
Type: docs Signed-off-by: pcamaril <pcamaril@cisco.com> Change-Id: Ia35d18113e17fd2ba5310e81ca527d3569cd110e Signed-off-by: pcamaril <pcamaril@cisco.com>
2019-12-10api: multiple connections per processDave Barach1-1/+1
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-04-08fixing typosJim Thompson1-1/+1
Change-Id: I215e1e0208a073db80ec6f87695d734cf40fabe3 Signed-off-by: Jim Thompson <jim@netgate.com>
2018-10-23c11 safe string handling supportDave Barach3-11/+11
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-09-20SR-MPLS: MPLS table checks (VPP-1422)Neale Ranns1-0/+17
Change-Id: I397715ea8c1966f5ee61128f284d62d875c568e1 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-14Fix memory leak in API/CLI to create/modify SR policiesJohn Lo2-0/+4
The segment list vector built by the API/CLI is not freed after SR policy creation or modification. Change-Id: If439005481cada6c6af7cb560fe7a4381dd49384 Signed-off-by: John Lo <loj@cisco.com>
2018-08-30SR-MPLS: fixes and testsNeale Ranns1-2/+19
- the FIB path takes a vector of type fib_mpls_label_t not u32 so the untype safe vec_add did not work - write som eSR-MPLS tests - allow an MPLS tunnel to resolve through a SR BSID Change-Id: I2a18b9a9bf43584100ac269c4ebc286c9e3b3ea5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-08-29SR-mpls: do not pass empty label stack to fibNeale Ranns1-10/+11
Change-Id: Ib1601d01a54296e72be3bbfa057fce965549b02b Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-29Coverity fixes (VPP-1204)Chris Luke2-12/+10
Minor bug fixes CID 183000: double close CID 180996: dead code CID 180995: NULL deref CID 181957: NULL deref CID 182676: NULL deref CID 182675: NULL deref Change-Id: Id35e391c95fafb8cd771984ee8a1a6e597056d37 Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-03-09MPLS Unifom modeNeale Ranns2-6/+15
- support both pipe and uniform modes for all MPLS LSP - all API programming for output-labels requires that the mode (and associated data) is specificed - API changes in MPLS, BIER and IP are involved - new DPO [sub] types for MPLS labels to handle the two modes. Change-Id: I87b76401e996f10dfbdbe4552ff6b19af958783c Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan1-2/+3
This is a version of the VPP API generator in Python PLY. It supports the existing language, and has a plugin architecture for generators. Currently C and JSON are supported. Changes: - vl_api_version to option version = "major.minor.patch" - enum support - Added error checking and reporting - import support (removed the C pre-processor) - services (tying request/reply together) Version: option version = "1.0.0"; Enum: enum colours { RED, BLUE = 50, }; define foo { vl_api_colours_t colours; }; Services: service { rpc foo returns foo_reply; rpc foo_dump returns stream foo_details; rpc want_stats returns want_stats_reply events ip4_counters, ip6_counters; }; Future planned features: - unions - bool, text - array support (including length) - proto3 output plugin - Refactor C/C++ generator as a plugin - Refactor Java generator as a plugin Change-Id: Ifa289966c790e1b1a8e2938a91e69331e3a58bdf Signed-off-by: Ole Troan <ot@cisco.com>
2018-01-09VPP-1113 SR MPLS path.frp_label_stackPablo Camarillo1-17/+16
provide one label stack per fib_table_entry_path_add2 call. otherwise multiple mheap releases take place. Change-Id: I475ca1b801fc85dddda0b540c69ad628a274df7f Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2017-12-18SR-MPLS: binary API and automated steeringPablo Camarillo7-484/+1658
Change-Id: Iacfbaaa91ea8bd92790dec9fce567063bdbc5d64 Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2017-08-08L2 over MPLSNeale Ranns2-4/+4
[support for VPWS/VPLS] - switch to using dpo_proto_t rather than fib_protocol_t in fib_paths so that we can describe L2 paths - VLIB nodes to handle pop/push of MPLS labels to L2 Change-Id: Id050d06a11fd2c9c1c81ce5a0654e6c5ae6afa6e Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-05-05First commit SR MPLSPablo Camarillo5-0/+1283
Change-Id: I961685a2a0e4c314049444c64eb6ccf877c278dd Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
; void (*flush_data) (transport_connection_t *tconn); int (*custom_tx) (void *session, u32 max_burst_size); int (*app_rx_evt) (transport_connection_t *tconn); /* * Connection retrieval */ transport_connection_t *(*get_connection) (u32 conn_idx, u32 thread_idx); transport_connection_t *(*get_listener) (u32 conn_index); transport_connection_t *(*get_half_open) (u32 conn_index); /* * Format */ u8 *(*format_connection) (u8 * s, va_list * args); u8 *(*format_listener) (u8 * s, va_list * args); u8 *(*format_half_open) (u8 * s, va_list * args); /* * Properties retrieval */ void (*get_transport_endpoint) (u32 conn_index, u32 thread_index, transport_endpoint_t *tep, u8 is_lcl); void (*get_transport_listener_endpoint) (u32 conn_index, transport_endpoint_t *tep, u8 is_lcl); /* * Properties */ transport_options_t transport_options; } transport_proto_vft_t; /* *INDENT-ON* */ extern transport_proto_vft_t *tp_vfts; #define transport_proto_foreach(VAR, BODY) \ do { \ for (VAR = 0; VAR < vec_len (tp_vfts); VAR++) \ if (tp_vfts[VAR].push_header != 0) \ do { BODY; } while (0); \ } while (0) int transport_connect (transport_proto_t tp, transport_endpoint_cfg_t * tep); void transport_close (transport_proto_t tp, u32 conn_index, u8 thread_index); void transport_reset (transport_proto_t tp, u32 conn_index, u8 thread_index); u32 transport_start_listen (transport_proto_t tp, u32 session_index, transport_endpoint_t * tep); u32 transport_stop_listen (transport_proto_t tp, u32 conn_index); void transport_cleanup (transport_proto_t tp, u32 conn_index, u8 thread_index); void transport_get_endpoint (transport_proto_t tp, u32 conn_index, u32 thread_index, transport_endpoint_t * tep, u8 is_lcl); void transport_get_listener_endpoint (transport_proto_t tp, u32 conn_index, transport_endpoint_t * tep, u8 is_lcl); static inline transport_connection_t * transport_get_connection (transport_proto_t tp, u32 conn_index, u8 thread_index) { return tp_vfts[tp].get_connection (conn_index, thread_index); } static inline transport_connection_t * transport_get_listener (transport_proto_t tp, u32 conn_index) { return tp_vfts[tp].get_listener (conn_index); } static inline transport_connection_t * transport_get_half_open (transport_proto_t tp, u32 conn_index) { return tp_vfts[tp].get_half_open (conn_index); } static inline int transport_custom_tx (transport_proto_t tp, void *s, u32 max_burst_size) { return tp_vfts[tp].custom_tx (s, max_burst_size); } static inline int transport_app_rx_evt (transport_proto_t tp, u32 conn_index, u32 thread_index) { transport_connection_t *tc; if (!tp_vfts[tp].app_rx_evt) return 0; tc = transport_get_connection (tp, conn_index, thread_index); return tp_vfts[tp].app_rx_evt (tc); } void transport_register_protocol (transport_proto_t transport_proto, const transport_proto_vft_t * vft, fib_protocol_t fib_proto, u32 output_node); transport_proto_vft_t *transport_protocol_get_vft (transport_proto_t tp); void transport_update_time (f64 time_now, u8 thread_index); int transport_alloc_local_port (u8 proto, ip46_address_t * ip); int transport_alloc_local_endpoint (u8 proto, transport_endpoint_cfg_t * rmt, ip46_address_t * lcl_addr, u16 * lcl_port); void transport_endpoint_cleanup (u8 proto, ip46_address_t * lcl_ip, u16 port); void transport_enable_disable (vlib_main_t * vm, u8 is_en); void transport_init (void); always_inline u32 transport_elog_track_index (transport_connection_t * tc) { #if TRANSPORT_DEBUG return tc->elog_track.track_index_plus_one - 1; #else return ~0; #endif } void transport_connection_tx_pacer_reset (transport_connection_t * tc, u32 rate_bytes_per_sec, u32 initial_bucket, u64 time_now); /** * Initialize tx pacer for connection * * @param tc transport connection * @param rate_bytes_per_second initial byte rate * @param burst_bytes initial burst size in bytes */ void transport_connection_tx_pacer_init (transport_connection_t * tc, u32 rate_bytes_per_sec, u32 initial_bucket); /** * Update tx pacer pacing rate * * @param tc transport connection * @param bytes_per_sec new pacing rate */ void transport_connection_tx_pacer_update (transport_connection_t * tc, u64 bytes_per_sec); /** * Get maximum tx burst allowed for transport connection * * @param tc transport connection * @param time_now current cpu time as returned by @ref clib_cpu_time_now * @param mss transport's mss */ u32 transport_connection_snd_space (transport_connection_t * tc, u64 time_now, u16 mss); /** * Get tx pacer max burst * * @param tc transport connection * @param time_now current cpu time * @return max burst for connection */ u32 transport_connection_tx_pacer_burst (transport_connection_t * tc, u64 time_now); /** * Get tx pacer current rate * * @param tc transport connection * @return rate for connection in bytes/s */ u64 transport_connection_tx_pacer_rate (transport_connection_t * tc); /** * Initialize period for tx pacers * * Defines a unit of time with respect to number of cpu cycles that is to * be used by all tx pacers. */ void transport_init_tx_pacers_period (void); /** * Check if transport connection is paced */ always_inline u8 transport_connection_is_tx_paced (transport_connection_t * tc) { return (tc->flags & TRANSPORT_CONNECTION_F_IS_TX_PACED); } u8 *format_transport_pacer (u8 * s, va_list * args); /** * Update tx bytes for paced transport connection * * If tx pacing is enabled, this update pacer bucket to account for the * amount of bytes that have been sent. * * @param tc transport connection * @param bytes bytes recently sent */ void transport_connection_update_tx_bytes (transport_connection_t * tc, u32 bytes); void transport_connection_tx_pacer_update_bytes (transport_connection_t * tc, u32 bytes); #endif /* SRC_VNET_SESSION_TRANSPORT_H_ */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */