Skip to content

Commit

Permalink
RDMA/rtrs: private headers with rtrs protocol structs and helpers
Browse files Browse the repository at this point in the history
These are common private headers with rtrs protocol structures, logging,
sysfs and other helper functions, which are used on both client and server
sides.

Link: https://lore.kernel.org/r/20200511135131.27580-4-danil.kipnis@cloud.ionos.com
Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Jack Wang authored and Jason Gunthorpe committed May 17, 2020
1 parent b5c27cd commit 91fdded
Show file tree
Hide file tree
Showing 2 changed files with 427 additions and 0 deletions.
28 changes: 28 additions & 0 deletions drivers/infiniband/ulp/rtrs/rtrs-log.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* RDMA Transport Layer
*
* Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights reserved.
* Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights reserved.
* Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved.
*/
#ifndef RTRS_LOG_H
#define RTRS_LOG_H

#define rtrs_log(fn, obj, fmt, ...) \
fn("<%s>: " fmt, obj->sessname, ##__VA_ARGS__)

#define rtrs_err(obj, fmt, ...) \
rtrs_log(pr_err, obj, fmt, ##__VA_ARGS__)
#define rtrs_err_rl(obj, fmt, ...) \
rtrs_log(pr_err_ratelimited, obj, fmt, ##__VA_ARGS__)
#define rtrs_wrn(obj, fmt, ...) \
rtrs_log(pr_warn, obj, fmt, ##__VA_ARGS__)
#define rtrs_wrn_rl(obj, fmt, ...) \
rtrs_log(pr_warn_ratelimited, obj, fmt, ##__VA_ARGS__)
#define rtrs_info(obj, fmt, ...) \
rtrs_log(pr_info, obj, fmt, ##__VA_ARGS__)
#define rtrs_info_rl(obj, fmt, ...) \
rtrs_log(pr_info_ratelimited, obj, fmt, ##__VA_ARGS__)

#endif /* RTRS_LOG_H */
Loading

0 comments on commit 91fdded

Please sign in to comment.