From cc9eb2ce811bb9990037141a114f7337086c6043 Mon Sep 17 00:00:00 2001 From: Avinash Repaka Date: Wed, 18 May 2016 15:09:05 -0700 Subject: [PATCH] RDS: Move rds_rtd definitions from rds_rt_debug files to common files This patch moves rds_rtd definitions from rds_rtd_debug.h to rds.h and rds_rt_debug_bitmap modparam definition from rds_rt_debug.c to af_rds.c. The patch removes rds_rt_debug files since there isn't much content in these files to be held separately. Commit 'ib/rds: runtime debuggability enhancement' originally defined rds_rtd definitions. Orabug: 23294707 Signed-off-by: Avinash Repaka Acked-by: Santosh Shilimkar --- net/rds/Makefile | 2 +- net/rds/af_rds.c | 6 ++++++ net/rds/rds.h | 38 ++++++++++++++++++++++++++++++++++++- net/rds/rds_rt_debug.c | 43 ------------------------------------------ net/rds/rds_rt_debug.h | 43 ------------------------------------------ 5 files changed, 44 insertions(+), 88 deletions(-) delete mode 100644 net/rds/rds_rt_debug.c delete mode 100644 net/rds/rds_rt_debug.h diff --git a/net/rds/Makefile b/net/rds/Makefile index 60fb4029e0a5..56d3f6023ced 100644 --- a/net/rds/Makefile +++ b/net/rds/Makefile @@ -1,7 +1,7 @@ obj-$(CONFIG_RDS) += rds.o rds-y := af_rds.o bind.o cong.o connection.o info.o message.o \ recv.o send.o stats.o sysctl.o threads.o transport.o \ - loop.o page.o rdma.o rds_rt_debug.o + loop.o page.o rdma.o obj-$(CONFIG_RDS_RDMA) += rds_rdma.o rds_rdma-y := rdma_transport.o \ diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 9aa99921ce29..0adf3af3d01d 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -55,6 +55,12 @@ module_param(rds_qos_threshold_action, int, 0444); MODULE_PARM_DESC(rds_qos_threshold_action, "0=Ignore,1=Error,2=Statistic,3=Error_Statistic"); +u32 kernel_rds_rt_debug_bitmap = 0x488B; +EXPORT_SYMBOL(kernel_rds_rt_debug_bitmap); +module_param_named(rds_rt_debug_bitmap, kernel_rds_rt_debug_bitmap, uint, 0644); +MODULE_PARM_DESC(rds_rt_debug_bitmap, + "RDS Runtime Debug Message Enabling Bitmap [default 0x488B]"); + static unsigned long rds_qos_threshold_tbl[256]; char *rds_str_array(char **array, size_t elements, size_t index) diff --git a/net/rds/rds.h b/net/rds/rds.h index 8810398e2472..b18ce4848cb8 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -11,7 +11,6 @@ #include #include "info.h" -#include "rds_rt_debug.h" /* * RDS Network protocol version @@ -51,6 +50,43 @@ rdsdebug(char *fmt, ...) } #endif +extern u32 kernel_rds_rt_debug_bitmap; +enum { + /* bit 0 ~ 19 are feature related bits */ + RDS_RTD_ERR = 1 << 0, /* 0x1 */ + RDS_RTD_ERR_EXT = 1 << 1, /* 0x2 */ + + RDS_RTD_CM = 1 << 3, /* 0x8 */ + RDS_RTD_CM_EXT = 1 << 4, /* 0x10 */ + RDS_RTD_CM_EXT_P = 1 << 5, /* 0x20 */ + + RDS_RTD_ACT_BND = 1 << 7, /* 0x80 */ + RDS_RTD_ACT_BND_EXT = 1 << 8, /* 0x100 */ + + RDS_RTD_RCV = 1 << 11, /* 0x800 */ + RDS_RTD_RCV_EXT = 1 << 12, /* 0x1000 */ + + RDS_RTD_SND = 1 << 14, /* 0x4000 */ + RDS_RTD_SND_EXT = 1 << 15, /* 0x8000 */ + RDS_RTD_FLOW_CNTRL = 1 << 16, /* 0x10000 */ + + /* bit 20 ~ 31 are module specific bits */ + RDS_RTD_CORE = 1 << 20, /* 0x100000 */ + RDS_RTD_RDMA_IB = 1 << 23, /* 0x800000 */ + + /* the following are placeholders for now */ + RDS_RTD_RDMA_IW = 1 << 26, /* 0x4000000 */ + RDS_RTD_TCP = 1 << 28, /* 0x10000000 */ +}; + +#define rds_rtd_printk(format, arg...) \ + trace_printk("%d: " format, __LINE__, ## arg) + +#define rds_rtd(enabling_bit, format, arg...) \ + do { if (likely(!(enabling_bit & kernel_rds_rt_debug_bitmap))) break;\ + rds_rtd_printk(format, ## arg); \ + } while (0) + /* XXX is there one of these somewhere? */ #define ceil(x, y) \ ({ unsigned long __x = (x), __y = (y); (__x + __y - 1) / __y; }) diff --git a/net/rds/rds_rt_debug.c b/net/rds/rds_rt_debug.c deleted file mode 100644 index 61ae1179cd59..000000000000 --- a/net/rds/rds_rt_debug.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2015 Oracle. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ -#include - -#include "rds.h" -#include "rds_rt_debug.h" - -u32 kernel_rds_rt_debug_bitmap = 0x488B; -EXPORT_SYMBOL(kernel_rds_rt_debug_bitmap); - -module_param_named(rds_rt_debug_bitmap, kernel_rds_rt_debug_bitmap, uint, 0644); -MODULE_PARM_DESC(rds_rt_debug_bitmap, "RDS Runtime Debug Message Enabling Bitmap [default 0x488B]"); - diff --git a/net/rds/rds_rt_debug.h b/net/rds/rds_rt_debug.h deleted file mode 100644 index e75a48ff0f29..000000000000 --- a/net/rds/rds_rt_debug.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _RDS_RT_DEBUG_H -#define _RDS_RT_DEBUG_H - -extern u32 kernel_rds_rt_debug_bitmap; - -enum { - /* bit 0 ~ 19 are feature related bits */ - RDS_RTD_ERR = 1 << 0, /* 0x1 */ - RDS_RTD_ERR_EXT = 1 << 1, /* 0x2 */ - - RDS_RTD_CM = 1 << 3, /* 0x8 */ - RDS_RTD_CM_EXT = 1 << 4, /* 0x10 */ - RDS_RTD_CM_EXT_P = 1 << 5, /* 0x20 */ - - RDS_RTD_ACT_BND = 1 << 7, /* 0x80 */ - RDS_RTD_ACT_BND_EXT = 1 << 8, /* 0x100 */ - - RDS_RTD_RCV = 1 << 11, /* 0x800 */ - RDS_RTD_RCV_EXT = 1 << 12, /* 0x1000 */ - - RDS_RTD_SND = 1 << 14, /* 0x4000 */ - RDS_RTD_SND_EXT = 1 << 15, /* 0x8000 */ - RDS_RTD_FLOW_CNTRL = 1 << 16, /* 0x10000 */ - - /* bit 20 ~ 31 are module specific bits */ - RDS_RTD_CORE = 1 << 20, /* 0x100000 */ - RDS_RTD_RDMA_IB = 1 << 23, /* 0x800000 */ - - /* the following are placeholders for now */ - RDS_RTD_RDMA_IW = 1 << 26, /* 0x4000000 */ - RDS_RTD_TCP = 1 << 28, /* 0x10000000 */ -}; - -#define rds_rtd_printk(format, arg...) \ - trace_printk("%d: " format, __LINE__, ## arg) - -#define rds_rtd(enabling_bit, format, arg...) \ - do { if (likely(!(enabling_bit & kernel_rds_rt_debug_bitmap))) break; \ - rds_rtd_printk(format, ## arg); \ - } while (0) - -#endif /* _RDS_RT_DEBUG_H */ - -- 2.50.1