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

issue: HPCINFRA-1798 Print version information in the style CI job #159

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion .ci/matrix_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ steps:
- name: Style
enable: ${do_style}
containerSelector:
- "{name: 'toolbox', category: 'tool'}"
- "{name: 'xlio_static.tidy', category: 'tool', variant: 1}"
agentSelector:
- "{nodeLabel: 'skip-agent'}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion contrib/jenkins_tests/cov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source $(dirname $0)/globals.sh

echo "Checking for coverity ..."

COVERITY_MODULE="${COVERITY_MODULE:-tools/cov-2021.12}"
COVERITY_MODULE="${COVERITY_MODULE:-tools/cov-2023.12}"
do_module "${COVERITY_MODULE}"

cd "$WORKSPACE"
Expand Down
6 changes: 6 additions & 0 deletions contrib/jenkins_tests/style.conf
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ SpacesInSquareBrackets: false
# Parse and format C++ constructs compatible with this standard.
Standard: Cpp11

InsertBraces: true
SpaceInEmptyBlock: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1

TabWidth: 4
UseTab: Never
...
10 changes: 6 additions & 4 deletions contrib/jenkins_tests/style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ source $(dirname $0)/globals.sh

echo "Checking for codying style ..."

do_module "dev/clang-9.0.1"

cd $WORKSPACE

rm -rf $style_dir
Expand All @@ -19,6 +17,12 @@ if [ $(command -v $test_app >/dev/null 2>&1 || echo $?) ]; then
exit 1
fi

# Report system / software versions
echo 'System information:'
cat /etc/os-release
echo 'clang-format version:'
$test_app --version

style_tap=${WORKSPACE}/${prefix}/style_test.tap
rm -rf $style_tap
ln -sf $WORKSPACE/contrib/jenkins_tests/style.conf $WORKSPACE/.clang-format
Expand Down Expand Up @@ -66,8 +70,6 @@ else
fi
rc=$(($rc+$nerrors))

module unload "dev/clang-9.0.1"

do_archive "${style_dir}/*.diff"

echo "[${0##*/}]..................exit code = $rc"
Expand Down
25 changes: 20 additions & 5 deletions src/core/ib/base/verbs_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ int priv_ibv_modify_qp_to_err(struct ibv_qp *qp)
memset(&qp_attr, 0, sizeof(qp_attr));
qp_attr.qp_state = IBV_QPS_ERR;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE_EX(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE), EIO) { return -1; }
IF_VERBS_FAILURE_EX(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE), EIO)
{
return -1;
}
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END

Expand All @@ -166,7 +169,10 @@ int priv_ibv_modify_qp_to_reset(struct ibv_qp *qp)
memset(&qp_attr, 0, sizeof(qp_attr));
qp_attr.qp_state = IBV_QPS_RESET;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE)) { return -1; }
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE))
{
return -1;
}
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END
return 0;
Expand Down Expand Up @@ -213,14 +219,20 @@ int priv_ibv_modify_qp_from_init_to_rts(struct ibv_qp *qp)
memset(&qp_attr, 0, sizeof(qp_attr));
qp_attr.qp_state = IBV_QPS_RTR;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask)) { return -2; }
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask))
{
return -2;
}
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END

qp_attr.qp_state = IBV_QPS_RTS;

BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask)) { return -3; }
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask))
{
return -3;
}
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END

Expand All @@ -233,7 +245,10 @@ int priv_ibv_query_qp_state(struct ibv_qp *qp)
struct ibv_qp_attr qp_attr;
struct ibv_qp_init_attr qp_init_attr;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(ibv_query_qp(qp, &qp_attr, IBV_QP_STATE, &qp_init_attr)) { return -1; }
IF_VERBS_FAILURE(ibv_query_qp(qp, &qp_attr, IBV_QP_STATE, &qp_init_attr))
{
return -1;
}
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END
VALGRIND_MAKE_MEM_DEFINED(&qp_attr, sizeof(qp_attr));
Expand Down
12 changes: 8 additions & 4 deletions src/core/infra/DemoObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ void Demo_Observer::update_subject_1(demo_subject_1_key_t key, demo_subject_1_va
if (s1) {
s1->update_val(value); // expected output: notification msg
s1->notify_observers();
} else
} else {
printf("subject corresponding to key wasn't found\n");
}
}

void Demo_Observer::get_subject_1(demo_subject_1_key_t key)
Expand All @@ -97,8 +98,9 @@ void Demo_Observer::get_subject_1(demo_subject_1_key_t key)
if (s1) {
s1->get_val(val_s1);
printf("subject1: key = %c, val = %d\n", key, val_s1);
} else
} else {
printf("subject corresponding to key wasn't found\n");
}
}

void Demo_Observer::update_subject_2(demo_subject_2_key_t key, demo_subject_2_value_t value)
Expand All @@ -108,8 +110,9 @@ void Demo_Observer::update_subject_2(demo_subject_2_key_t key, demo_subject_2_va
if (s2) {
s2->update_val(value); // expected output: notification msg
s2->notify_observers();
} else
} else {
printf("subject corresponding to key wasn't found\n");
}
}

void Demo_Observer::get_subject_2(demo_subject_2_key_t key)
Expand All @@ -120,8 +123,9 @@ void Demo_Observer::get_subject_2(demo_subject_2_key_t key)
if (s2) {
s2->get_val(val_s2);
printf("subject2: key = %d, val = %d\n", key, val_s2);
} else
} else {
printf("subject corresponding to key wasn't found\n");
}
}

bool Demo_Observer::start_test(Demo_Coll_Mgr1 *coll_for_subjects_1,
Expand Down
2 changes: 1 addition & 1 deletion src/core/infra/sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ neigh_send_data::neigh_send_data(neigh_send_data &&snd_data)
neigh_send_data::~neigh_send_data()
{
if (m_iov.iov_base) {
delete[]((uint8_t *)m_iov.iov_base);
delete[] ((uint8_t *)m_iov.iov_base);
}

if (m_header) {
Expand Down
15 changes: 8 additions & 7 deletions src/core/iomux/epoll_wait_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,14 @@ int epoll_wait_call::get_current_events()
}

xlio_list_t<sockinfo, sockinfo::socket_fd_list_node_offset> socket_fd_list;

lock();
int i, ready_rfds = 0, ready_wfds = 0;
i = m_n_all_ready_fds;
sockinfo *p_socket_object;
ep_ready_fd_list_t::iterator iter = m_epfd_info->m_ready_fds.begin();
while (iter != m_epfd_info->m_ready_fds.end() && i < m_maxevents) {
p_socket_object = *iter;
++iter;

int i = m_n_all_ready_fds;
int ready_rfds = 0;
int ready_wfds = 0;
sockinfo *p_socket_object = m_epfd_info->m_ready_fds.front();
while (p_socket_object && i < m_maxevents) {
m_events[i].events = 0; // initialize

bool got_event = false;
Expand Down Expand Up @@ -147,6 +146,8 @@ int epoll_wait_call::get_current_events()
socket_fd_list.push_back(p_socket_object);
++i;
}

p_socket_object = m_epfd_info->m_ready_fds.next(p_socket_object);
}

m_n_ready_rfds += ready_rfds;
Expand Down
3 changes: 2 additions & 1 deletion src/core/netlink/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ int main(int argc, char *argv[])
g_vlogger_level = 3;
if (argv && argc > 1) {
int tracelevel = atoi(argv[1]);
if (tracelevel > 0 && tracelevel <= 5)
if (tracelevel > 0 && tracelevel <= 5) {
g_vlogger_level = tracelevel;
}
}
netlink_test();
return 0;
Expand Down
6 changes: 2 additions & 4 deletions src/core/sock/fd_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,9 @@ int fd_collection::del_socket(int fd, sockinfo **map_type)

void fd_collection::remove_from_all_epfds(int fd, bool passthrough)
{
epfd_info_list_t::iterator itr;

lock();
for (itr = m_epfd_lst.begin(); itr != m_epfd_lst.end(); itr++) {
itr->fd_closed(fd, passthrough);
for (epfd_info *ep = m_epfd_lst.front(); ep; ep = m_epfd_lst.next(ep)) {
ep->fd_closed(fd, passthrough);
}
unlock();

Expand Down
2 changes: 1 addition & 1 deletion src/core/sock/fd_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "iomux/epfd_info.h"
#include "utils/lock_wrapper.h"

typedef xlio_list_t<sockinfo, sockinfo::pendig_to_remove_node_offset> sock_fd_api_list_t;
typedef xlio_list_t<sockinfo, sockinfo::pending_to_remove_node_offset> sock_fd_api_list_t;
typedef xlio_list_t<epfd_info, epfd_info::epfd_info_node_offset> epfd_info_list_t;

typedef std::unordered_map<pthread_t, int> offload_thread_rule_t;
Expand Down
6 changes: 3 additions & 3 deletions src/core/sock/sockinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ class sockinfo {
SOCKINFO_DESTROYING
};

static inline size_t pendig_to_remove_node_offset(void)
static inline size_t pending_to_remove_node_offset(void)
{
return NODE_OFFSET(sockinfo, pendig_to_remove_node);
return NODE_OFFSET(sockinfo, pending_to_remove_node);
}

static inline size_t socket_fd_list_node_offset(void)
Expand Down Expand Up @@ -522,7 +522,7 @@ class sockinfo {
list_node<sockinfo, sockinfo::socket_fd_list_node_offset> socket_fd_list_node;
list_node<sockinfo, sockinfo::ep_ready_fd_node_offset> ep_ready_fd_node;
list_node<sockinfo, sockinfo::ep_info_fd_node_offset> ep_info_fd_node;
list_node<sockinfo, sockinfo::pendig_to_remove_node_offset> pendig_to_remove_node;
list_node<sockinfo, sockinfo::pending_to_remove_node_offset> pending_to_remove_node;
epoll_fd_rec m_fd_rec;
uint32_t m_epoll_event_flags = 0U;

Expand Down
13 changes: 3 additions & 10 deletions src/core/sock/sockinfo_nvme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ ssize_t sockinfo_tcp_ops_nvme::tx(xlio_tx_call_attr_t &tx_arg)
/* The new request points at a new PDU */
while (num_iovecs < msg->msg_iovlen && sndbuf_len > total_tx_length) {
size_t data_len = aux_data[num_iovecs].message_length;
/* Check if there is enough place in sndbuf for the current PDU */
if (sndbuf_len < total_tx_length + data_len) {
break;
}
total_tx_length += data_len;

/* Iterate the PDU iovecs */
Expand All @@ -123,14 +119,10 @@ ssize_t sockinfo_tcp_ops_nvme::tx(xlio_tx_call_attr_t &tx_arg)
return -1;
}
}
if (num_iovecs == 0U || total_tx_length == 0U) {
si_nvme_logerr("Found %zu iovecs with length %zu to fit in sndbuff %u", num_iovecs,
total_tx_length, sndbuf_len);
m_p_sock->set_reguired_send_block(aux_data[num_iovecs].message_length);
errno = ENOBUFS;
if (total_tx_length == 0U) {
errno = EAGAIN;
return -1;
}
m_p_sock->set_reguired_send_block(1U);

/* Update tx_arg before sending to TCP */
auto *desc = nvme_pdu_mdesc::create(num_iovecs, msg->msg_iov, aux_data,
Expand All @@ -145,6 +137,7 @@ ssize_t sockinfo_tcp_ops_nvme::tx(xlio_tx_call_attr_t &tx_arg)
tx_arg.priv.mdesc = reinterpret_cast<void *>(desc);
tx_arg.attr.iov = desc->m_iov;
tx_arg.attr.sz_iov = static_cast<ssize_t>(desc->m_num_segments);
tx_arg.xlio_flags = TX_FLAG_NO_PARTIAL_WRITE;

ssize_t ret = m_p_sock->tcp_tx(tx_arg);
if (ret < static_cast<ssize_t>(total_tx_length)) {
Expand Down
Loading