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

Fix CI: Regenerate docs for authz subcommands #1231

Open
wants to merge 1 commit into
base: main
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: 1 addition & 1 deletion bpf/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static inline int convert_v6(char *data, __u32 *ip6)
__u16 ip_1 = (ip >> 0) & 0xFFFF;
__u16 ip_2 = (ip >> 16) & 0xFFFF;
for (int j = 0; j < 2; j++) {
__u16 ip_1 = (ip)&0xFFFF;
__u16 ip_1 = (ip) & 0xFFFF;
Copy link
Member

Choose a reason for hiding this comment

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

Why change & related format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's autogenrated by make gen command

__u8 h_1 = (ip_1 >> 0) & 0xFF;
__u8 h_2 = (ip_1 >> 8) & 0xFF;
*data++ = hex_digits[(h_1 >> 4) & 0xF];
Expand Down
4 changes: 2 additions & 2 deletions bpf/include/inner_map_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
typedef enum { MAP_TYPE_64, MAP_TYPE_192, MAP_TYPE_296, MAP_TYPE_1600, MAP_TYPE_MAX } map_in_map_type;

#define MAP_GET_TYPE(idx) (__u8)((__u32)(idx) >> 24)
#define MAP_GET_INDEX(idx) (__u32)((__u32)(idx)&0xFFFFFF)
#define MAP_GEN_OUTER_KEY(map_type, pos) ((__u32)((((__u8)(map_type)&0xFF) << 24) + ((__u32)(pos)&0xFFFFFF)))
#define MAP_GET_INDEX(idx) (__u32)((__u32)(idx) & 0xFFFFFF)
#define MAP_GEN_OUTER_KEY(map_type, pos) ((__u32)((((__u8)(map_type) & 0xFF) << 24) + ((__u32)(pos) & 0xFFFFFF)))

#define MAP_VAL_SIZE_64 64
#define MAP_VAL_SIZE_192 192
Expand Down
2 changes: 1 addition & 1 deletion bpf/kmesh/ads/include/kmesh_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum kmesh_l7_proto_type { PROTO_UNKNOW = 0, PROTO_HTTP_1_1, PROTO_HTTP_2_0 };
enum kmesh_l7_msg_type { MSG_UNKNOW = 0, MSG_REQUEST, MSG_MID_REPONSE, MSG_FINAL_RESPONSE };

#define KMESH_PROTO_TYPE_WIDTH (8)
#define GET_RET_PROTO_TYPE(n) ((n)&0xff)
#define GET_RET_PROTO_TYPE(n) ((n) & 0xff)
#define GET_RET_MSG_TYPE(n) (((n) >> KMESH_PROTO_TYPE_WIDTH) & 0xff)

#endif // _KMESH_COMMON_H_
2 changes: 1 addition & 1 deletion docs/ctl/kmeshctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Kmesh command line tools to operate and debug Kmesh

### SEE ALSO

* [kmeshctl authz](kmeshctl_authz.md) - Enable or disable xdp authz eBPF Prog for Kmesh's authz offloading
* [kmeshctl authz](kmeshctl_authz.md) - Manage xdp authz eBPF program for Kmesh's authz offloading
* [kmeshctl dump](kmeshctl_dump.md) - Dump config of kernel-native or dual-engine mode
* [kmeshctl log](kmeshctl_log.md) - Get or set kmesh-daemon's logger level
* [kmeshctl monitoring](kmeshctl_monitoring.md) - Control Kmesh's monitoring to be turned on as needed
Expand Down
19 changes: 4 additions & 15 deletions docs/ctl/kmeshctl_authz.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
## kmeshctl authz

Enable or disable xdp authz eBPF Prog for Kmesh's authz offloading

```
kmeshctl authz [flags]
```

### Examples

```
# Enable/Disable Kmesh's authz offloading in the specified kmesh daemon:
kmeshctl authz <kmesh-daemon-pod> enable/disable

# If you want to enable or disable authz offloading of all Kmeshs in the cluster
kmeshctl authz enable/disable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, this document is autogenerated by the make gen tool based on CLI command comments. Therefore, your changes will not pass the checks in the GitHub Action.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had run make gen command in my local these changes are made by that action. I thought that it would resolve ci issues...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean you submitted this PR after running make gen commands?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yaa kinda like that

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is what I get when I run make gen-check:
image

Please confirm that the changes to the c-file in PR were caused by make gen-check?

Copy link
Collaborator

@LiZhenCheng9527 LiZhenCheng9527 Feb 10, 2025

Choose a reason for hiding this comment

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

make gen-check only is a tool.
You can revert your changes, then run make gen. After that, submit your changes again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I will update this pr, actually I missed this flow initially

Copy link
Collaborator

Choose a reason for hiding this comment

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

When will this PR be updated?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This PR issue is blocking the #1237

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When will this PR be updated?

i am working on this

```
Manage xdp authz eBPF program for Kmesh's authz offloading

### Options

Expand All @@ -25,4 +11,7 @@ kmeshctl authz [flags]
### SEE ALSO

* [kmeshctl](kmeshctl.md) - Kmesh command line tools to operate and debug Kmesh
* [kmeshctl authz disable](kmeshctl_authz_disable.md) - Disable xdp authz eBPF program for Kmesh's authz offloading
* [kmeshctl authz enable](kmeshctl_authz_enable.md) - Enable xdp authz eBPF program for Kmesh's authz offloading
* [kmeshctl authz status](kmeshctl_authz_status.md) - Display the current authorization status

25 changes: 25 additions & 0 deletions docs/ctl/kmeshctl_authz_disable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## kmeshctl authz disable

Disable xdp authz eBPF program for Kmesh's authz offloading

```
kmeshctl authz disable [podNames...] [flags]
```

### Examples

```
kmeshctl authz disable
kmeshctl authz disable pod1 pod2
```

### Options

```
-h, --help help for disable
```

### SEE ALSO

* [kmeshctl authz](kmeshctl_authz.md) - Manage xdp authz eBPF program for Kmesh's authz offloading

25 changes: 25 additions & 0 deletions docs/ctl/kmeshctl_authz_enable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## kmeshctl authz enable

Enable xdp authz eBPF program for Kmesh's authz offloading

```
kmeshctl authz enable [podNames...] [flags]
```

### Examples

```
kmeshctl authz enable
kmeshctl authz enable pod1 pod2
```

### Options

```
-h, --help help for enable
```

### SEE ALSO

* [kmeshctl authz](kmeshctl_authz.md) - Manage xdp authz eBPF program for Kmesh's authz offloading

25 changes: 25 additions & 0 deletions docs/ctl/kmeshctl_authz_status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## kmeshctl authz status

Display the current authorization status

```
kmeshctl authz status [podNames...] [flags]
```

### Examples

```
kmeshctl authz status
kmeshctl authz status pod1 pod2
```

### Options

```
-h, --help help for status
```

### SEE ALSO

* [kmeshctl authz](kmeshctl_authz.md) - Manage xdp authz eBPF program for Kmesh's authz offloading

6 changes: 3 additions & 3 deletions kernel/ko_src/kmesh/kmesh_parse_protocol_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ enum kmesh_l7_msg_type { MSG_UNKNOW = 0, MSG_REQUEST, MSG_MID_REPONSE, MSG_FINAL

#define KMESH_PROTO_TYPE_WIDTH (8)

#define SET_RET_PROTO_TYPE(n, type) (n) = (((n)&0xff00) | ((u32)(type)&0xff))
#define GET_RET_PROTO_TYPE(n) ((n)&0xff)
#define SET_RET_PROTO_TYPE(n, type) (n) = (((n) & 0xff00) | ((u32)(type) & 0xff))
#define GET_RET_PROTO_TYPE(n) ((n) & 0xff)

#define SET_RET_MSG_TYPE(n, type) (n) = (((n)&0xff) | (((u32)(type)&0xff) << KMESH_PROTO_TYPE_WIDTH))
#define SET_RET_MSG_TYPE(n, type) (n) = (((n) & 0xff) | (((u32)(type) & 0xff) << KMESH_PROTO_TYPE_WIDTH))
#define GET_RET_MSG_TYPE(n) (((n) >> KMESH_PROTO_TYPE_WIDTH) & 0xff)

struct kmesh_data_node {
Expand Down
Loading