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

add clang-format #266

Merged
merged 1 commit into from
Apr 29, 2024
Merged

add clang-format #266

merged 1 commit into from
Apr 29, 2024

Conversation

hzxuzhonghu
Copy link
Member

What type of PR is this?

What this PR does / why we need it:

Format c files

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


bpf_ringbuf_submit(msg, 0);
}

static inline void enable_encoding_metadata(struct bpf_sock_ops *skops)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this function

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removed this function

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unused

Copy link
Contributor

@nlgwcy nlgwcy Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enable_encoding_metadata function adds the sock to the sockhashmap. Kernel replaces the sendmsg hook (tcp_bpf_sendmsg) of the sock and then triggers the BPF prog of the sk_msg. Otherwise, there is no bpf hook in the normal tcp_sendmsg.

break;
}
switch (type)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ follows switch

__u32 type;
struct bpf_sock_tuple tuple;
struct ringbuf_msg_type
{
Copy link
Contributor

@nlgwcy nlgwcy Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ follows struct/enum

return 1;
}
if (ret)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ follows if/else

@hzxuzhonghu hzxuzhonghu force-pushed the clang-format branch 2 times, most recently from 20678d7 to 4f542ee Compare April 25, 2024 12:45
fd = bpf_create_map_name(inner_info->type, NULL, inner_info->key_size,
inner_info->value_size, inner_info->max_entries,
inner_info->map_flags);
fd = bpf_create_map_name(inner_info->type, NULL, inner_info->key_size, inner_info->value_size, inner_info->max_entries, inner_info->map_flags);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

margin width:120

Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
@nlgwcy
Copy link
Contributor

nlgwcy commented Apr 29, 2024

/lgtm
/approve

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nlgwcy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit fef0f4c into kmesh-net:main Apr 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants