Skip to content
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
1 change: 1 addition & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[codespell]
quiet-level = 35
skip =
build/*,
subprojects/*,
ignore-words-list =
te,
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ lint:
}
@echo '[white-space]'
$Q $(all_files) | xargs devtools/check-whitespace
@echo '[comments]'
$Q $(c_src) | xargs devtools/check-comments
@echo '[codespell]'
$Q codespell *

Expand Down
10 changes: 5 additions & 5 deletions api/gr_net_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct __attribute__((aligned(2))) rte_ether_addr {
uint8_t addr_bytes[RTE_ETHER_ADDR_LEN];
};

/* ICMP packet types */
// ICMP packet types
#define RTE_ICMP_TYPE_ECHO_REPLY 0
#define RTE_ICMP_TYPE_DEST_UNREACHABLE 3
#define RTE_ICMP_TYPE_REDIRECT 5
Expand All @@ -41,25 +41,25 @@ struct __attribute__((aligned(2))) rte_ether_addr {
#define RTE_ICMP_TYPE_TIMESTAMP_REQUEST 13
#define RTE_ICMP_TYPE_TIMESTAMP_REPLY 14

/* Destination Unreachable codes */
// Destination Unreachable codes
#define RTE_ICMP_CODE_UNREACH_NET 0
#define RTE_ICMP_CODE_UNREACH_HOST 1
#define RTE_ICMP_CODE_UNREACH_PROTO 2
#define RTE_ICMP_CODE_UNREACH_PORT 3
#define RTE_ICMP_CODE_UNREACH_FRAG 4
#define RTE_ICMP_CODE_UNREACH_SRC 5

/* Time Exceeded codes */
// Time Exceeded codes
#define RTE_ICMP_CODE_TTL_EXCEEDED 0
#define RTE_ICMP_CODE_TTL_FRAG 1

/* Redirect codes */
// Redirect codes
#define RTE_ICMP_CODE_REDIRECT_NET 0
#define RTE_ICMP_CODE_REDIRECT_HOST 1
#define RTE_ICMP_CODE_REDIRECT_TOS_NET 2
#define RTE_ICMP_CODE_REDIRECT_TOS_HOST 3

/* ICMPv6 packet types */
// ICMPv6 packet types
#define ICMP6_TYPE_ERR_DEST_UNREACH 1
#define ICMP6_TYPE_ERR_PKT_TOO_BIG 2
#define ICMP6_TYPE_ERR_TTL_EXCEEDED 3
Expand Down
6 changes: 3 additions & 3 deletions cli/ec_node_devargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static int ec_node_devargs_complete(
dir = NULL;

skip_pci:
/* see dpdk fsml_bus.c:rte_fslmc_scan() without rte_ specific code */
// see dpdk fsml_bus.c:rte_fslmc_scan() without rte_ specific code
char fslmc_dirpath[PATH_MAX];
const char *group_name;

Expand All @@ -113,10 +113,10 @@ static int ec_node_devargs_complete(
if (!ec_str_startswith(buf2, word))
continue;

/* Parse the device name, ignore ID */
// Parse the device name, ignore ID
if (strncmp("dpni.", de->d_name, 5))
continue;
/* dev_type is DPAA2_ETH, but driver shall be vfio-fsl-mc */
// dev_type is DPAA2_ETH, but driver shall be vfio-fsl-mc
snprintf(buf, sizeof(buf), "%s/%s", de->d_name, "driver");
if ((dir_fd = dirfd(dir)) < 0)
continue;
Expand Down
42 changes: 42 additions & 0 deletions devtools/check-comments
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/awk -f
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2025 Robin Jarry

BEGIN {
isatty = system("test -t 1") == "0"
retcode = 0
}

function color(code, s) {
if (isatty) {
return "\033[" code "m" s "\033[0m"
}
return s
}
function red(s) { return color("31", s) }
function green(s) { return color("32", s) }
function magenta(s) { return color("35", s) }
function cyan(s) { return color("36", s) }
function bg_red(s) { return color("41", s) }
function hl_ws(s, pattern) {
gsub(pattern, bg_red("&"), s)
# convert tab characters to 8 spaces to allow coloring
gsub(/\t/, " ", s)
return s
}

/^[ \t]*\/\*.*\*\/[ \t]*$/ {
retcode = 1
print magenta(FILENAME) cyan(":") green(FNR) cyan(":") \
hl_ws($0, "\\/\\*.*\\*\\/") red("<-- C block comment used")
}

/\/\*\**$/ {
retcode = 1
print magenta(FILENAME) cyan(":") green(FNR) cyan(":") \
hl_ws($0, "\\/\\*\\**$") red("<-- C block comment used")
}

END {
exit retcode
}
4 changes: 2 additions & 2 deletions frr/zebra_dplane_grout.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct grout_ctx_t {
struct gr_api_client *dplane_notifs;
struct gr_api_client *zebra_notifs;

/* Event/'thread' pointer for queued updates */
// Event/'thread' pointer for queued updates
struct event *dg_t_zebra_update;
struct event *dg_t_dplane_update;
};
Expand Down Expand Up @@ -367,7 +367,7 @@ static void zebra_read_notifications(struct event *event) {
);
}

/* Grout provider callback. */
// Grout provider callback.
static enum zebra_dplane_result zd_grout_process_update(struct zebra_dplane_ctx *ctx) {
switch (dplane_ctx_get_op(ctx)) {
case DPLANE_OP_ADDR_INSTALL:
Expand Down
2 changes: 1 addition & 1 deletion modules/ip6/api/gr_ip6.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct gr_ip6_icmp_send_req {
uint8_t ttl;
};

/* struct gr_ip6_icmp_send_resp { } */
// struct gr_ip6_icmp_send_resp { };

#define GR_IP6_ICMP6_RECV REQUEST_TYPE(GR_IP6_MODULE, 0x0042)

Expand Down