lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2024

  • 1 participants
  • 1559 discussions
[M] Change in osmo-e1d[master]: Add new protocol command and events for Sa bits and line states
by laforge 19 Jan '24

19 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35557?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Add new protocol command and events for Sa bits and line states ...................................................................... Add new protocol command and events for Sa bits and line states Change-Id: I4c20ec19fa3d9cce82c8199b38d173aa272fb07d --- M include/osmocom/e1d/proto.h M src/proto.c 2 files changed, 51 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved tnt: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/e1d/proto.h b/include/osmocom/e1d/proto.h index 005da61..6481b62 100644 --- a/include/osmocom/e1d/proto.h +++ b/include/osmocom/e1d/proto.h @@ -56,6 +56,38 @@ * + message with the file descriptor */ E1DP_CMD_TS_OPEN = 0x04, + /*! Send Sa bits to line. + * filter: intf (required), line (required), ts n/a; in: uint8_t; */ + E1DP_CMD_SABITS = 0x05, + + /*! Received signal loss from interface. */ + E1DP_EVT_LOS_ON = 0x40, + + /*! Ceased signal loss from interface. */ + E1DP_EVT_LOS_OFF = 0x41, + + /*! Received alarm indication signal from interface. */ + E1DP_EVT_AIS_ON = 0x42, + + /*! Ceased alarm indication signal from interface. */ + E1DP_EVT_AIS_OFF = 0x43, + + /*! Received remote alarm indication from interface. */ + E1DP_EVT_RAI_ON = 0x44, + + /*! Ceased remote alarm indication from interface. */ + E1DP_EVT_RAI_OFF = 0x45, + + /*! Received frame loss from interface. */ + E1DP_EVT_LOF_ON = 0x46, + + /*! Ceased frame loss from interface. */ + E1DP_EVT_LOF_OFF = 0x47, + + /*! Received Sa bits from interface. + * out: uint8_t; */ + E1DP_EVT_SABITS = 0x7f, + /*! Message is an event */ E1DP_EVT_TYPE = 0x40, /*! Message is a response */ diff --git a/src/proto.c b/src/proto.c index 479175a..b7e50bc 100644 --- a/src/proto.c +++ b/src/proto.c @@ -41,7 +41,16 @@ { E1DP_CMD_LINE_QUERY, "CMD_LINE_QUERY" }, { E1DP_CMD_TS_QUERY, "CMD_TS_QUERY" }, { E1DP_CMD_TS_OPEN, "CMD_TS_OPEN" }, - { E1DP_EVT_TYPE, "EVT_TYPE" }, + { E1DP_CMD_SABITS, "CMD_SABITS" }, + { E1DP_EVT_LOS_ON, "EVT_LOS_ON" }, + { E1DP_EVT_LOS_OFF, "EVT_LOS_OFF" }, + { E1DP_EVT_AIS_ON, "EVT_AIS_ON" }, + { E1DP_EVT_AIS_OFF, "EVT_AIS_OFF" }, + { E1DP_EVT_RAI_ON, "EVT_RAI_ON" }, + { E1DP_EVT_RAI_OFF, "EVT_RAI_OFF" }, + { E1DP_EVT_LOF_ON, "EVT_LOF_ON" }, + { E1DP_EVT_LOF_OFF, "EVT_LOF_OFF" }, + { E1DP_EVT_SABITS, "EVT_SABITS" }, { E1DP_RESP_TYPE, "RESP_TYPE" }, { E1DP_ERR_TYPE, "ERR_TYPE" }, { 0, NULL } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35557?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I4c20ec19fa3d9cce82c8199b38d173aa272fb07d Gerrit-Change-Number: 35557 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-e1d[master]: Add functions for events from server to client
by laforge 19 Jan '24

19 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35558?usp=email ) ( 4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Add functions for events from server to client ...................................................................... Add functions for events from server to client The client may register a callback function to receive events. Because there is no relation between the connected client and the interface, all events are broadcasted to all clients that are connected to the server. Change-Id: I5ee3268f8349b611c3cf3fa0572dc5eab280ab2e --- M include/osmocom/e1d/proto_clnt.h M include/osmocom/e1d/proto_srv.h M src/e1d.h M src/osmo-e1d.c M src/osmo-e1gen.c M src/proto_clnt.c M src/proto_srv.c 7 files changed, 76 insertions(+), 2 deletions(-) Approvals: tnt: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/e1d/proto_clnt.h b/include/osmocom/e1d/proto_clnt.h index 53ccf89..26bd44e 100644 --- a/include/osmocom/e1d/proto_clnt.h +++ b/include/osmocom/e1d/proto_clnt.h @@ -49,3 +49,5 @@ int osmo_e1dp_client_ts_open_force(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t ts, enum osmo_e1dp_ts_mode mode, uint16_t read_bufsize); +void osmo_e1dp_client_event_register(struct osmo_e1dp_client *clnt, + void (*cb)(enum osmo_e1dp_msg_type event, uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len)); diff --git a/include/osmocom/e1d/proto_srv.h b/include/osmocom/e1d/proto_srv.h index e794725..f95ae13 100644 --- a/include/osmocom/e1d/proto_srv.h +++ b/include/osmocom/e1d/proto_srv.h @@ -46,3 +46,5 @@ struct osmo_e1dp_server *osmo_e1dp_server_create(void *ctx, const char *path, struct osmo_e1dp_server_handler *handlers, void *handler_data); void osmo_e1dp_server_destroy(struct osmo_e1dp_server *srv); +void osmo_e1dp_server_event(struct osmo_e1dp_server *srv, enum osmo_e1dp_msg_type event, + uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len); diff --git a/src/e1d.h b/src/e1d.h index 45ecb82..3188cfc 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -193,9 +193,12 @@ struct llist_head lines; }; +struct osmo_e1dp_server; + struct e1_daemon { void *ctx; struct llist_head interfaces; + struct osmo_e1dp_server *srv; }; extern const struct octoi_ops e1d_octoi_ops; diff --git a/src/osmo-e1d.c b/src/osmo-e1d.c index dc264d9..329f584 100644 --- a/src/osmo-e1d.c +++ b/src/osmo-e1d.c @@ -44,8 +44,8 @@ #include <osmocom/vty/misc.h> #include <osmocom/vty/cpu_sched_vty.h> -#include <osmocom/e1d/proto_srv.h> #include <osmocom/e1d/proto.h> +#include <osmocom/e1d/proto_srv.h> #include "e1d.h" #include <osmocom/octoi/octoi.h> @@ -221,6 +221,7 @@ /* server init */ srv = osmo_e1dp_server_create(g_e1d_ctx, E1DP_DEFAULT_SOCKET, e1d_ctl_handlers, e1d); OSMO_ASSERT(srv); + e1d->srv = srv; /* main loop */ while (!g_shutdown) { diff --git a/src/osmo-e1gen.c b/src/osmo-e1gen.c index 008f083..81ef21a 100644 --- a/src/osmo-e1gen.c +++ b/src/osmo-e1gen.c @@ -436,3 +436,5 @@ return 0; } + +void osmo_e1dp_server_event(void) {} diff --git a/src/proto_clnt.c b/src/proto_clnt.c index 93853e9..99d1cc2 100644 --- a/src/proto_clnt.c +++ b/src/proto_clnt.c @@ -64,18 +64,26 @@ #include "log.h" +typedef void (*osmo_e1dp_event_cb_t)(enum osmo_e1dp_msg_type, uint8_t, uint8_t, uint8_t, uint8_t *, int); /*! Internal representation of client program connected to the CTL socket */ struct osmo_e1dp_client { void *ctx; /*!< talloc context */ struct osmo_fd ctl_fd; /*!< osmo-fd wrapped unix domain (CTL) socket to @osmo-e1d@ */ + osmo_e1dp_event_cb_t event_cb; + /*!< callback function for incoming events */ }; static int _e1dp_client_event(struct osmo_e1dp_client *clnt, struct msgb *msgb) { - /* FIXME */ + struct osmo_e1dp_msg_hdr *hdr = msgb_l1(msgb); + + if (!clnt->event_cb) + return -EINVAL; + + clnt->event_cb(hdr->type, hdr->intf, hdr->line, hdr->ts, msgb_l2(msgb), msgb_l2len(msgb)); return 0; } @@ -455,3 +463,12 @@ { return _client_ts_open(clnt, intf, line, ts, mode, read_bufsize, E1DP_TS_OPEN_F_FORCE); } + +/*! Register event handler for incoming event messages. + * \param[in] clnt Client previously returned from osmo_e1dp_client_create(). */ +void +osmo_e1dp_client_event_register(struct osmo_e1dp_client *clnt, + void (*cb)(enum osmo_e1dp_msg_type event, uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len)) +{ + clnt->event_cb = cb; +} diff --git a/src/proto_srv.c b/src/proto_srv.c index 2b85ac6..ab2fd30 100644 --- a/src/proto_srv.c +++ b/src/proto_srv.c @@ -260,3 +260,35 @@ osmo_fd_close(&srv->ctl_fd); talloc_free(srv); } + +void +osmo_e1dp_server_event(struct osmo_e1dp_server *srv, enum osmo_e1dp_msg_type event, + uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len) +{ + struct osmo_e1dp_msg_hdr *hdr; + struct msgb *msgb; + struct osmo_e1dp_server_conn *conn; + + /* Call handler */ + msgb = msgb_alloc(E1DP_MAX_LEN, "e1d proto tx (event) message"); + + msgb->l1h = msgb_put(msgb, sizeof(struct osmo_e1dp_msg_hdr)); + hdr = msgb_l1(msgb); + if (data && len) { + msgb->l2h = msgb_put(msgb, len); + memcpy(msgb->l2h, data, len); + } + hdr->magic = E1DP_MAGIC; + hdr->type = event; + hdr->len = msgb_length(msgb); + hdr->intf = intf; + hdr->line = line; + hdr->ts = ts; + + /* Send event */ + llist_for_each_entry(conn, &srv->conns, list) + osmo_e1dp_send(&conn->fd, msgb, -1); + + /* Done */ + msgb_free(msgb); +} -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35558?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I5ee3268f8349b611c3cf3fa0572dc5eab280ab2e Gerrit-Change-Number: 35558 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-e1d[master]: Indicate framing alignment error as loss of framing signal
by laforge 19 Jan '24

19 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35559?usp=email ) ( 4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Indicate framing alignment error as loss of framing signal ...................................................................... Indicate framing alignment error as loss of framing signal Change-Id: Iaad3adb6afb9e1d8a002fa4a04ba4ab8e51671a3 --- M src/usb.c 1 file changed, 18 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified tnt: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/src/usb.c b/src/usb.c index fcffc12..8d431f5 100644 --- a/src/usb.c +++ b/src/usb.c @@ -33,6 +33,8 @@ #include <osmocom/core/utils.h> #include <osmocom/core/bit32gen.h> #include <osmocom/usb/libusb.h> +#include <osmocom/e1d/proto.h> +#include <osmocom/e1d/proto_srv.h> #include <libusb.h> @@ -396,6 +398,13 @@ if ((errcnt->flags & ICE1USB_ERR_F_ALIGN_ERR) != (last->flags & ICE1USB_ERR_F_ALIGN_ERR)) { LOGPLI(line, DE1D, LOGL_ERROR, "ALIGNMENT %s\n", errcnt->flags & ICE1USB_ERR_F_ALIGN_ERR ? "LOST" : "REGAINED"); + if ((errcnt->flags & ICE1USB_ERR_F_ALIGN_ERR)) { + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_LOF_ON, + line->intf->id, line->id, 0, NULL, 0); + } else { + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_LOF_OFF, + line->intf->id, line->id, 0, NULL, 0); + } } if ((errcnt->flags & ICE1USB_ERR_F_LOS) != (last->flags & ICE1USB_ERR_F_LOS)) { -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35559?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Iaad3adb6afb9e1d8a002fa4a04ba4ab8e51671a3 Gerrit-Change-Number: 35559 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-e1d[master]: Add option to automatically reset RIFO on underrun/overflow
by laforge 19 Jan '24

19 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email ) Change subject: Add option to automatically reset RIFO on underrun/overflow ...................................................................... Add option to automatically reset RIFO on underrun/overflow Whenever the RIFO buffer fill drifts away from its target, it can be automatically reset and filled to the initial prefill_frame_count value. The average fill is measured over several seconds. A given deviation in percent of the prefill_frame_count is used to trigger that reset. If the deviation is not set (0), this feature is deactivated. There are two reasons for this to happen: The GPS clock is missing, so the receiving interface is not in sync with the transmitting interface. The delay changes significantly, due to congestion on the path between both peers. (poor internet connection) Change-Id: Id7ccbfbdb288990c01f185dec79a1022a68b4748 --- M include/osmocom/octoi/octoi.h M src/octoi/e1oip.c M src/octoi/e1oip.h M src/octoi/frame_rifo.c M src/octoi/frame_rifo.h M src/octoi/octoi_clnt_fsm.c M src/octoi/octoi_clnt_vty.c M src/octoi/octoi_srv_fsm.c M src/octoi/octoi_srv_vty.c M src/octoi/octoi_vty.h M tests/rifo/rifo_test.c 11 files changed, 74 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/include/osmocom/octoi/octoi.h b/include/osmocom/octoi/octoi.h index 645af3f..b80f8be 100644 --- a/include/osmocom/octoi/octoi.h +++ b/include/osmocom/octoi/octoi.h @@ -24,6 +24,7 @@ uint8_t batching_factor; /* E1 frames per UDP packet (Tx) */ bool force_send_all_ts; /* force transmission of all timeslots */ uint32_t prefill_frame_count; /* FIFO prefill/preseed count (Rx) */ + uint8_t buffer_reset_percent; /* When to reset Rx RIFO in percent */ union { struct { char *usb_serial; /* USB serial string (ASCII) of icE1usb */ diff --git a/src/octoi/e1oip.c b/src/octoi/e1oip.c index 85dd165..e2aad34 100644 --- a/src/octoi/e1oip.c +++ b/src/octoi/e1oip.c @@ -250,7 +250,7 @@ "RxIP: %u extraneous bytes (len=%u, num_ts=%u, n_frames=%u)\n", msgb_length(msg) % num_ts, msgb_length(msg), num_ts, n_frames); } - LOGPEER(peer, LOGL_INFO, "RxIP: frame=%05u ts_mask=0x%08x num_ts=%02u, n_frames=%u\n", + LOGPEER(peer, LOGL_DEBUG, "RxIP: frame=%05u ts_mask=0x%08x num_ts=%02u, n_frames=%u\n", frame_nr, ts_mask, num_ts, n_frames); } else { if (msgb_l3len(msg) < 1) { @@ -271,7 +271,26 @@ rc = frame_rifo_in(&iline->e1t.rifo, frame_buf, fn32+i); if (rc < 0) iline_ctr_add(iline, LINE_CTR_E1oIP_E1T_OVERFLOW, 1); + /* Continue the for loop, if buffer reset is not configured. */ + if (!iline->cfg.buffer_reset_percent) + continue; + /* Calculate average RIFO delay. */ + int32_t d = fn32 + i - iline->e1t.rifo.next_out_fn; + iline->e1t.delay += d; + if (++iline->e1t.delay_cnt == FRAMES_BUFFER_RESET_AVG) { + int offset; + d = iline->e1t.delay / iline->e1t.delay_cnt; + iline->e1t.delay = iline->e1t.delay_cnt = 0; + offset = abs((int32_t)iline->cfg.prefill_frame_count - d) * 100 / iline->cfg.prefill_frame_count; + LOGPEER(peer, LOGL_INFO, "RxIP: Buffer fill %u frames, %u%% off target.\n", d, offset); + if (offset > iline->cfg.buffer_reset_percent) { + LOGPEER(peer, LOGL_ERROR, "RxIP: frame number out of range. Reset buffer.\n"); + frame_rifo_init(&iline->e1t.rifo, fn32 + i); + iline->e1t.primed_rx_tdm = false; + } + } } + /* update local state */ memcpy(iline->e1t.last_frame, frame_buf, BYTES_PER_FRAME); if (update_next) @@ -318,10 +337,11 @@ } void e1oip_line_configure(struct e1oip_line *iline, uint8_t batching_factor, - uint32_t prefill_frame_count, bool force_send_all_ts) + uint32_t prefill_frame_count, uint8_t buffer_reset_percent, bool force_send_all_ts) { iline->cfg.batching_factor = batching_factor; iline->cfg.prefill_frame_count = prefill_frame_count; + iline->cfg.buffer_reset_percent = buffer_reset_percent; iline->cfg.force_send_all_ts = force_send_all_ts; } @@ -331,10 +351,12 @@ memset(&iline->e1o.last_frame, 0xff, sizeof(iline->e1o.last_frame)); iline->e1o.next_seq = 0; - frame_rifo_init(&iline->e1t.rifo); + frame_rifo_init(&iline->e1t.rifo, 0); memset(&iline->e1t.last_frame, 0xff, sizeof(iline->e1t.last_frame)); iline->e1t.next_fn32 = 0; iline->e1t.primed_rx_tdm = false; + iline->e1t.delay = 0; + iline->e1t.delay_cnt = 0; } void e1oip_line_destroy(struct e1oip_line *iline) diff --git a/src/octoi/e1oip.h b/src/octoi/e1oip.h index a17c257..8aaa420 100644 --- a/src/octoi/e1oip.h +++ b/src/octoi/e1oip.h @@ -15,6 +15,8 @@ #define FRAMES_PER_SEC_THRESHOLD 7500 +#define FRAMES_BUFFER_RESET_AVG 40000 + #define DEFAULT_BATCHING_FACTOR 32 #define DEFAULT_PREFILL_FRAME_COUNT 200 /* 25ms */ @@ -54,6 +56,7 @@ struct { uint8_t batching_factor; uint32_t prefill_frame_count; + uint8_t buffer_reset_percent; bool force_send_all_ts; } cfg; @@ -70,6 +73,7 @@ uint8_t last_frame[BYTES_PER_FRAME]; /* last frame on the E1 side */ uint32_t next_fn32; /* next expected frame number */ bool primed_rx_tdm; /* Was RX RIFO primed */ + int32_t delay, delay_cnt; /* Delay counter to calculate average delay */ } e1t; }; @@ -84,7 +88,7 @@ void e1oip_line_set_name(struct e1oip_line *line, const char *name); void e1oip_line_reset(struct e1oip_line *iline); void e1oip_line_configure(struct e1oip_line *iline, uint8_t batching_factor, - uint32_t prefill_frame_count, bool force_send_all_ts); + uint32_t prefill_frame_count, uint8_t buffer_reset_percent, bool force_send_all_ts); void e1oip_line_destroy(struct e1oip_line *iline); int e1oip_rcvmsg_tdm_data(struct e1oip_line *iline, struct msgb *msg); diff --git a/src/octoi/frame_rifo.c b/src/octoi/frame_rifo.c index e3c22d9..00fb6a5 100644 --- a/src/octoi/frame_rifo.c +++ b/src/octoi/frame_rifo.c @@ -86,12 +86,12 @@ /*! Initialize a frame RIFO. * \param rifo Caller-allocated memory for RIFO data structure */ -void frame_rifo_init(struct frame_rifo *rifo) +void frame_rifo_init(struct frame_rifo *rifo, uint32_t fn) { memset(rifo->buf, 0xff, sizeof(rifo->buf)); rifo->next_out = rifo->buf; - rifo->next_out_fn = 0; - rifo->last_in_fn = -1; + rifo->next_out_fn = fn; + rifo->last_in_fn = fn - 1; memset(rifo->bitvec, 0, sizeof(rifo->bitvec)); } diff --git a/src/octoi/frame_rifo.h b/src/octoi/frame_rifo.h index ac97506..19a9acb 100644 --- a/src/octoi/frame_rifo.h +++ b/src/octoi/frame_rifo.h @@ -27,7 +27,7 @@ return rifo->last_in_fn - rifo->next_out_fn + 1; } -void frame_rifo_init(struct frame_rifo *rifo); +void frame_rifo_init(struct frame_rifo *rifo, uint32_t fn); /* number of frames currently available in FIFO */ static inline unsigned int frame_rifo_frames(struct frame_rifo *rifo) diff --git a/src/octoi/octoi_clnt_fsm.c b/src/octoi/octoi_clnt_fsm.c index 2bfc8f9..d4cf90d 100644 --- a/src/octoi/octoi_clnt_fsm.c +++ b/src/octoi/octoi_clnt_fsm.c @@ -123,7 +123,7 @@ struct clnt_state *st = fi->priv; e1oip_line_configure(st->peer->iline, st->acc->batching_factor, - st->acc->prefill_frame_count, st->acc->force_send_all_ts); + st->acc->prefill_frame_count, st->acc->buffer_reset_percent, st->acc->force_send_all_ts); /* reset RIFO/FIFO etc. */ e1oip_line_reset(st->peer->iline); iline_ctr_add(st->peer->iline, LINE_CTR_E1oIP_CONNECT_ACCEPT, 1); diff --git a/src/octoi/octoi_clnt_vty.c b/src/octoi/octoi_clnt_vty.c index 54ed60f..afca60c 100644 --- a/src/octoi/octoi_clnt_vty.c +++ b/src/octoi/octoi_clnt_vty.c @@ -283,6 +283,7 @@ install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_force_all_ts_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_no_force_all_ts_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_prefill_frame_count_cmd); + install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_buffer_reset_cmd); #ifdef HAVE_DAHDI_TRUNKDEV install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_trunkdev_name_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_trunkdev_line_cmd); diff --git a/src/octoi/octoi_srv_fsm.c b/src/octoi/octoi_srv_fsm.c index b6914b7..81b27da 100644 --- a/src/octoi/octoi_srv_fsm.c +++ b/src/octoi/octoi_srv_fsm.c @@ -176,7 +176,7 @@ struct srv_state *st = fi->priv; e1oip_line_configure(st->peer->iline, st->acc->batching_factor, - st->acc->prefill_frame_count, st->acc->force_send_all_ts); + st->acc->prefill_frame_count, st->acc->buffer_reset_percent, st->acc->force_send_all_ts); /* reset RIFO/FIFO etc. */ e1oip_line_reset(st->peer->iline); iline_ctr_add(st->peer->iline, LINE_CTR_E1oIP_CONNECT_ACCEPT, 1); diff --git a/src/octoi/octoi_srv_vty.c b/src/octoi/octoi_srv_vty.c index 4fc4e47..05a99a4 100644 --- a/src/octoi/octoi_srv_vty.c +++ b/src/octoi/octoi_srv_vty.c @@ -412,7 +412,7 @@ } gDEFUN(cfg_account_prefill_frame_count, cfg_account_prefill_frame_count_cmd, - "prefill-frame-count <0-8000>", + "prefill-frame-count <0-900>", "Number of E1 frames to pre-fill/pre-seed in Rx RIFO\n" "Number of E1 frames to pre-fill/pre-seed in Rx RIFO\n") { @@ -422,6 +422,17 @@ return CMD_SUCCESS; } +gDEFUN(cfg_account_buffer_reset, cfg_account_buffer_reset_cmd, + "buffer-reset <0-100>", + "Reset Rx RIFO when fill in Rx RIFO drifts too much off normal\n" + "Give fill in percentage, use 0 to disable this feature\n") +{ + struct octoi_account *acc = vty->index; + + acc->buffer_reset_percent = atoi(argv[0]); + return CMD_SUCCESS; +} + void octoi_vty_show_one_account(struct vty *vty, const char *pfx, struct octoi_account *acc) { vty_out(vty, "%sAccount '%s': Mode=%s, Batching=%u, Prefill=%u%s", pfx, @@ -563,6 +574,7 @@ install_element(OCTOI_ACCOUNT_NODE, &cfg_account_force_all_ts_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_no_force_all_ts_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_prefill_frame_count_cmd); + install_element(OCTOI_ACCOUNT_NODE, &cfg_account_buffer_reset_cmd); #ifdef HAVE_DAHDI_TRUNKDEV install_element(OCTOI_ACCOUNT_NODE, &cfg_account_trunkdev_name_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_trunkdev_line_cmd); diff --git a/src/octoi/octoi_vty.h b/src/octoi/octoi_vty.h index 55fa7fe..a452e9d 100644 --- a/src/octoi/octoi_vty.h +++ b/src/octoi/octoi_vty.h @@ -11,6 +11,7 @@ extern struct cmd_element cfg_account_force_all_ts_cmd; extern struct cmd_element cfg_account_no_force_all_ts_cmd; extern struct cmd_element cfg_account_prefill_frame_count_cmd; +extern struct cmd_element cfg_account_buffer_reset_cmd; extern struct cmd_element cfg_account_trunkdev_name_cmd; extern struct cmd_element cfg_account_trunkdev_line_cmd; diff --git a/tests/rifo/rifo_test.c b/tests/rifo/rifo_test.c index ec90ce7..381ca49 100644 --- a/tests/rifo/rifo_test.c +++ b/tests/rifo/rifo_test.c @@ -23,7 +23,7 @@ static void rifo_init(struct frame_rifo *rifo) { - frame_rifo_init(rifo); + frame_rifo_init(rifo, 0); rifo->next_out_fn = init_next_out_fn; rifo->last_in_fn = init_next_out_fn - 1; } @@ -48,7 +48,7 @@ static void missing_frames(uint8_t modulo) { struct frame_rifo rifo; - frame_rifo_init(&rifo); + frame_rifo_init(&rifo, 0); rifo.next_out_fn = init_next_out_fn; rifo.last_in_fn = init_next_out_fn - 1; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Id7ccbfbdb288990c01f185dec79a1022a68b4748 Gerrit-Change-Number: 34554 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: manawyrm <osmocom.account(a)tbspace.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-e1d[master]: Indicate remote alarm bit as remote alarm inidication
by laforge 19 Jan '24

19 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35560?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Indicate remote alarm bit as remote alarm inidication ...................................................................... Indicate remote alarm bit as remote alarm inidication The flag that stores the current alarm is not cleared periodically. Instead it is cleared when the alarm ceases. Change-Id: Id6cd193c71330c350c27e02b3a692d2c7e0b3fbe --- M src/intf_line.c M src/mux_demux.c 2 files changed, 27 insertions(+), 4 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified tnt: Looks good to me, but someone else must approve diff --git a/src/intf_line.c b/src/intf_line.c index f41214e..4433e96 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -239,7 +239,7 @@ } line->ts0.prev_errmask = line->ts0.cur_errmask; - line->ts0.cur_errmask = 0; + line->ts0.cur_errmask &= ~E1L_TS0_RX_CRC4_ERR; osmo_timer_schedule(&line->ts0.timer, 1, 0); } diff --git a/src/mux_demux.c b/src/mux_demux.c index cd5c286..abe01a3 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -36,6 +36,7 @@ #include <osmocom/core/stats.h> #include <osmocom/core/rate_ctr.h> #include <osmocom/e1d/proto.h> +#include <osmocom/e1d/proto_srv.h> #include "e1d.h" #include "log.h" @@ -380,8 +381,18 @@ /* A bit is present in each odd frame */ if (frame_nr % 2) { if (frame[0] & 0x20) { - line->ts0.cur_errmask |= E1L_TS0_RX_ALARM; - line_ctr_add(line, LINE_CTR_RX_REMOTE_A, 1); + if (!(line->ts0.cur_errmask & E1L_TS0_RX_ALARM)) { + line->ts0.cur_errmask |= E1L_TS0_RX_ALARM; + line_ctr_add(line, LINE_CTR_RX_REMOTE_A, 1); + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_RAI_ON, + line->intf->id, line->id, 0, NULL, 0); + } + } else { + if ((line->ts0.cur_errmask & E1L_TS0_RX_ALARM)) { + line->ts0.cur_errmask &= ~E1L_TS0_RX_ALARM; + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_RAI_OFF, + line->intf->id, line->id, 0, NULL, 0); + } } } @@ -395,7 +406,7 @@ line_ctr_add(line, LINE_CTR_RX_REMOTE_E, 1); } } - /* cur_errmask is being cleared once per second via line->ts0.timer */ + /* CRC error in cur_errmask is being cleared once per second via line->ts0.timer */ } } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35560?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Id6cd193c71330c350c27e02b3a692d2c7e0b3fbe Gerrit-Change-Number: 35560 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-e1d[master]: Indicate change in received Sa bits
by laforge 19 Jan '24

19 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Indicate change in received Sa bits ...................................................................... Indicate change in received Sa bits Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b --- M src/e1d.h M src/intf_line.c M src/mux_demux.c 3 files changed, 24 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved tnt: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/e1d.h b/src/e1d.h index 3188cfc..4b70c0f 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -148,6 +148,8 @@ uint8_t prev_errmask; /*! timer to re-set the rx_crc4_err and rx_alarm above */ struct osmo_timer_list timer; + /*! last received frame with Sa bits */ + uint8_t rx_frame; } ts0; /* watchdog timer to catch situations where no more USB data is received */ diff --git a/src/intf_line.c b/src/intf_line.c index 4433e96..b3dafff 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -272,6 +272,7 @@ line->intf = intf; line->drv_data = drv_data; line->mode = E1_LINE_MODE_CHANNELIZED; + line->ts0.rx_frame = 0xff; for (int i = 0; i < 32; i++) _ts_init(&line->ts[i], line, i); diff --git a/src/mux_demux.c b/src/mux_demux.c index abe01a3..71374ef 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -378,8 +378,8 @@ const uint8_t *frame = buf + i*32; uint8_t frame_nr = (frame_base + i) & 0xf; - /* A bit is present in each odd frame */ if (frame_nr % 2) { + /* A bit is present in each odd frame */ if (frame[0] & 0x20) { if (!(line->ts0.cur_errmask & E1L_TS0_RX_ALARM)) { line->ts0.cur_errmask |= E1L_TS0_RX_ALARM; @@ -394,6 +394,17 @@ line->intf->id, line->id, 0, NULL, 0); } } + /* SA bits changed */ + if (line->ts0.rx_frame != (frame[0] | 0xe0)) { + uint8_t sa_bits = ((frame[0] & 0x01) << 7) | /* Sa8 -> Bit 7 */ + ((frame[0] & 0x02) << 5) | /* Sa7 -> Bit 6 */ + ((frame[0] & 0x04) >> 2) | /* Sa6 -> Bit 0 */ + ((frame[0] & 0x08) << 2) | /* Sa5 -> Bit 5 */ + (frame[0] & 0x10); /* Sa4 -> Bit 4 */ + line->ts0.rx_frame = frame[0] | 0xe0; + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_SABITS, + line->intf->id, line->id, 0, &sa_bits, 1); + } } /* E bits are present in frame 13 + 15 */ -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b Gerrit-Change-Number: 35561 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-e1d[master]: Add command and client function to change transmitted Sa bits
by laforge 19 Jan '24

19 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35562?usp=email ) ( 5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Add command and client function to change transmitted Sa bits ...................................................................... Add command and client function to change transmitted Sa bits Change-Id: I2608af7bbb8092fddd68d4f3bb36b10a1100ce0f --- M include/osmocom/e1d/proto_clnt.h M src/ctl.c M src/e1d.h M src/intf_line.c M src/mux_demux.c M src/proto_clnt.c 6 files changed, 87 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified tnt: Looks good to me, approved diff --git a/include/osmocom/e1d/proto_clnt.h b/include/osmocom/e1d/proto_clnt.h index 26bd44e..b5be2ce 100644 --- a/include/osmocom/e1d/proto_clnt.h +++ b/include/osmocom/e1d/proto_clnt.h @@ -43,6 +43,7 @@ uint8_t intf, uint8_t line, uint8_t ts); int osmo_e1dp_client_line_config(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, enum osmo_e1dp_line_mode mode); +int osmo_e1dp_client_set_sa_bits(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t sa_bits); int osmo_e1dp_client_ts_open(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t ts, enum osmo_e1dp_ts_mode mode, uint16_t read_bufsize); diff --git a/src/ctl.c b/src/ctl.c index 8ed4a69..331f2ad 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -430,6 +430,37 @@ return 0; } +static int +_e1d_ctl_sabits(void *data, struct msgb *msgb, struct msgb *rmsgb, int *rfd) +{ + struct e1_daemon *e1d = (struct e1_daemon *)data; + struct osmo_e1dp_msg_hdr *hdr = msgb_l1(msgb); + uint8_t sa_bits = *(uint8_t *)msgb_l2(msgb); + struct e1_intf *intf = NULL; + struct e1_line *line = NULL; + + /* Process query and find timeslot */ + intf = e1d_find_intf(e1d, hdr->intf); + if (!intf) { + LOGP(DE1D, LOGL_NOTICE, "Client request for non-existant Interface %u\n", hdr->intf); + return 0; + } + + line = e1_intf_find_line(intf, hdr->line); + if (!line) { + LOGPIF(intf, DE1D, LOGL_NOTICE, "Client request for non-existant line %u\n", hdr->line); + return 0; + } + + line->ts0.tx_frame = ((sa_bits & 0x80) >> 7) | /* Bit 7 -> Sa8 */ + ((sa_bits & 0x40) >> 5) | /* Bit 6 -> Sa7 */ + ((sa_bits & 0x01) << 2) | /* Bit 0 -> Sa6 */ + ((sa_bits & 0x20) >> 2) | /* Bit 5 -> Sa5 */ + (sa_bits & 0x10); /* Bit 4 -> Sa4 */ + + return 0; +} + struct osmo_e1dp_server_handler e1d_ctl_handlers[] = { { @@ -462,5 +493,11 @@ .payload_len = sizeof(struct osmo_e1dp_ts_config), .fn = _e1d_ctl_ts_open, }, + { + .type = E1DP_CMD_SABITS, + .flags = E1DP_SF_INTF_REQ | E1DP_SF_LINE_REQ, + .payload_len = sizeof(uint8_t), + .fn = _e1d_ctl_sabits, + }, { /* guard */ }, }; diff --git a/src/e1d.h b/src/e1d.h index 4b70c0f..bf1cbdf 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -148,6 +148,8 @@ uint8_t prev_errmask; /*! timer to re-set the rx_crc4_err and rx_alarm above */ struct osmo_timer_list timer; + /*! current transmitting frame with Sa bits */ + uint8_t tx_frame; /*! last received frame with Sa bits */ uint8_t rx_frame; } ts0; diff --git a/src/intf_line.c b/src/intf_line.c index b3dafff..8eac84d 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -272,6 +272,7 @@ line->intf = intf; line->drv_data = drv_data; line->mode = E1_LINE_MODE_CHANNELIZED; + line->ts0.tx_frame = 0xff; line->ts0.rx_frame = 0xff; for (int i = 0; i < 32; i++) diff --git a/src/mux_demux.c b/src/mux_demux.c index 71374ef..dd8ca45 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -149,11 +149,18 @@ static void _e1_line_mux_out_channelized(struct e1_line *line, uint8_t *buf, int fts) { + struct e1_ts *ts; + OSMO_ASSERT(line->mode == E1_LINE_MODE_CHANNELIZED); - /* Scan timeslots */ + /* Fill timeslot 0 */ + ts = &line->ts[0]; + for (int i = 0; i < fts; i++) + buf[(i*32)] = line->ts0.tx_frame; + + /* Scan timeslots 1..31 */ for (int tsn = 1; tsn < 32; tsn++) { - struct e1_ts *ts = &line->ts[tsn]; + ts = &line->ts[tsn]; uint8_t buf_ts[fts]; int l; diff --git a/src/proto_clnt.c b/src/proto_clnt.c index 99d1cc2..854b958 100644 --- a/src/proto_clnt.c +++ b/src/proto_clnt.c @@ -394,6 +394,34 @@ return 0; } +/*! Set Sa-bits of a specific E1 line in osmo-e1d. + * \param[in] clnt Client previously returned from osmo_e1dp_client_create(). + * \param[in] intf E1 interface number to configure. + * \param[in] line E1 line number (within interface) to configure. + * \param[in] sa_bits Sa bits to set on line. + * \returns zero in case of success; negative in case of error. */ +int +osmo_e1dp_client_set_sa_bits(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t sa_bits) +{ + struct msgb *msgb; + struct osmo_e1dp_msg_hdr hdr; + int rc; + + memset(&hdr, 0x00, sizeof(struct osmo_e1dp_msg_hdr)); + hdr.type = E1DP_CMD_SABITS; + hdr.intf = intf; + hdr.line = line; + hdr.ts = E1DP_INVALID; + + rc = _e1dp_client_query_base(clnt, &hdr, &sa_bits, 1, &msgb, NULL); + if (rc) + return rc; + + msgb_free(msgb); + + return 0; +} + static int _client_ts_open(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t ts, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35562?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I2608af7bbb8092fddd68d4f3bb36b10a1100ce0f Gerrit-Change-Number: 35562 Gerrit-PatchSet: 6 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-e1d[master]: Prevent memory leaks / double free of msgb in proto_clnt.c
by laforge 19 Jan '24

19 Jan '24
Attention is currently required from: jolly. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35609?usp=email ) Change subject: Prevent memory leaks / double free of msgb in proto_clnt.c ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35609?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ic0c4c06ba7c1a405ec3c73100fe9e8476f4f5512 Gerrit-Change-Number: 35609 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Fri, 19 Jan 2024 19:43:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-e1d[master]: Add option to automatically reset RIFO on underrun/overflow
by laforge 19 Jan '24

19 Jan '24
Attention is currently required from: jolly, manawyrm, tnt. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email ) Change subject: Add option to automatically reset RIFO on underrun/overflow ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Id7ccbfbdb288990c01f185dec79a1022a68b4748 Gerrit-Change-Number: 34554 Gerrit-PatchSet: 5 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: manawyrm <osmocom.account(a)tbspace.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-Attention: manawyrm <osmocom.account(a)tbspace.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: tnt <tnt(a)246tNt.com> Gerrit-Comment-Date: Fri, 19 Jan 2024 19:43:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: gsup: Convert PDP-Type IE to PDP-Address IE
by pespin 19 Jan '24

19 Jan '24
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/35627?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: gsup: Convert PDP-Type IE to PDP-Address IE ...................................................................... gsup: Convert PDP-Type IE to PDP-Address IE The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6 --- M TODO-RELEASE M include/osmocom/gsm/gsup.h M src/gsm/Makefile.am M src/gsm/gsup.c M tests/Makefile.am M tests/gsup/gsup_test.err 6 files changed, 162 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/35627/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35627?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6 Gerrit-Change-Number: 35627 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • ...
  • 156
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.