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

style: fix trailing whitespace in several files #576

Merged
merged 1 commit into from
Nov 16, 2024
Merged
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
18 changes: 9 additions & 9 deletions cmd/ebpf/xdp/n3n6_entrypoint.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright 2023 Edgecom LLC
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -63,7 +63,7 @@ static __always_inline __u16 handle_n6_packet_ipv4(struct packet_context *ctx) {
upf_printk("upf: [n6] no downlink session for ip:%pI4", &ip4->daddr);
return DEFAULT_XDP_ACTION;
}

__u32 far_id = pdr->far_id;
__u32 qer_id = pdr->qer_id;
//__u8 outer_header_removal = pdr->outer_header_removal;
Expand Down Expand Up @@ -95,7 +95,7 @@ static __always_inline __u16 handle_n6_packet_ipv4(struct packet_context *ctx) {
if (!(far->outer_header_creation & OHC_GTP_U_UDP_IPv4))
return XDP_DROP;

struct qer_info *qer = bpf_map_lookup_elem(&qer_map, &qer_id);
struct qer_info *qer = bpf_map_lookup_elem(&qer_map, &qer_id);
if (!qer) {
upf_printk("upf: [n6] no downlink session qer for ip:%pI4 qer:%d", &ip4->daddr, qer_id);
return XDP_DROP;
Expand Down Expand Up @@ -158,7 +158,7 @@ static __always_inline enum xdp_action handle_n6_packet_ipv6(struct packet_conte
if (!(far->outer_header_creation & OHC_GTP_U_UDP_IPv4))
return XDP_DROP;

struct qer_info *qer = bpf_map_lookup_elem(&qer_map, &qer_id);
struct qer_info *qer = bpf_map_lookup_elem(&qer_map, &qer_id);
if (!qer) {
upf_printk("upf: [n6] no downlink session qer for ip:%pI6c qer:%d", &ip6->daddr, qer_id);
return XDP_DROP;
Expand Down Expand Up @@ -201,7 +201,7 @@ static __always_inline enum xdp_action handle_gtp_packet(struct packet_context *
__u32 far_id = pdr->far_id;
__u32 qer_id = pdr->qer_id;
__u8 outer_header_removal = pdr->outer_header_removal;

if (pdr->sdf_mode) {
struct packet_context inner_context = {
.data = (char *)(long)ctx->data,
Expand Down Expand Up @@ -234,7 +234,7 @@ static __always_inline enum xdp_action handle_gtp_packet(struct packet_context *
} else {
upf_printk("upf: [n3] sdf filter doesn't match teid:%u", teid);
if(pdr->sdf_mode & 1)
return DEFAULT_XDP_ACTION;
return DEFAULT_XDP_ACTION;
}
break;
}
Expand Down Expand Up @@ -360,7 +360,7 @@ static __always_inline enum xdp_action handle_gtp_packet(struct packet_context *
} else {
return XDP_ABORTED;
}

}

static __always_inline enum xdp_action handle_gtpu(struct packet_context *ctx) {
Expand Down
10 changes: 5 additions & 5 deletions cmd/ebpf/xdp/pdr.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright 2023 Edgecom LLC
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -40,7 +40,7 @@ enum outer_header_removal_values {
OHR_S_TAG_C_TAG = 8,
};

// Possible optimizations:
// Possible optimizations:
// 0. Store SDFs in a separate map. PDR will have only id of corresponding SDF.
// 1. Combine SrcAddress.Type and DstAddress.Type into one __u8 field. Then to retrieve and put data will be used operators & and | .
// 2. Put all fields into one big structure. Sort in specific order to reduce paddings inside structure.
Expand All @@ -64,7 +64,7 @@ struct pdr_info {
struct sdf_rules sdf_rules;
};

/* ipv4 -> PDR */
/* ipv4 -> PDR */
struct
{
__uint(type, BPF_MAP_TYPE_HASH);
Expand Down
8 changes: 4 additions & 4 deletions cmd/ebpf/xdp/utils/gtp_utils.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright 2023 Edgecom LLC
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -110,7 +110,7 @@ static __always_inline long remove_gtp_header(struct packet_context *ctx) {
return -1;

__builtin_memcpy(new_eth, eth, sizeof(*new_eth));

new_eth->h_proto = eth_proto;

long result = bpf_xdp_adjust_head(ctx->xdp_ctx, gtp_encap_size);
Expand Down
6 changes: 3 additions & 3 deletions cmd/ebpf/xdp/utils/routing.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright 2023 Edgecom LLC
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
Loading