Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove support for pre 3GPP Rel.16 PFCP and UPF features #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions upf/test/test_upf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def pgw_setup_cmds(cls):
"upf nwi name cp vrf 0",
"upf nwi name epc vrf 100",
"upf nwi name sgi vrf 200",
"upf specification release 16",
"upf node-id fqdn upg",
"upf pfcp endpoint ip %s vrf 0" % cls.if_cp.local_ip4,
"ip route add 0.0.0.0/0 table 200 via %s %s" %
Expand Down Expand Up @@ -263,7 +262,6 @@ def pgw_setup_cmds(cls):
"upf nwi name cp vrf 0",
"upf nwi name epc vrf 100",
"upf nwi name sgi vrf 200",
"upf specification release 16",
"upf node-id ip6 %s" % cls.if_cp.local_ip6,
"upf pfcp endpoint ip %s vrf 0" % cls.if_cp.local_ip6,
"ip route add ::/0 table 200 via %s %s" %
Expand Down
1 change: 0 additions & 1 deletion upf/upf.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ upf_init (vlib_main_t * vm)

sm->vnet_main = vnet_get_main ();
sm->vlib_main = vm;
sm->pfcp_spec_version = 15;
sm->rand_base = random_default_seed ();
sm->log_class = vlib_log_register_class ("upf", 0);

Expand Down
2 changes: 0 additions & 2 deletions upf/upf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,6 @@ typedef struct
/* adf apps vector */
upf_adf_app_t *upf_apps;

//TODO: Change to UPF flags?
u32 pfcp_spec_version;
u32 rand_base;

pfcp_node_id_t node_id;
Expand Down
52 changes: 0 additions & 52 deletions upf/upf_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,58 +785,6 @@ VLIB_CLI_COMMAND (upf_tdf_ul_enable_command, static) = {
};
/* *INDENT-ON* */

static clib_error_t *
upf_spec_release_command_fn (vlib_main_t * vm,
unformat_input_t * main_input,
vlib_cli_command_t * cmd)
{
unformat_input_t _line_input, *line_input = &_line_input;
upf_main_t *gtm = &upf_main;
u32 spec_version = 0;

if (!unformat_user (main_input, unformat_line_input, line_input))
return 0;

while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "release %u", &spec_version))
break;
else
return 0;
}

gtm->pfcp_spec_version = spec_version;
return NULL;
}

/* *INDENT-OFF* */
VLIB_CLI_COMMAND (upf_spec_release_command, static) = {
.path = "upf specification",
.short_help = "upf specification release [MAJOR.MINOR.PATCH]",
.function = upf_spec_release_command_fn,
};
/* *INDENT-ON* */

static clib_error_t *
upf_show_spec_release_command_fn (vlib_main_t * vm,
unformat_input_t * main_input,
vlib_cli_command_t * cmd)
{
upf_main_t *gtm = &upf_main;
vlib_cli_output (vm, "PFCP version: %u", gtm->pfcp_spec_version);
return NULL;
}

/* *INDENT-OFF* */
VLIB_CLI_COMMAND (upf_show_spec_release_command, static) =
{
.path = "show upf specification release",
.short_help =
"show upf specification release",
.function = upf_show_spec_release_command_fn,
};
/* *INDENT-ON* */

static clib_error_t *
upf_node_id_command_fn (vlib_main_t * vm,
unformat_input_t * main_input,
Expand Down
17 changes: 7 additions & 10 deletions upf/upf_pfcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2830,18 +2830,15 @@ format_pfcp_session (u8 * s, va_list * args)
vlib_time_now (gtm->vlib_main) - sx->last_ul_traffic,
rules->inactivity_timer.handle);

if (gtm->pfcp_spec_version == 16)
u16 idx = 1;
s = format (s, " TEID assignment per choose ID\n");
for (idx = 0; idx < 256 /* U8_MAX limits value of CHID */ ; idx++)
{
u16 idx = 1;
s = format (s, " TEID assignment per choose ID\n");
for (idx = 0; idx < 256 /* U8_MAX limits value of CHID */ ; idx++)
{
u32 teid = *sparse_vec_elt_at_index (sx->teid_by_chid, idx);
if (teid)
s = format (s, " %3u: %u (0x%08x)\n", idx, teid, teid);
u32 teid = *sparse_vec_elt_at_index (sx->teid_by_chid, idx);
if (teid)
s = format (s, " %3u: %u (0x%08x)\n", idx, teid, teid);

idx += 1;
}
idx += 1;
}

vec_foreach (pdr, rules->pdr)
Expand Down
80 changes: 9 additions & 71 deletions upf/upf_pfcp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,56 +189,6 @@ build_ue_ip_address_information (pfcp_ue_ip_address_pool_information_t **
}
}

static void
build_user_plane_ip_resource_information
(pfcp_user_plane_ip_resource_information_t ** upip)
{
upf_main_t *gtm = &upf_main;
upf_upip_res_t *res;

vec_alloc (*upip, pool_elts (gtm->upip_res));

pool_foreach (res, gtm->upip_res)
{
pfcp_user_plane_ip_resource_information_t *r;

vec_add2 (*upip, r, 1);

if (res->nwi_index != ~0)
{
upf_nwi_t *nwi = pool_elt_at_index (gtm->nwis, res->nwi_index);

r->flags |= USER_PLANE_IP_RESOURCE_INFORMATION_ASSONI;
r->network_instance = vec_dup (nwi->name);
}

if (INTF_INVALID != res->intf)
{

r->flags |= USER_PLANE_IP_RESOURCE_INFORMATION_ASSOSI;
r->source_intf = res->intf;
}

if (res->mask != 0)
{
r->teid_range_indication = __builtin_popcount (res->mask);
r->teid_range = (res->teid >> 24);
}

if (!is_zero_ip4_address (&res->ip4))
{
r->flags |= USER_PLANE_IP_RESOURCE_INFORMATION_V4;
r->ip4 = res->ip4;
}

if (!is_zero_ip6_address (&res->ip6))
{
r->flags |= USER_PLANE_IP_RESOURCE_INFORMATION_V6;
r->ip6 = res->ip6;
}
}
}

/* message handlers */

static int
Expand Down Expand Up @@ -371,27 +321,15 @@ handle_association_setup_request (pfcp_msg_t * msg, pfcp_decoded_msg_t * dmsg)

SET_BIT (resp->grp.fields,
ASSOCIATION_PROCEDURE_RESPONSE_UP_FUNCTION_FEATURES);
resp->up_function_features |= F_UPFF_EMPU;
if (gtm->pfcp_spec_version >= 16)
{
resp->up_function_features |= F_UPFF_VTIME;
resp->up_function_features |= F_UPFF_FTUP;
build_ue_ip_address_information (&resp->ue_ip_address_pool_information);
if (vec_len (resp->ue_ip_address_pool_information) != 0)
SET_BIT (resp->grp.fields,
ASSOCIATION_PROCEDURE_RESPONSE_UE_IP_ADDRESS_POOL_INFORMATION);
SET_BIT (resp->grp.fields,
ASSOCIATION_PROCEDURE_RESPONSE_BBF_UP_FUNCTION_FEATURES);
resp->bbf_up_function_features |= BBF_UP_NAT;
}
else
{
build_user_plane_ip_resource_information
(&resp->user_plane_ip_resource_information);
if (vec_len (resp->user_plane_ip_resource_information) != 0)
SET_BIT (resp->grp.fields,
ASSOCIATION_PROCEDURE_RESPONSE_USER_PLANE_IP_RESOURCE_INFORMATION);
}
resp->up_function_features |= (F_UPFF_EMPU | F_UPFF_VTIME | F_UPFF_FTUP);
build_ue_ip_address_information (&resp->ue_ip_address_pool_information);
if (vec_len (resp->ue_ip_address_pool_information) != 0)
SET_BIT (resp->grp.fields,
ASSOCIATION_PROCEDURE_RESPONSE_UE_IP_ADDRESS_POOL_INFORMATION);
SET_BIT (resp->grp.fields,
ASSOCIATION_PROCEDURE_RESPONSE_BBF_UP_FUNCTION_FEATURES);
resp->bbf_up_function_features |= BBF_UP_NAT;

if (r == 0)
{
n->heartbeat_handle = upf_pfcp_server_start_timer
Expand Down