[linux-cifs-client] CIFS slow on gigabit, doesn't support sockopt=TCP_NODELAY ?

Timothy Normand Miller theosib at gmail.com
Mon Aug 24 21:10:15 MDT 2009


I have another question.  Setting TCP_NODELAY and IPTOS_LOWDELAY seem
to affect different levels of the protocol stack.  Consider this bit
of code I googled:

#ifdef IPTOS_LOWDELAY
      int lowdelay = IPTOS_LOWDELAY;
      if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, (void *)&lowdelay,
                     sizeof(lowdelay)) < 0)
        error("setsockopt IPTOS_LOWDELAY: %.100s", strerror(errno));
#endif /* IPTOS_LOWDELAY */
#if defined(TCP_NODELAY) && defined(ENABLE_TCP_NODELAY)
      if (setsockopt(connection_in, IPPROTO_TCP, TCP_NODELAY, (void *)&on,
                     sizeof(on)) < 0)
        error("setsockopt TCP_NODELAY: %.100s", strerror(errno));
#endif /* TCP_NODELAY */

I figured out how to set TCP_NODELAY in the kernel, because I saw an
example.  So I do this in ipv4_connect:

        val = 1;
        socket->ops->setsockopt(socket, SOL_TCP, TCP_NODELAY,
                                            (char __user *)&val, sizeof(val));

Thus, for IPTOS_LOWDELAY, would I do this?

        val = IPTOS_LOWDELAY;
        socket->ops->setsockopt(socket, SOL_IP, IP_TOS,
                                            (char __user *)&val, sizeof(val));


Thanks.


More information about the linux-cifs-client mailing list