drbd: Turn no-tcp-cork into tcp-cork={yes|no}
authorAndreas Gruenbacher <agruen@linbit.com>
Wed, 4 May 2011 13:25:35 +0000 (15:25 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:55:46 +0000 (16:55 +0100)
Change the --no-tcp-cork drbdsetup command line option as well as
the no_cork netlink packet.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_worker.c
include/linux/drbd_genl.h

index 5d1bdda8ec9fdab1679b3781ec4647f50440f888..b4858bb78940cf81cef91a67d335d54b77572758 100644 (file)
@@ -5040,7 +5040,7 @@ int drbd_asender(struct drbd_thread *thi)
        int expect   = header_size;
        bool ping_timeout_active = false;
        struct net_conf *nc;
-       int ping_timeo, no_cork, ping_int;
+       int ping_timeo, tcp_cork, ping_int;
 
        current->policy = SCHED_RR;  /* Make this a realtime task! */
        current->rt_priority = 2;    /* more important than all other tasks */
@@ -5051,7 +5051,7 @@ int drbd_asender(struct drbd_thread *thi)
                rcu_read_lock();
                nc = rcu_dereference(tconn->net_conf);
                ping_timeo = nc->ping_timeo;
-               no_cork = nc->no_cork;
+               tcp_cork = nc->tcp_cork;
                ping_int = nc->ping_int;
                rcu_read_unlock();
 
@@ -5066,14 +5066,14 @@ int drbd_asender(struct drbd_thread *thi)
 
                /* TODO: conditionally cork; it may hurt latency if we cork without
                   much to send */
-               if (!no_cork)
+               if (tcp_cork)
                        drbd_tcp_cork(tconn->meta.socket);
                if (tconn_finish_peer_reqs(tconn)) {
                        conn_err(tconn, "tconn_finish_peer_reqs() failed\n");
                        goto reconnect;
                }
                /* but unconditionally uncork unless disabled */
-               if (!no_cork)
+               if (tcp_cork)
                        drbd_tcp_uncork(tconn->meta.socket);
 
                /* short circuit, recv_msg would return EINTR anyways. */
index e37c42d5dd6efbc0c761056877feb265fde35db3..78c3de49eff6ba4e200dec84549b18dc816f08ed 100644 (file)
@@ -1694,7 +1694,7 @@ int drbd_worker(struct drbd_thread *thi)
 
                        rcu_read_lock();
                        nc = rcu_dereference(tconn->net_conf);
-                       cork = nc ? !nc->no_cork : 0;
+                       cork = nc ? nc->tcp_cork : 0;
                        rcu_read_unlock();
 
                        if (tconn->data.socket && cork)
index 53518fc231543b4e57db48e758dbe0b58e88ba52..6632d10f1ee1663d2b54eaaa80e0162d48e29e47 100644 (file)
@@ -162,7 +162,7 @@ GENL_struct(DRBD_NLA_NET_CONF, 5, net_conf,
        __u32_field_def(25,     GENLA_F_MANDATORY,      cong_extents, DRBD_CONG_EXTENTS_DEF)
        __flg_field_def(26, GENLA_F_MANDATORY,  two_primaries, 0)
        __flg_field(27, GENLA_F_MANDATORY | GENLA_F_INVARIANT,  want_lose)
-       __flg_field_def(28, GENLA_F_MANDATORY,  no_cork, 0)
+       __flg_field_def(28, GENLA_F_MANDATORY,  tcp_cork, 1)
        __flg_field_def(29, GENLA_F_MANDATORY,  always_asbp, 0)
        __flg_field(30, GENLA_F_MANDATORY | GENLA_F_INVARIANT,  dry_run)
        __flg_field_def(31,     GENLA_F_MANDATORY,      use_rle, 0)