Re: CIFS slow on gigabit, doesn't support sockopt=TCP_NODELAY ?

Timothy Normand Miller <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.