All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: rbd option listing and tcp_nodelay support
@ 2015-01-21 19:00 Chaitanya Huilgol
  2015-01-21 19:18 ` Ilya Dryomov
  0 siblings, 1 reply; 18+ messages in thread
From: Chaitanya Huilgol @ 2015-01-21 19:00 UTC (permalink / raw)
  To: ceph-devel

From: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>

Option keys supported by libceph and rbd modules is readable
as a comma separated string via /sys/bus/rbd/options read-only
interface. This will allow user app (rbd cli) to check for
supported option keys before passing options to the kernel and
remain compatible with older kernels which do not support a
particular feature.
Messenger specific options moved to messenger layer.
tcp_nodelay(default)/no_tcp_nodelay option added for setting
TCP_NODELAY on messenger socket connections. Covers both rbd
and cephfs

Signed-off-by: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>
---
 drivers/block/rbd.c            | 21 +++++++++++++++++
 fs/ceph/super.c                |  5 +++-
 include/linux/ceph/libceph.h   |  5 ++--
 include/linux/ceph/messenger.h | 26 +++++++++++++++++++--
 net/ceph/ceph_common.c         | 52 ++++++++++++++++++++++++++++++++++++++----
 net/ceph/messenger.c           | 33 ++++++++++++++++++++++-----
 6 files changed, 126 insertions(+), 16 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e818c2a..507fd16 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -423,6 +423,7 @@ static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf,
 				    size_t count);
 static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf,
 				       size_t count);
+static ssize_t rbd_enumerate_options(struct bus_type *bus, char *buf);
 static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping);
 static void rbd_spec_put(struct rbd_spec *spec);
 
@@ -440,12 +441,14 @@ static BUS_ATTR(add, S_IWUSR, NULL, rbd_add);
 static BUS_ATTR(remove, S_IWUSR, NULL, rbd_remove);
 static BUS_ATTR(add_single_major, S_IWUSR, NULL, rbd_add_single_major);
 static BUS_ATTR(remove_single_major, S_IWUSR, NULL, rbd_remove_single_major);
+static BUS_ATTR(options, S_IRUSR, rbd_enumerate_options, NULL);
 
 static struct attribute *rbd_bus_attrs[] = {
 	&bus_attr_add.attr,
 	&bus_attr_remove.attr,
 	&bus_attr_add_single_major.attr,
 	&bus_attr_remove_single_major.attr,
+	&bus_attr_options.attr,
 	NULL,
 };
 
@@ -746,6 +749,12 @@ static match_table_t rbd_opts_tokens = {
 	{-1, NULL}
 };
 
+/*
+ * Supported options comma separated string. Readable by the rbd cli, so that
+ * an informed decision can be made on passing options to the kernel modules.
+ */
+static const char *rbd_supported_option_keys = "rw";
+
 struct rbd_options {
 	bool	read_only;
 };
@@ -5569,6 +5578,18 @@ static ssize_t rbd_remove_single_major(struct bus_type *bus,
 	return do_rbd_remove(bus, buf, count);
 }
 
+static ssize_t rbd_enumerate_options(struct bus_type *bus,
+		char *buf)
+{
+	ssize_t sz;
+	sz = snprintf(buf, PAGE_SIZE, "%s", rbd_supported_option_keys);
+	if ((sz + 1) < PAGE_SIZE) {
+		sz += snprintf (buf + sz, PAGE_SIZE - sz, ",%s",
+			ceph_get_supported_options());
+	}
+	sz += 1; /* '0' String Termination */
+	return sz;
+}
 /*
  * create control files in sysfs
  * /sys/bus/rbd/...
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 50f06cd..4632ae4 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -423,7 +423,10 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 		seq_printf(m, ",fsid=%pU", &opt->fsid);
 	if (opt->flags & CEPH_OPT_NOSHARE)
 		seq_puts(m, ",noshare");
-	if (opt->flags & CEPH_OPT_NOCRC)
+	if (ceph_test_msgr_opt(&opt->msgr_options,
+			CEPH_MSGR_OPT_NO_TCP_NODELAY))
+		seq_puts(m, ",no_tcp_nodelay");
+	if (ceph_test_msgr_opt(&opt->msgr_options, CEPH_MSGR_OPT_NOCRC))
 		seq_puts(m, ",nocrc");
 
 	if (opt->name)
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 8b11a79..9306a47 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -28,8 +28,7 @@
 #define CEPH_OPT_FSID             (1<<0)
 #define CEPH_OPT_NOSHARE          (1<<1) /* don't share client with other sbs */
 #define CEPH_OPT_MYIP             (1<<2) /* specified my ip */
-#define CEPH_OPT_NOCRC            (1<<3) /* no data crc on writes */
-#define CEPH_OPT_NOMSGAUTH	  (1<<4) /* not require cephx message signature */
+#define CEPH_OPT_NOMSGAUTH	  (1<<3) /* not require cephx message signature */
 
 #define CEPH_OPT_DEFAULT   (0)
 
@@ -42,6 +41,7 @@ struct ceph_options {
 	int flags;
 	struct ceph_fsid fsid;
 	struct ceph_entity_addr my_addr;
+	struct ceph_messenger_options msgr_options;
 	int mount_timeout;
 	int osd_idle_ttl;
 	int osd_keepalive_timeout;
@@ -190,6 +190,7 @@ extern struct ceph_options *ceph_parse_options(char *options,
 			      const char *dev_name, const char *dev_name_end,
 			      int (*parse_extra_token)(char *c, void *private),
 			      void *private);
+extern const char* ceph_get_supported_options(void);
 extern void ceph_destroy_options(struct ceph_options *opt);
 extern int ceph_compare_options(struct ceph_options *new_opt,
 				struct ceph_client *client);
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index d9d396c..471f622 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -51,12 +51,34 @@ struct ceph_connection_operations {
 /* use format string %s%d */
 #define ENTITY_NAME(n) ceph_entity_type_name((n).type), le64_to_cpu((n).num)
 
+/*
+ * Messenger specific ceph options
+ */
+struct ceph_messenger_options {
+	u32 flags;
+};
+
+#define CEPH_MSGR_OPT_NOCRC          (1<<0) /* no data crc on writes */
+#define CEPH_MSGR_OPT_NO_TCP_NODELAY (1<<1) /* No TCP_NODELAY on con sock */
+#define CEPH_MSGR_OPT_DEFAULT        (0)
+
+#define ceph_messenger_options_init(_msgr_opts)  \
+	((_msgr_opts)->flags = CEPH_MSGR_OPT_DEFAULT)
+
+#define ceph_set_msgr_opt(_msgr_opts, _opt) \
+	((_msgr_opts)->flags |= _opt)
+#define ceph_clr_msgr_opt(_msgr_opts, _opt) \
+	((_msgr_opts)->flags &= ~(_opt))
+#define ceph_test_msgr_opt(_msgr_opts, _opt) \
+	(!!((_msgr_opts)->flags & (_opt)))
+
+
 struct ceph_messenger {
 	struct ceph_entity_inst inst;    /* my name+address */
 	struct ceph_entity_addr my_enc_addr;
 
 	atomic_t stopping;
-	bool nocrc;
+	struct ceph_messenger_options *options;
 
 	/*
 	 * the global_seq counts connections i (attempt to) initiate
@@ -264,7 +286,7 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr,
 			struct ceph_entity_addr *myaddr,
 			u64 supported_features,
 			u64 required_features,
-			bool nocrc);
+			struct ceph_messenger_options *msgr_options);
 
 extern void ceph_con_init(struct ceph_connection *con, void *private,
 			const struct ceph_connection_operations *ops,
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 5d5ab67..25f1515 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -239,6 +239,8 @@ enum {
 	Opt_nocrc,
 	Opt_cephx_require_signatures,
 	Opt_nocephx_require_signatures,
+	Opt_tcp_nodelay,
+	Opt_no_tcp_nodelay,
 };
 
 static match_table_t opt_tokens = {
@@ -259,8 +261,28 @@ static match_table_t opt_tokens = {
 	{Opt_nocrc, "nocrc"},
 	{Opt_cephx_require_signatures, "cephx_require_signatures"},
 	{Opt_nocephx_require_signatures, "nocephx_require_signatures"},
+	{Opt_tcp_nodelay, "tcp_nodelay"},
+	{Opt_no_tcp_nodelay, "no_tcp_nodelay"},
 	{-1, NULL}
 };
+/*
+ * Supported option keys. Readable by the rbd cli, so that an informed
+ * decision can be made on passing options to the kernel modules.
+ */
+static const char *libceph_supported_options_keys =
+	"osdtimeout,"
+	"osdkeepalive,"
+	"mount_timeout,"
+	"osd_idle_ttl,"
+	"fsid,"
+	"name,"
+	"secret,"
+	"key,"
+	"ip,"
+	"share,"
+	"crc,"
+	"cephx_require_signatures,"
+	"tcp_nodelay";
 
 void ceph_destroy_options(struct ceph_options *opt)
 {
@@ -320,8 +342,7 @@ out:
 	return err;
 }
 
-struct ceph_options *
-ceph_parse_options(char *options, const char *dev_name,
+struct ceph_options * ceph_parse_options(char *options, const char *dev_name,
 			const char *dev_name_end,
 			int (*parse_extra_token)(char *c, void *private),
 			void *private)
@@ -350,6 +371,7 @@ ceph_parse_options(char *options, const char *dev_name,
 	opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT;
 	opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; /* seconds */
 	opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT;   /* seconds */
+	ceph_messenger_options_init(&opt->msgr_options);
 
 	/* get mon ip(s) */
 	/* ip1[:port1][,ip2[:port2]...] */
@@ -452,11 +474,14 @@ ceph_parse_options(char *options, const char *dev_name,
 			break;
 
 		case Opt_crc:
-			opt->flags &= ~CEPH_OPT_NOCRC;
+			ceph_clr_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NOCRC);
 			break;
 		case Opt_nocrc:
-			opt->flags |= CEPH_OPT_NOCRC;
+			ceph_set_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NOCRC);
 			break;
+
 		case Opt_cephx_require_signatures:
 			opt->flags &= ~CEPH_OPT_NOMSGAUTH;
 			break;
@@ -464,6 +489,15 @@ ceph_parse_options(char *options, const char *dev_name,
 			opt->flags |= CEPH_OPT_NOMSGAUTH;
 			break;
 
+		case Opt_tcp_nodelay:
+			ceph_clr_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NO_TCP_NODELAY);
+			break;
+		case Opt_no_tcp_nodelay:
+			ceph_set_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NO_TCP_NODELAY);
+			break;
+
 		default:
 			BUG_ON(token);
 		}
@@ -478,6 +512,14 @@ out:
 }
 EXPORT_SYMBOL(ceph_parse_options);
 
+
+const char* ceph_get_supported_options(void)
+{
+    return  libceph_supported_options_keys;
+}
+EXPORT_SYMBOL(ceph_get_supported_options);
+
+
 u64 ceph_client_id(struct ceph_client *client)
 {
 	return client->monc.auth->global_id;
@@ -521,7 +563,7 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private,
 	ceph_messenger_init(&client->msgr, myaddr,
 		client->supported_features,
 		client->required_features,
-		ceph_test_opt(client, NOCRC));
+		&opt->msgr_options);
 
 	/* subsystems */
 	err = ceph_monc_init(&client->monc, client);
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 33a2f20..9a056fe 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -469,6 +469,21 @@ static void set_sock_callbacks(struct socket *sock,
 /*
  * socket helpers
  */
+static void ceph_tcp_set_sock_options(struct ceph_connection *con)
+{
+	int rc;
+
+	if (!ceph_test_msgr_opt(con->msgr->options,
+		CEPH_MSGR_OPT_NO_TCP_NODELAY)) {
+		/* Not requested to disable TCP_NODELAY, set it by default */
+		int optval = 1;
+		rc = kernel_setsockopt(con->sock, IPPROTO_TCP, TCP_NODELAY,
+		    (char *)&optval, sizeof(optval));
+		if (rc != 0) {
+			pr_warn("Warn: CEPH_CON_OPT: TCP_NODELAY: Fails=%d\n", rc);
+		}
+	}
+}
 
 /*
  * initiate connection to a remote socket.
@@ -513,6 +528,9 @@ static int ceph_tcp_connect(struct ceph_connection *con)
 	sk_set_memalloc(sock->sk);
 
 	con->sock = sock;
+	/* process socket options if any */
+	ceph_tcp_set_sock_options(con);
+
 	return 0;
 }
 
@@ -749,7 +767,6 @@ void ceph_con_init(struct ceph_connection *con, void *private,
 }
 EXPORT_SYMBOL(ceph_con_init);
 
-
 /*
  * We maintain a global counter to order connection attempts.  Get
  * a unique seq greater than @gt.
@@ -1511,7 +1528,8 @@ static int write_partial_message_data(struct ceph_connection *con)
 {
 	struct ceph_msg *msg = con->out_msg;
 	struct ceph_msg_data_cursor *cursor = &msg->cursor;
-	bool do_datacrc = !con->msgr->nocrc;
+	bool do_datacrc = !ceph_test_msgr_opt(con->msgr->options,
+				CEPH_MSGR_OPT_NOCRC);
 	u32 crc;
 
 	dout("%s %p msg %p\n", __func__, con, msg);
@@ -2212,7 +2230,8 @@ static int read_partial_msg_data(struct ceph_connection *con)
 {
 	struct ceph_msg *msg = con->in_msg;
 	struct ceph_msg_data_cursor *cursor = &msg->cursor;
-	const bool do_datacrc = !con->msgr->nocrc;
+	const bool do_datacrc = !ceph_test_msgr_opt(con->msgr->options,
+				CEPH_MSGR_OPT_NOCRC);
 	struct page *page;
 	size_t page_offset;
 	size_t length;
@@ -2258,7 +2277,8 @@ static int read_partial_message(struct ceph_connection *con)
 	int end;
 	int ret;
 	unsigned int front_len, middle_len, data_len;
-	bool do_datacrc = !con->msgr->nocrc;
+	bool do_datacrc = !ceph_test_msgr_opt(con->msgr->options,
+				CEPH_MSGR_OPT_NOCRC);
 	bool need_sign = (con->peer_features & CEPH_FEATURE_MSG_AUTH);
 	u64 seq;
 	u32 crc;
@@ -2922,7 +2942,7 @@ void ceph_messenger_init(struct ceph_messenger *msgr,
 			struct ceph_entity_addr *myaddr,
 			u64 supported_features,
 			u64 required_features,
-			bool nocrc)
+			struct ceph_messenger_options *msgr_options)
 {
 	msgr->supported_features = supported_features;
 	msgr->required_features = required_features;
@@ -2936,7 +2956,8 @@ void ceph_messenger_init(struct ceph_messenger *msgr,
 	msgr->inst.addr.type = 0;
 	get_random_bytes(&msgr->inst.addr.nonce, sizeof(msgr->inst.addr.nonce));
 	encode_my_addr(msgr);
-	msgr->nocrc = nocrc;
+	BUG_ON(msgr_options == NULL);
+	msgr->options = msgr_options;
 
 	atomic_set(&msgr->stopping, 0);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-21 19:00 [PATCH] ceph: rbd option listing and tcp_nodelay support Chaitanya Huilgol
@ 2015-01-21 19:18 ` Ilya Dryomov
  2015-01-21 19:29   ` Somnath Roy
  0 siblings, 1 reply; 18+ messages in thread
From: Ilya Dryomov @ 2015-01-21 19:18 UTC (permalink / raw)
  To: Chaitanya Huilgol; +Cc: Ceph Development

On Wed, Jan 21, 2015 at 10:00 PM, Chaitanya Huilgol
<chaitanya.huilgol@gmail.com> wrote:
> From: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>
>
> Option keys supported by libceph and rbd modules is readable
> as a comma separated string via /sys/bus/rbd/options read-only
> interface. This will allow user app (rbd cli) to check for
> supported option keys before passing options to the kernel and
> remain compatible with older kernels which do not support a
> particular feature.
> Messenger specific options moved to messenger layer.
> tcp_nodelay(default)/no_tcp_nodelay option added for setting
> TCP_NODELAY on messenger socket connections. Covers both rbd
> and cephfs

Hi Chaitanya,

Just couple high level comments - I'll take a closer look tomorrow.

Option listing and tcp_nodelay should be two separate patches

rbd: add option sysfs attiribute
libceph: add tcp_nodelay option

or something like that.  The "Messenger specific options moved to
messenger layer" part should probably be a separate patch as well.

More importantly, I'm missing the whole point of exporting supported
rbd options.  Adding a new libceph option does not break compatibility
in either way, as old kernels will simply fail to map/mount if a bad
(unknown, let through by new rbd cli) option is encountered.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-21 19:18 ` Ilya Dryomov
@ 2015-01-21 19:29   ` Somnath Roy
  2015-01-21 19:46     ` Ilya Dryomov
  0 siblings, 1 reply; 18+ messages in thread
From: Somnath Roy @ 2015-01-21 19:29 UTC (permalink / raw)
  To: Ilya Dryomov, Chaitanya Huilgol; +Cc: Ceph Development

Ilya,
Regarding supported attribute list,  I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.
We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.
Let me know your thought on this.

Thanks & Regards
Somnath

-----Original Message-----
From: ceph-devel-owner@vger.kernel.org [mailto:ceph-devel-owner@vger.kernel.org] On Behalf Of Ilya Dryomov
Sent: Wednesday, January 21, 2015 11:19 AM
To: Chaitanya Huilgol
Cc: Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Wed, Jan 21, 2015 at 10:00 PM, Chaitanya Huilgol <chaitanya.huilgol@gmail.com> wrote:
> From: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>
>
> Option keys supported by libceph and rbd modules is readable as a
> comma separated string via /sys/bus/rbd/options read-only interface.
> This will allow user app (rbd cli) to check for supported option keys
> before passing options to the kernel and remain compatible with older
> kernels which do not support a particular feature.
> Messenger specific options moved to messenger layer.
> tcp_nodelay(default)/no_tcp_nodelay option added for setting
> TCP_NODELAY on messenger socket connections. Covers both rbd and
> cephfs

Hi Chaitanya,

Just couple high level comments - I'll take a closer look tomorrow.

Option listing and tcp_nodelay should be two separate patches

rbd: add option sysfs attiribute
libceph: add tcp_nodelay option

or something like that.  The "Messenger specific options moved to messenger layer" part should probably be a separate patch as well.

More importantly, I'm missing the whole point of exporting supported rbd options.  Adding a new libceph option does not break compatibility in either way, as old kernels will simply fail to map/mount if a bad (unknown, let through by new rbd cli) option is encountered.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-21 19:29   ` Somnath Roy
@ 2015-01-21 19:46     ` Ilya Dryomov
  2015-01-21 20:02       ` Somnath Roy
  0 siblings, 1 reply; 18+ messages in thread
From: Ilya Dryomov @ 2015-01-21 19:46 UTC (permalink / raw)
  To: Somnath Roy; +Cc: Chaitanya Huilgol, Ceph Development

On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> Ilya,
> Regarding supported attribute list,  I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.

# rbd map -o foobar test
rbd: unknown map option 'foobar'
rbd: couldn't parse map options

# rbd map -o fsid=foobar test
rbd: invalid fsid value 'foobar'
rbd: couldn't parse map options

Since about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your
attribute wouldn't solve that problem (or rather it will, but only for
simple boolean yes/no options, like crc or tcp_nodelay) because we also
try to sanity check the value, as the above fsid example shows.

> We can use this supported list from kernel module from rbd cli to show proper error message to the user.
> Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.

Did you mean "and take rbd kernel map options", i.e. take default
map options from ceph.conf?  I think that's a good idea.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-21 19:46     ` Ilya Dryomov
@ 2015-01-21 20:02       ` Somnath Roy
  2015-01-22  2:33         ` Chaitanya Huilgol
  2015-01-22  8:54         ` Ilya Dryomov
  0 siblings, 2 replies; 18+ messages in thread
From: Somnath Roy @ 2015-01-21 20:02 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: Chaitanya Huilgol, Ceph Development

<<inline

-----Original Message-----
From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
Sent: Wednesday, January 21, 2015 11:47 AM
To: Somnath Roy
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> Ilya,
> Regarding supported attribute list,  I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.

# rbd map -o foobar test
rbd: unknown map option 'foobar'
rbd: couldn't parse map options

# rbd map -o fsid=foobar test
rbd: invalid fsid value 'foobar'
rbd: couldn't parse map options

Since about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.

[Somnath] Hmm..I missed that it seems.  Yes, for Boolean attributes kernel compatibility check should be able to flag that.

> We can use this supported list from kernel module from rbd cli to show proper error message to the user.
> Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.

Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf?  I think that's a good idea.
[Somnath] Yes, whatever is common, like crc (ms_nocrc in ceph.conf) , tcp_nodelay (ms_tcp_nodelay in ceph.conf)
Thanks,

                Ilya

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-21 20:02       ` Somnath Roy
@ 2015-01-22  2:33         ` Chaitanya Huilgol
  2015-01-22  8:54         ` Ilya Dryomov
  1 sibling, 0 replies; 18+ messages in thread
From: Chaitanya Huilgol @ 2015-01-22  2:33 UTC (permalink / raw)
  To: Somnath Roy, Ilya Dryomov; +Cc: Chaitanya Huilgol, Ceph Development

Hi Ilya,

Thanks for the initial review, I will send three separate patches for this.
The primary reason for the options listing is to add automatic option setting from ceph.conf without user intervention. Without this the rbd cli cannot make an informed decision on passing an option automatically to the kernel. The changes for these in the rbd cli are completed and tested and we will soon be sending a pull request for that, currently tcp_nodelay is the only auto option being added, but the changes are generic enough for other options to be added as well.
Note that the option listing is only for the option keys indicating if an option is supported for eg, crc & nocrc options are represented by "crc" option key. Let me know if we want to change this to list out all the options as-is.
User provided options override the auto options  and are not verified for compatibility with the kernel.
 Also, we are expecting few more options to come with the RDMA support and hence needed a separate options placeholder for the messenger layer (For eg type of connection to be initiated (RDMA vs TCP/IP).
If you have any other preliminary comments, please do send them and I will incorporate them in the revised separate patches.

Regards,
Chaitanya

-----Original Message-----
From: ceph-devel-owner@vger.kernel.org [mailto:ceph-devel-owner@vger.kernel.org] On Behalf Of Somnath Roy
Sent: Thursday, January 22, 2015 1:32 AM
To: Ilya Dryomov
Cc: Chaitanya Huilgol; Ceph Development
Subject: RE: [PATCH] ceph: rbd option listing and tcp_nodelay support

<<inline

-----Original Message-----
From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
Sent: Wednesday, January 21, 2015 11:47 AM
To: Somnath Roy
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> Ilya,
> Regarding supported attribute list,  I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.

# rbd map -o foobar test
rbd: unknown map option 'foobar'
rbd: couldn't parse map options

# rbd map -o fsid=foobar test
rbd: invalid fsid value 'foobar'
rbd: couldn't parse map options

Since about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.

[Somnath] Hmm..I missed that it seems.  Yes, for Boolean attributes kernel compatibility check should be able to flag that.

> We can use this supported list from kernel module from rbd cli to show proper error message to the user.
> Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.

Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf?  I think that's a good idea.
[Somnath] Yes, whatever is common, like crc (ms_nocrc in ceph.conf) , tcp_nodelay (ms_tcp_nodelay in ceph.conf) Thanks,

                Ilya

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).

N     r  y   b X  ǧv ^ )޺{.n +   z ]z   {ay \x1dʇڙ ,j   f   h   z \x1e w       j:+v   w j m         zZ+     ݢj"  ! i

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-21 20:02       ` Somnath Roy
  2015-01-22  2:33         ` Chaitanya Huilgol
@ 2015-01-22  8:54         ` Ilya Dryomov
  2015-01-22  9:54           ` Chaitanya Huilgol
  2015-01-22 17:42           ` Somnath Roy
  1 sibling, 2 replies; 18+ messages in thread
From: Ilya Dryomov @ 2015-01-22  8:54 UTC (permalink / raw)
  To: Somnath Roy, Sage Weil; +Cc: Chaitanya Huilgol, Ceph Development

On Wed, Jan 21, 2015 at 11:02 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> <<inline
>
> -----Original Message-----
> From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
> Sent: Wednesday, January 21, 2015 11:47 AM
> To: Somnath Roy
> Cc: Chaitanya Huilgol; Ceph Development
> Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
>
> On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
>> Ilya,
>> Regarding supported attribute list,  I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.
>
> # rbd map -o foobar test
> rbd: unknown map option 'foobar'
> rbd: couldn't parse map options
>
> # rbd map -o fsid=foobar test
> rbd: invalid fsid value 'foobar'
> rbd: couldn't parse map options
>
> Since about a year ago, rbd cli would try to parse supplied options.
> Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
>
> [Somnath] Hmm..I missed that it seems.  Yes, for Boolean attributes kernel compatibility check should be able to flag that.
>
>> We can use this supported list from kernel module from rbd cli to show proper error message to the user.
>> Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.
>
> Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf?  I think that's a good idea.
> [Somnath] Yes, whatever is common, like crc (ms_nocrc in ceph.conf) , tcp_nodelay (ms_tcp_nodelay in ceph.conf)

I was thinking more along the lines of a static "rbd default map
options" field in ceph.conf, e.g.

rbd default map options = "nocrc,tcp_nodelay"

which can then be overwritten by rbd map -o.

The thing is, kernel msgr will always be a stripped down version of
userspace msgr, and on top of that we are bound to have some kernel
client specific options.  Having both "rbd default map options" and
pulling out values for whatever options are common sounds like it can
be a bit confusing - we will have three layers of options settings to
deal with (common options, rbd_default_map_options, rbd map -o).
Sage, do you think it's worth it?

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22  8:54         ` Ilya Dryomov
@ 2015-01-22  9:54           ` Chaitanya Huilgol
  2015-01-22 12:50             ` Ilya Dryomov
  2015-01-22 14:40             ` Sage Weil
  2015-01-22 17:42           ` Somnath Roy
  1 sibling, 2 replies; 18+ messages in thread
From: Chaitanya Huilgol @ 2015-01-22  9:54 UTC (permalink / raw)
  To: Ilya Dryomov, Somnath Roy, Sage Weil; +Cc: Chaitanya Huilgol, Ceph Development

Hi Ilya,

We have two options here,
(1) Have kernel export supported options and pass on supported options from ceph.conf automatically if user has not specified the same via rbd -o - this is what is done in the current patch
Or
(2) As suggested by you, Have a default map options in ceph.conf  and pass all options which have not be overridden by rbd -o

As I understand, there is no need to do both - we need to choose between the two.
After your suggestion, I am leaning towards option-2 as it give more krbd specific control. However, the onus now rests on the user to add default options based on what the kernel supports (for this we can still provide the options listing via the sysbus interface, say with 'rbd map supported_options' cli)

Regards,
Chaitanya

-----Original Message-----
From: ceph-devel-owner@vger.kernel.org [mailto:ceph-devel-owner@vger.kernel.org] On Behalf Of Ilya Dryomov
Sent: Thursday, January 22, 2015 2:24 PM
To: Somnath Roy; Sage Weil
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Wed, Jan 21, 2015 at 11:02 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> <<inline
>
> -----Original Message-----
> From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
> Sent: Wednesday, January 21, 2015 11:47 AM
> To: Somnath Roy
> Cc: Chaitanya Huilgol; Ceph Development
> Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
>
> On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
>> Ilya,
>> Regarding supported attribute list,  I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.
>
> # rbd map -o foobar test
> rbd: unknown map option 'foobar'
> rbd: couldn't parse map options
>
> # rbd map -o fsid=foobar test
> rbd: invalid fsid value 'foobar'
> rbd: couldn't parse map options
>
> Since about a year ago, rbd cli would try to parse supplied options.
> Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
>
> [Somnath] Hmm..I missed that it seems.  Yes, for Boolean attributes kernel compatibility check should be able to flag that.
>
>> We can use this supported list from kernel module from rbd cli to show proper error message to the user.
>> Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.
>
> Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf?  I think that's a good idea.
> [Somnath] Yes, whatever is common, like crc (ms_nocrc in ceph.conf) ,
> tcp_nodelay (ms_tcp_nodelay in ceph.conf)

I was thinking more along the lines of a static "rbd default map options" field in ceph.conf, e.g.

rbd default map options = "nocrc,tcp_nodelay"

which can then be overwritten by rbd map -o.

The thing is, kernel msgr will always be a stripped down version of userspace msgr, and on top of that we are bound to have some kernel client specific options.  Having both "rbd default map options" and pulling out values for whatever options are common sounds like it can be a bit confusing - we will have three layers of options settings to deal with (common options, rbd_default_map_options, rbd map -o).
Sage, do you think it's worth it?

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22  9:54           ` Chaitanya Huilgol
@ 2015-01-22 12:50             ` Ilya Dryomov
  2015-01-22 13:33               ` Chaitanya Huilgol
  2015-01-22 14:40             ` Sage Weil
  1 sibling, 1 reply; 18+ messages in thread
From: Ilya Dryomov @ 2015-01-22 12:50 UTC (permalink / raw)
  To: Chaitanya Huilgol
  Cc: Somnath Roy, Sage Weil, Chaitanya Huilgol, Ceph Development

On Thu, Jan 22, 2015 at 12:54 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> Hi Ilya,
>
> We have two options here,
> (1) Have kernel export supported options and pass on supported options from ceph.conf automatically if user has not specified the same via rbd -o - this is what is done in the current patch
> Or
> (2) As suggested by you, Have a default map options in ceph.conf  and pass all options which have not be overridden by rbd -o
>
> As I understand, there is no need to do both - we need to choose between the two.
> After your suggestion, I am leaning towards option-2 as it give more krbd specific control. However, the onus now rests on the user to add default options based on what the kernel supports (for this we can still provide the options listing via the sysbus interface, say with 'rbd map supported_options' cli)

And the question then is: do we really need this supported_options cli?
rbd map options are treated very much like filesystem mount options -
the set of supported options is determined by the kernel version and is
documented in rbd(8) man page.

(There aren't any kernel version details in there currently, but that's
simply because all existing options have been added in bulk a long time
ago, and we can fix that omission with the addition of tcp_nodelay.)

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22 12:50             ` Ilya Dryomov
@ 2015-01-22 13:33               ` Chaitanya Huilgol
  2015-01-22 14:28                 ` Ilya Dryomov
  0 siblings, 1 reply; 18+ messages in thread
From: Chaitanya Huilgol @ 2015-01-22 13:33 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: Somnath Roy, Sage Weil, Chaitanya Huilgol, Ceph Development

Ok, I think for now we should first get the core feature support in, if the changes in the messenger layer look fine, then I will generate two patches
-  messenger specific options
- tcp_nodelay support

As a next set we can implement the  krbd_default_map_options in the ceph.conf and pass it down.

Let me know.

Regards,
Chaitanya


-----Original Message-----
From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
Sent: Thursday, January 22, 2015 6:20 PM
To: Chaitanya Huilgol
Cc: Somnath Roy; Sage Weil; Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Thu, Jan 22, 2015 at 12:54 PM, Chaitanya Huilgol <Chaitanya.Huilgol@sandisk.com> wrote:
> Hi Ilya,
>
> We have two options here,
> (1) Have kernel export supported options and pass on supported options
> from ceph.conf automatically if user has not specified the same via
> rbd -o - this is what is done in the current patch Or
> (2) As suggested by you, Have a default map options in ceph.conf  and
> pass all options which have not be overridden by rbd -o
>
> As I understand, there is no need to do both - we need to choose between the two.
> After your suggestion, I am leaning towards option-2 as it give more
> krbd specific control. However, the onus now rests on the user to add
> default options based on what the kernel supports (for this we can
> still provide the options listing via the sysbus interface, say with
> 'rbd map supported_options' cli)

And the question then is: do we really need this supported_options cli?
rbd map options are treated very much like filesystem mount options - the set of supported options is determined by the kernel version and is documented in rbd(8) man page.

(There aren't any kernel version details in there currently, but that's simply because all existing options have been added in bulk a long time ago, and we can fix that omission with the addition of tcp_nodelay.)

Thanks,

                Ilya

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22 13:33               ` Chaitanya Huilgol
@ 2015-01-22 14:28                 ` Ilya Dryomov
  2015-01-22 14:39                   ` Chaitanya Huilgol
  0 siblings, 1 reply; 18+ messages in thread
From: Ilya Dryomov @ 2015-01-22 14:28 UTC (permalink / raw)
  To: Chaitanya Huilgol
  Cc: Somnath Roy, Sage Weil, Chaitanya Huilgol, Ceph Development

On Thu, Jan 22, 2015 at 4:33 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> Ok, I think for now we should first get the core feature support in, if the changes in the messenger layer look fine, then I will generate two patches
> -  messenger specific options
> - tcp_nodelay support
>
> As a next set we can implement the  krbd_default_map_options in the ceph.conf and pass it down.
>
> Let me know.

Honestly, I don't see the point of splitting options the way you did
either.  There is just too much boilerplate for something as simple as
couple of flags: a struct with a single field to which ceph_messenger
then has a pointer, all the msgr opt macros (why?), the fact that
libceph options are now split between libceph.h and messenger.h, etc.

I'd just pass struct ceph_options * to ceph_messenger_init() and be
done with it.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22 14:28                 ` Ilya Dryomov
@ 2015-01-22 14:39                   ` Chaitanya Huilgol
  2015-01-22 15:08                     ` Ilya Dryomov
  0 siblings, 1 reply; 18+ messages in thread
From: Chaitanya Huilgol @ 2015-01-22 14:39 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: Somnath Roy, Sage Weil, Ceph Development

Well, there was no ceph_options pointer in the messenger layer and no_crc flag was being passed into the messenger as an additional flag and maintained within the messenger again as bool no_crc, I inferred that it was intentional and we did not want the generic options in the messenger layer.  If it is fine to have messenger point back to the ceph_options, then that’s the easiest way to do it.
Also, we would have some additional option coming in with RDMA support (xio messenger) which would be very messenger specific, so having a messenger options had made sense.

Regards,
Chaitanya

-----Original Message-----
From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
Sent: Thursday, January 22, 2015 7:59 PM
To: Chaitanya Huilgol
Cc: Somnath Roy; Sage Weil; Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Thu, Jan 22, 2015 at 4:33 PM, Chaitanya Huilgol <Chaitanya.Huilgol@sandisk.com> wrote:
> Ok, I think for now we should first get the core feature support in,
> if the changes in the messenger layer look fine, then I will generate
> two patches
> -  messenger specific options
> - tcp_nodelay support
>
> As a next set we can implement the  krbd_default_map_options in the ceph.conf and pass it down.
>
> Let me know.

Honestly, I don't see the point of splitting options the way you did either.  There is just too much boilerplate for something as simple as couple of flags: a struct with a single field to which ceph_messenger then has a pointer, all the msgr opt macros (why?), the fact that libceph options are now split between libceph.h and messenger.h, etc.

I'd just pass struct ceph_options * to ceph_messenger_init() and be done with it.

Thanks,

                Ilya

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22  9:54           ` Chaitanya Huilgol
  2015-01-22 12:50             ` Ilya Dryomov
@ 2015-01-22 14:40             ` Sage Weil
  1 sibling, 0 replies; 18+ messages in thread
From: Sage Weil @ 2015-01-22 14:40 UTC (permalink / raw)
  To: Chaitanya Huilgol
  Cc: Ilya Dryomov, Somnath Roy, Chaitanya Huilgol, Ceph Development

On Thu, 22 Jan 2015, Chaitanya Huilgol wrote:
> Hi Ilya,
> 
> We have two options here,
> (1) Have kernel export supported options and pass on supported options from ceph.conf automatically if user has not specified the same via rbd -o - this is what is done in the current patch
> Or
> (2) As suggested by you, Have a default map options in ceph.conf  and pass all options which have not be overridden by rbd -o
> 
> As I understand, there is no need to do both - we need to choose between the two.
> After your suggestion, I am leaning towards option-2 as it give more krbd specific control. However, the onus now rests on the user to add default options based on what the kernel supports (for this we can still provide the options listing via the sysbus interface, say with 'rbd map supported_options' cli)

I also think #2 is simpler and less surprising for the user.  I think we 
can keep it simple!

sage

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22 14:39                   ` Chaitanya Huilgol
@ 2015-01-22 15:08                     ` Ilya Dryomov
  2015-01-22 16:48                       ` Chaitanya Huilgol
  0 siblings, 1 reply; 18+ messages in thread
From: Ilya Dryomov @ 2015-01-22 15:08 UTC (permalink / raw)
  To: Chaitanya Huilgol; +Cc: Somnath Roy, Sage Weil, Ceph Development

On Thu, Jan 22, 2015 at 5:39 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> Well, there was no ceph_options pointer in the messenger layer and no_crc flag was being passed into the messenger as an additional flag and maintained within the messenger again as bool no_crc, I inferred that it was intentional and we did not want the generic options in the messenger layer.  If it is fine to have messenger point back to the ceph_options, then that’s the easiest way to do it.
> Also, we would have some additional option coming in with RDMA support (xio messenger) which would be very messenger specific, so having a messenger options had made sense.

OK, we'll see how to refactor it nicely then.

Given that tcp_nodelay is just a bool, for now I'd suggest the simplest
and least invasive patch:

- add bool tcp_nodelay field to ceph_messenger
- add bool tcp_nodelay parameter to ceph_messenger_init()
- call ceph_messenger_init() with ceph_test_opt(client, TCP_NODELAY)

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22 15:08                     ` Ilya Dryomov
@ 2015-01-22 16:48                       ` Chaitanya Huilgol
  2015-01-22 16:52                         ` Ilya Dryomov
  0 siblings, 1 reply; 18+ messages in thread
From: Chaitanya Huilgol @ 2015-01-22 16:48 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: Somnath Roy, Sage Weil, Ceph Development

Ok, will make the changes and send it as a single tcp_nodelay patch. One final clarification, do we want the TCP_NODELAY set by default or only when requested?

-----Original Message-----
From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
Sent: Thursday, January 22, 2015 8:38 PM
To: Chaitanya Huilgol
Cc: Somnath Roy; Sage Weil; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Thu, Jan 22, 2015 at 5:39 PM, Chaitanya Huilgol <Chaitanya.Huilgol@sandisk.com> wrote:
> Well, there was no ceph_options pointer in the messenger layer and no_crc flag was being passed into the messenger as an additional flag and maintained within the messenger again as bool no_crc, I inferred that it was intentional and we did not want the generic options in the messenger layer.  If it is fine to have messenger point back to the ceph_options, then that’s the easiest way to do it.
> Also, we would have some additional option coming in with RDMA support (xio messenger) which would be very messenger specific, so having a messenger options had made sense.

OK, we'll see how to refactor it nicely then.

Given that tcp_nodelay is just a bool, for now I'd suggest the simplest and least invasive patch:

- add bool tcp_nodelay field to ceph_messenger
- add bool tcp_nodelay parameter to ceph_messenger_init()
- call ceph_messenger_init() with ceph_test_opt(client, TCP_NODELAY)


Thanks,

                Ilya

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22 16:48                       ` Chaitanya Huilgol
@ 2015-01-22 16:52                         ` Ilya Dryomov
  0 siblings, 0 replies; 18+ messages in thread
From: Ilya Dryomov @ 2015-01-22 16:52 UTC (permalink / raw)
  To: Chaitanya Huilgol; +Cc: Somnath Roy, Sage Weil, Ceph Development

On Thu, Jan 22, 2015 at 7:48 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> Ok, will make the changes and send it as a single tcp_nodelay patch. One final clarification, do we want the TCP_NODELAY set by default or only when requested?

On by default I think.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
  2015-01-22  8:54         ` Ilya Dryomov
  2015-01-22  9:54           ` Chaitanya Huilgol
@ 2015-01-22 17:42           ` Somnath Roy
  1 sibling, 0 replies; 18+ messages in thread
From: Somnath Roy @ 2015-01-22 17:42 UTC (permalink / raw)
  To: Ilya Dryomov, Sage Weil; +Cc: Chaitanya Huilgol, Ceph Development

Yes, I agree with you on this Ilya. That will be less confusing to the user.

Thanks & Regards
Somnath

-----Original Message-----
From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
Sent: Thursday, January 22, 2015 12:54 AM
To: Somnath Roy; Sage Weil
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support

On Wed, Jan 21, 2015 at 11:02 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> <<inline
>
> -----Original Message-----
> From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
> Sent: Wednesday, January 21, 2015 11:47 AM
> To: Somnath Roy
> Cc: Chaitanya Huilgol; Ceph Development
> Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
>
> On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
>> Ilya,
>> Regarding supported attribute list,  I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.
>
> # rbd map -o foobar test
> rbd: unknown map option 'foobar'
> rbd: couldn't parse map options
>
> # rbd map -o fsid=foobar test
> rbd: invalid fsid value 'foobar'
> rbd: couldn't parse map options
>
> Since about a year ago, rbd cli would try to parse supplied options.
> Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
>
> [Somnath] Hmm..I missed that it seems.  Yes, for Boolean attributes kernel compatibility check should be able to flag that.
>
>> We can use this supported list from kernel module from rbd cli to show proper error message to the user.
>> Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.
>
> Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf?  I think that's a good idea.
> [Somnath] Yes, whatever is common, like crc (ms_nocrc in ceph.conf) ,
> tcp_nodelay (ms_tcp_nodelay in ceph.conf)

I was thinking more along the lines of a static "rbd default map options" field in ceph.conf, e.g.

rbd default map options = "nocrc,tcp_nodelay"

which can then be overwritten by rbd map -o.

The thing is, kernel msgr will always be a stripped down version of userspace msgr, and on top of that we are bound to have some kernel client specific options.  Having both "rbd default map options" and pulling out values for whatever options are common sounds like it can be a bit confusing - we will have three layers of options settings to deal with (common options, rbd_default_map_options, rbd map -o).
Sage, do you think it's worth it?

Thanks,

                Ilya

________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ceph: rbd option listing and tcp_nodelay support
       [not found] <9E914F5BD7F48A4782456CEB550A42280A75F93C@SACMBXIP01.sdcorp.global.sandisk.com>
@ 2015-01-21 18:32 ` Chaitanya Huilgol
  0 siblings, 0 replies; 18+ messages in thread
From: Chaitanya Huilgol @ 2015-01-21 18:32 UTC (permalink / raw)
  To: ceph-devel

From: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>

ceph: rbd option listing and tcp_nodelay support

Option keys supported by libceph and rbd modules is readable
as a comma separated string via /sys/bus/rbd/options read-only
interface. This will allow user app (rbd cli) to check for
supported option keys before passing options to the kernel and
remain compatible with older kernels which do not support a
particular feature.
Messenger specific options moved to messenger layer.
tcp_nodelay(default)/no_tcp_nodelay option added for setting
TCP_NODELAY on messenger socket connections. Covers both rbd
and cephfs

Signed-off-by: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>
---
 drivers/block/rbd.c            | 21 +++++++++++++++++
 fs/ceph/super.c                |  5 +++-
 include/linux/ceph/libceph.h   |  5 ++--
 include/linux/ceph/messenger.h | 26 +++++++++++++++++++--
 net/ceph/ceph_common.c         | 52 ++++++++++++++++++++++++++++++++++++++----
 net/ceph/messenger.c           | 33 ++++++++++++++++++++++-----
 6 files changed, 126 insertions(+), 16 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e818c2a..507fd16 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -423,6 +423,7 @@ static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf,
                                    size_t count);
 static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf,
                                       size_t count);
+static ssize_t rbd_enumerate_options(struct bus_type *bus, char *buf);
 static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping);
 static void rbd_spec_put(struct rbd_spec *spec);

@@ -440,12 +441,14 @@ static BUS_ATTR(add, S_IWUSR, NULL, rbd_add);
 static BUS_ATTR(remove, S_IWUSR, NULL, rbd_remove);
 static BUS_ATTR(add_single_major, S_IWUSR, NULL, rbd_add_single_major);
 static BUS_ATTR(remove_single_major, S_IWUSR, NULL, rbd_remove_single_major);
+static BUS_ATTR(options, S_IRUSR, rbd_enumerate_options, NULL);

 static struct attribute *rbd_bus_attrs[] = {
        &bus_attr_add.attr,
        &bus_attr_remove.attr,
        &bus_attr_add_single_major.attr,
        &bus_attr_remove_single_major.attr,
+       &bus_attr_options.attr,
        NULL,
 };

@@ -746,6 +749,12 @@ static match_table_t rbd_opts_tokens = {
        {-1, NULL}
 };

+/*
+ * Supported options comma separated string. Readable by the rbd cli, so that
+ * an informed decision can be made on passing options to the kernel modules.
+ */
+static const char *rbd_supported_option_keys = "rw";
+
 struct rbd_options {
        bool    read_only;
 };
@@ -5569,6 +5578,18 @@ static ssize_t rbd_remove_single_major(struct bus_type *bus,
        return do_rbd_remove(bus, buf, count);
 }

+static ssize_t rbd_enumerate_options(struct bus_type *bus,
+               char *buf)
+{
+       ssize_t sz;
+       sz = snprintf(buf, PAGE_SIZE, "%s", rbd_supported_option_keys);
+       if ((sz + 1) < PAGE_SIZE) {
+               sz += snprintf (buf + sz, PAGE_SIZE - sz, ",%s",
+                       ceph_get_supported_options());
+       }
+       sz += 1; /* '0' String Termination */
+       return sz;
+}
 /*
  * create control files in sysfs
  * /sys/bus/rbd/...
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 50f06cd..4632ae4 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -423,7 +423,10 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
                seq_printf(m, ",fsid=%pU", &opt->fsid);
        if (opt->flags & CEPH_OPT_NOSHARE)
                seq_puts(m, ",noshare");
-       if (opt->flags & CEPH_OPT_NOCRC)
+       if (ceph_test_msgr_opt(&opt->msgr_options,
+                       CEPH_MSGR_OPT_NO_TCP_NODELAY))
+               seq_puts(m, ",no_tcp_nodelay");
+       if (ceph_test_msgr_opt(&opt->msgr_options, CEPH_MSGR_OPT_NOCRC))
                seq_puts(m, ",nocrc");

        if (opt->name)
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 8b11a79..9306a47 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -28,8 +28,7 @@
 #define CEPH_OPT_FSID             (1<<0)
 #define CEPH_OPT_NOSHARE          (1<<1) /* don't share client with other sbs */
 #define CEPH_OPT_MYIP             (1<<2) /* specified my ip */
-#define CEPH_OPT_NOCRC            (1<<3) /* no data crc on writes */
-#define CEPH_OPT_NOMSGAUTH       (1<<4) /* not require cephx message signature */
+#define CEPH_OPT_NOMSGAUTH       (1<<3) /* not require cephx message signature */

 #define CEPH_OPT_DEFAULT   (0)

@@ -42,6 +41,7 @@ struct ceph_options {
        int flags;
        struct ceph_fsid fsid;
        struct ceph_entity_addr my_addr;
+       struct ceph_messenger_options msgr_options;
        int mount_timeout;
        int osd_idle_ttl;
        int osd_keepalive_timeout;
@@ -190,6 +190,7 @@ extern struct ceph_options *ceph_parse_options(char *options,
                              const char *dev_name, const char *dev_name_end,
                              int (*parse_extra_token)(char *c, void *private),
                              void *private);
+extern const char* ceph_get_supported_options(void);
 extern void ceph_destroy_options(struct ceph_options *opt);
 extern int ceph_compare_options(struct ceph_options *new_opt,
                                struct ceph_client *client);
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index d9d396c..471f622 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -51,12 +51,34 @@ struct ceph_connection_operations {
 /* use format string %s%d */
 #define ENTITY_NAME(n) ceph_entity_type_name((n).type), le64_to_cpu((n).num)

+/*
+ * Messenger specific ceph options
+ */
+struct ceph_messenger_options {
+       u32 flags;
+};
+
+#define CEPH_MSGR_OPT_NOCRC          (1<<0) /* no data crc on writes */
+#define CEPH_MSGR_OPT_NO_TCP_NODELAY (1<<1) /* No TCP_NODELAY on con sock */
+#define CEPH_MSGR_OPT_DEFAULT        (0)
+
+#define ceph_messenger_options_init(_msgr_opts)  \
+       ((_msgr_opts)->flags = CEPH_MSGR_OPT_DEFAULT)
+
+#define ceph_set_msgr_opt(_msgr_opts, _opt) \
+       ((_msgr_opts)->flags |= _opt)
+#define ceph_clr_msgr_opt(_msgr_opts, _opt) \
+       ((_msgr_opts)->flags &= ~(_opt))
+#define ceph_test_msgr_opt(_msgr_opts, _opt) \
+       (!!((_msgr_opts)->flags & (_opt)))
+
+
 struct ceph_messenger {
        struct ceph_entity_inst inst;    /* my name+address */
        struct ceph_entity_addr my_enc_addr;

        atomic_t stopping;
-       bool nocrc;
+       struct ceph_messenger_options *options;

        /*
         * the global_seq counts connections i (attempt to) initiate
@@ -264,7 +286,7 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr,
                        struct ceph_entity_addr *myaddr,
                        u64 supported_features,
                        u64 required_features,
-                       bool nocrc);
+                       struct ceph_messenger_options *msgr_options);

 extern void ceph_con_init(struct ceph_connection *con, void *private,
                        const struct ceph_connection_operations *ops,
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 5d5ab67..25f1515 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -239,6 +239,8 @@ enum {
        Opt_nocrc,
        Opt_cephx_require_signatures,
        Opt_nocephx_require_signatures,
+       Opt_tcp_nodelay,
+       Opt_no_tcp_nodelay,
 };

 static match_table_t opt_tokens = {
@@ -259,8 +261,28 @@ static match_table_t opt_tokens = {
        {Opt_nocrc, "nocrc"},
        {Opt_cephx_require_signatures, "cephx_require_signatures"},
        {Opt_nocephx_require_signatures, "nocephx_require_signatures"},
+       {Opt_tcp_nodelay, "tcp_nodelay"},
+       {Opt_no_tcp_nodelay, "no_tcp_nodelay"},
        {-1, NULL}
 };
+/*
+ * Supported option keys. Readable by the rbd cli, so that an informed
+ * decision can be made on passing options to the kernel modules.
+ */
+static const char *libceph_supported_options_keys =
+       "osdtimeout,"
+       "osdkeepalive,"
+       "mount_timeout,"
+       "osd_idle_ttl,"
+       "fsid,"
+       "name,"
+       "secret,"
+       "key,"
+       "ip,"
+       "share,"
+       "crc,"
+       "cephx_require_signatures,"
+       "tcp_nodelay";

 void ceph_destroy_options(struct ceph_options *opt)
 {
@@ -320,8 +342,7 @@ out:
        return err;
 }

-struct ceph_options *
-ceph_parse_options(char *options, const char *dev_name,
+struct ceph_options * ceph_parse_options(char *options, const char *dev_name,
                        const char *dev_name_end,
                        int (*parse_extra_token)(char *c, void *private),
                        void *private)
@@ -350,6 +371,7 @@ ceph_parse_options(char *options, const char *dev_name,
        opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT;
        opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; /* seconds */
        opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT;   /* seconds */
+       ceph_messenger_options_init(&opt->msgr_options);

        /* get mon ip(s) */
        /* ip1[:port1][,ip2[:port2]...] */
@@ -452,11 +474,14 @@ ceph_parse_options(char *options, const char *dev_name,
                        break;

                case Opt_crc:
-                       opt->flags &= ~CEPH_OPT_NOCRC;
+                       ceph_clr_msgr_opt(&opt->msgr_options,
+                               CEPH_MSGR_OPT_NOCRC);
                        break;
                case Opt_nocrc:
-                       opt->flags |= CEPH_OPT_NOCRC;
+                       ceph_set_msgr_opt(&opt->msgr_options,
+                               CEPH_MSGR_OPT_NOCRC);
                        break;
+
                case Opt_cephx_require_signatures:
                        opt->flags &= ~CEPH_OPT_NOMSGAUTH;
                        break;
@@ -464,6 +489,15 @@ ceph_parse_options(char *options, const char *dev_name,
                        opt->flags |= CEPH_OPT_NOMSGAUTH;
                        break;

+               case Opt_tcp_nodelay:
+                       ceph_clr_msgr_opt(&opt->msgr_options,
+                               CEPH_MSGR_OPT_NO_TCP_NODELAY);
+                       break;
+               case Opt_no_tcp_nodelay:
+                       ceph_set_msgr_opt(&opt->msgr_options,
+                               CEPH_MSGR_OPT_NO_TCP_NODELAY);
+                       break;
+
                default:
                        BUG_ON(token);
                }
@@ -478,6 +512,14 @@ out:
 }
 EXPORT_SYMBOL(ceph_parse_options);

+
+const char* ceph_get_supported_options(void)
+{
+    return  libceph_supported_options_keys;
+}
+EXPORT_SYMBOL(ceph_get_supported_options);
+
+
 u64 ceph_client_id(struct ceph_client *client)
 {
        return client->monc.auth->global_id;
@@ -521,7 +563,7 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private,
        ceph_messenger_init(&client->msgr, myaddr,
                client->supported_features,
                client->required_features,
-               ceph_test_opt(client, NOCRC));
+               &opt->msgr_options);

        /* subsystems */
        err = ceph_monc_init(&client->monc, client);
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 33a2f20..9a056fe 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -469,6 +469,21 @@ static void set_sock_callbacks(struct socket *sock,
 /*
  * socket helpers
  */
+static void ceph_tcp_set_sock_options(struct ceph_connection *con)
+{
+       int rc;
+
+       if (!ceph_test_msgr_opt(con->msgr->options,
+               CEPH_MSGR_OPT_NO_TCP_NODELAY)) {
+               /* Not requested to disable TCP_NODELAY, set it by default */
+               int optval = 1;
+               rc = kernel_setsockopt(con->sock, IPPROTO_TCP, TCP_NODELAY,
+                   (char *)&optval, sizeof(optval));
+               if (rc != 0) {
+                       pr_warn("Warn: CEPH_CON_OPT: TCP_NODELAY: Fails=%d\n", rc);
+               }
+       }
+}

 /*
  * initiate connection to a remote socket.
@@ -513,6 +528,9 @@ static int ceph_tcp_connect(struct ceph_connection *con)
        sk_set_memalloc(sock->sk);

        con->sock = sock;
+       /* process socket options if any */
+       ceph_tcp_set_sock_options(con);
+
        return 0;
 }

@@ -749,7 +767,6 @@ void ceph_con_init(struct ceph_connection *con, void *private,
 }
 EXPORT_SYMBOL(ceph_con_init);

-
 /*
  * We maintain a global counter to order connection attempts.  Get
  * a unique seq greater than @gt.
@@ -1511,7 +1528,8 @@ static int write_partial_message_data(struct ceph_connection *con)
 {
        struct ceph_msg *msg = con->out_msg;
        struct ceph_msg_data_cursor *cursor = &msg->cursor;
-       bool do_datacrc = !con->msgr->nocrc;
+       bool do_datacrc = !ceph_test_msgr_opt(con->msgr->options,
+                               CEPH_MSGR_OPT_NOCRC);
        u32 crc;

        dout("%s %p msg %p\n", __func__, con, msg);
@@ -2212,7 +2230,8 @@ static int read_partial_msg_data(struct ceph_connection *con)
 {
        struct ceph_msg *msg = con->in_msg;
        struct ceph_msg_data_cursor *cursor = &msg->cursor;
-       const bool do_datacrc = !con->msgr->nocrc;
+       const bool do_datacrc = !ceph_test_msgr_opt(con->msgr->options,
+                               CEPH_MSGR_OPT_NOCRC);
        struct page *page;
        size_t page_offset;
        size_t length;
@@ -2258,7 +2277,8 @@ static int read_partial_message(struct ceph_connection *con)
        int end;
        int ret;
        unsigned int front_len, middle_len, data_len;
-       bool do_datacrc = !con->msgr->nocrc;
+       bool do_datacrc = !ceph_test_msgr_opt(con->msgr->options,
+                               CEPH_MSGR_OPT_NOCRC);
        bool need_sign = (con->peer_features & CEPH_FEATURE_MSG_AUTH);
        u64 seq;
        u32 crc;
@@ -2922,7 +2942,7 @@ void ceph_messenger_init(struct ceph_messenger *msgr,
                        struct ceph_entity_addr *myaddr,
                        u64 supported_features,
                        u64 required_features,
-                       bool nocrc)
+                       struct ceph_messenger_options *msgr_options)
 {
        msgr->supported_features = supported_features;
        msgr->required_features = required_features;
@@ -2936,7 +2956,8 @@ void ceph_messenger_init(struct ceph_messenger *msgr,
        msgr->inst.addr.type = 0;
        get_random_bytes(&msgr->inst.addr.nonce, sizeof(msgr->inst.addr.nonce));
        encode_my_addr(msgr);
-       msgr->nocrc = nocrc;
+       BUG_ON(msgr_options == NULL);
+       msgr->options = msgr_options;

        atomic_set(&msgr->stopping, 0);

--
1.9.1


________________________________

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-01-22 17:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-21 19:00 [PATCH] ceph: rbd option listing and tcp_nodelay support Chaitanya Huilgol
2015-01-21 19:18 ` Ilya Dryomov
2015-01-21 19:29   ` Somnath Roy
2015-01-21 19:46     ` Ilya Dryomov
2015-01-21 20:02       ` Somnath Roy
2015-01-22  2:33         ` Chaitanya Huilgol
2015-01-22  8:54         ` Ilya Dryomov
2015-01-22  9:54           ` Chaitanya Huilgol
2015-01-22 12:50             ` Ilya Dryomov
2015-01-22 13:33               ` Chaitanya Huilgol
2015-01-22 14:28                 ` Ilya Dryomov
2015-01-22 14:39                   ` Chaitanya Huilgol
2015-01-22 15:08                     ` Ilya Dryomov
2015-01-22 16:48                       ` Chaitanya Huilgol
2015-01-22 16:52                         ` Ilya Dryomov
2015-01-22 14:40             ` Sage Weil
2015-01-22 17:42           ` Somnath Roy
     [not found] <9E914F5BD7F48A4782456CEB550A42280A75F93C@SACMBXIP01.sdcorp.global.sandisk.com>
2015-01-21 18:32 ` Chaitanya Huilgol

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.