From 4e1292eb75b91aeff20e0e201af05f9f25f6b170 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Tue, 21 Feb 2012 09:46:52 +0800 Subject: [PATCH] LU-1116 kernel: Support RHEL6.2 patchless client. Update RHEL6.2 kernel to 2.6.32-220.4.2(client). Signed-off-by: yang sheng Change-Id: I654d8d56b14196acf8d27b31a5af8c34812d8b99 Reviewed-on: http://review.whamcloud.com/2171 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Johann Lombardi --- lnet/autoconf/lustre-lnet.m4 | 20 ++++++++++++++++++-- lnet/klnds/o2iblnd/o2iblnd.c | 3 ++- lnet/klnds/o2iblnd/o2iblnd.h | 6 ++++++ lnet/klnds/o2iblnd/o2iblnd_cb.c | 4 +++- lustre/ChangeLog | 6 +++++- lustre/autoconf/lustre-core.m4 | 13 ++++++++----- lustre/kernel_patches/targets/2.6-rhel6.target.in | 2 +- lustre/mdc/mdc_locks.c | 7 ++++--- 8 files changed, 47 insertions(+), 14 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 6b037c3..a2cfd57 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -499,6 +499,7 @@ AC_SUBST(MXLND) # LN_CONFIG_O2IB # AC_DEFUN([LN_CONFIG_O2IB],[ + AC_MSG_CHECKING([whether to enable OpenIB gen2 support]) # set default AC_ARG_WITH([o2ib], @@ -571,8 +572,7 @@ else struct ib_pool_fmr pool_fmr; enum ib_cm_rej_reason rej_reason; - cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); - return PTR_ERR(cm_id); + rdma_destroy_id(NULL); ],[ AC_MSG_RESULT([yes]) O2IBLND="o2iblnd" @@ -620,6 +620,22 @@ fi AC_SUBST(EXTRA_LNET_INCLUDE) AC_SUBST(O2IBCPPFLAGS) AC_SUBST(O2IBLND) + +# In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument +if test $ENABLEO2IB -ne 0; then + AC_MSG_CHECKING([if rdma_create_id wants four args]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + rdma_create_id(NULL, NULL, 0, 0); + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1, + [rdma_create_id wants 4 args]) + ],[ + AC_MSG_RESULT([no]) + ]) +fi ]) # diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index ab2803e..21746fb 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -2513,7 +2513,8 @@ kiblnd_startup (lnet_ni_t *ni) ibdev->ibd_ifip = ip; strcpy(&ibdev->ibd_ifname[0], ifname); - id = rdma_create_id(kiblnd_cm_callback, ibdev, RDMA_PS_TCP); + id = kiblnd_rdma_create_id(kiblnd_cm_callback, ibdev, + RDMA_PS_TCP, IB_QPT_RC); if (IS_ERR(id)) { CERROR("Can't create listen ID: %ld\n", PTR_ERR(id)); goto failed; diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index a9b0d7e..a5ad46d 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -145,6 +145,12 @@ extern kib_tunables_t kiblnd_tunables; IBLND_CREDIT_HIGHWATER_V1 : \ *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */ +#ifdef HAVE_RDMA_CREATE_ID_4ARG +#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt) +#else +#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps) +#endif + static inline int kiblnd_concurrent_sends_v1(void) { diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index ec5ce4f..eb567a5 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -1210,7 +1210,9 @@ kiblnd_connect_peer (kib_peer_t *peer) LASSERT (net != NULL); LASSERT (peer->ibp_connecting > 0); - cmid = rdma_create_id(kiblnd_cm_callback, peer, RDMA_PS_TCP); + cmid = kiblnd_rdma_create_id(kiblnd_cm_callback, peer, RDMA_PS_TCP, + IB_QPT_RC); + if (IS_ERR(cmid)) { CERROR("Can't create CMID for %s: %ld\n", libcfs_nid2str(peer->ibp_nid), PTR_ERR(cmid)); diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 3560ddf..2535ac8 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -2,11 +2,15 @@ * version 1.8.8-wc1 * Support for kernels: 2.6.18-274.3.1.el5 (RHEL 5) - 2.6.32-131.12.1.el6 (RHEL 6) - patchless client only + 2.6.32-220.4.2.el6 (RHEL 6) - patchless client only * Recommended e2fsprogs version: 1.41.90.wc3 See http://wiki.whamcloud.com/display/PUB/Changelog+1.8 for more information. +Severity : enhancement +Jira : LU-1116 +Description: Add patchless client support for RHEL6.2. + ------------------------------------------------------------------------------- 2011-10-31 Whamcloud, Inc. diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index d8a7461..74552bd 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -583,22 +583,25 @@ LB_LINUX_TRY_COMPILE([ # # LC_STATFS_DENTRY_PARAM -# starting from 2.6.18 linux kernel uses dentry instead of -# super_block for first vfs_statfs argument +# starting from 2.6.18 linux kernel uses dentry instead of super_block +# for the first parameter of the super_operations->statfs() callback. # AC_DEFUN([LC_STATFS_DENTRY_PARAM], -[AC_MSG_CHECKING([first vfs_statfs parameter is dentry]) +[AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry]) +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-Werror" LB_LINUX_TRY_COMPILE([ #include ],[ - int vfs_statfs(struct dentry *, struct kstatfs *); + ((struct super_operations *)0)->statfs((struct dentry *)0, (struct kstatfs*)0); ],[ AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1, - [first parameter of vfs_statfs is dentry]) + [super_ops.statfs() first parameter is dentry]) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) +EXTRA_KCFLAGS="$tmp_flags" ]) # diff --git a/lustre/kernel_patches/targets/2.6-rhel6.target.in b/lustre/kernel_patches/targets/2.6-rhel6.target.in index 4a4c3e6..0a98ab5 100644 --- a/lustre/kernel_patches/targets/2.6-rhel6.target.in +++ b/lustre/kernel_patches/targets/2.6-rhel6.target.in @@ -1,5 +1,5 @@ lnxmaj="2.6.32" -lnxrel="131.12.1.el6" +lnxrel="220.4.2.el6" KERNEL_SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm EXTRA_VERSION=${lnxrel}_lustre.@VERSION@ diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 68382e8..fceff9e 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -185,7 +185,7 @@ static inline void mdc_clear_replay_flag(struct ptlrpc_request *req, int rc) } } -static int round_up(int val) +static int l_round_up(int val) { int ret = 1; while (val) { @@ -301,8 +301,9 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp, rc = lustre_msg_size(class_exp2cliimp(exp)->imp_msg_magic, bufcount, size); if (rc & (rc - 1)) - size[bufcount - 1] = min(size[bufcount - 1] + round_up(rc) - rc, - (__u32)obddev->u.cli.cl_max_mds_easize); + size[bufcount - 1] = min(size[bufcount - 1] + + l_round_up(rc) - rc, + (__u32)obddev->u.cli.cl_max_mds_easize); /* If inode is known, cancel conflicting OPEN locks. */ if (data->fid2.id) { -- 1.8.3.1