Commit edca4cb4 authored by Thomas Graf's avatar Thomas Graf

[NET] Convert sk_no_largesend into SOCK_NO_LARGESEND flag

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a585a039
......@@ -134,7 +134,6 @@ struct sock_common {
* @sk_sndbuf - size of send buffer in bytes
* @sk_flags - %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings
* @sk_no_check - %SO_NO_CHECK setting, wether or not checkup packets
* @sk_no_largesend - whether to sent large segments or not
* @sk_route_caps - route capabilities (e.g. %NETIF_F_TSO)
* @sk_lingertime - %SO_LINGER l_linger setting
* @sk_hashent - hash entry in several tables (e.g. tcp_ehash)
......@@ -206,7 +205,6 @@ struct sock {
int sk_sndbuf;
unsigned long sk_flags;
char sk_no_check;
unsigned char sk_no_largesend;
int sk_route_caps;
unsigned long sk_lingertime;
int sk_hashent;
......@@ -387,6 +385,7 @@ enum sock_flags {
SOCK_USE_WRITE_QUEUE, /* whether to call sk->sk_write_space in sock_wfree */
SOCK_DBG, /* %SO_DEBUG setting */
SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */
SOCK_NO_LARGESEND, /* whether to sent large segments or not */
};
static inline void sock_set_flag(struct sock *sk, enum sock_flags flag)
......
......@@ -1915,7 +1915,7 @@ static inline void tcp_v4_setup_caps(struct sock *sk, struct dst_entry *dst)
{
sk->sk_route_caps = dst->dev->features;
if (sk->sk_route_caps & NETIF_F_TSO) {
if (sk->sk_no_largesend || dst->header_len)
if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len)
sk->sk_route_caps &= ~NETIF_F_TSO;
}
}
......
......@@ -33,7 +33,7 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp,
if (sysctl_tcp_ecn && !(sk->sk_route_caps & NETIF_F_TSO)) {
TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR;
tp->ecn_flags = TCP_ECN_OK;
sk->sk_no_largesend = 1;
sock_set_flag(sk, SOCK_NO_LARGESEND);
}
}
......
......@@ -977,7 +977,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
* Not good, but alternative is to resegment the queue. */
if (sk->sk_route_caps & NETIF_F_TSO) {
sk->sk_route_caps &= ~NETIF_F_TSO;
sk->sk_no_largesend = 1;
sock_set_flag(sk, SOCK_NO_LARGESEND);
tp->mss_cache = tp->mss_cache_std;
}
......@@ -4507,7 +4507,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
TCP_ECN_rcv_synack(tp, th);
if (tp->ecn_flags&TCP_ECN_OK)
sk->sk_no_largesend = 1;
sock_set_flag(sk, SOCK_NO_LARGESEND);
tp->snd_wl1 = TCP_SKB_CB(skb)->seq;
tcp_ack(sk, skb, FLAG_SLOWPATH);
......@@ -4645,7 +4645,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
TCP_ECN_rcv_syn(tp, th);
if (tp->ecn_flags&TCP_ECN_OK)
sk->sk_no_largesend = 1;
sock_set_flag(sk, SOCK_NO_LARGESEND);
tcp_sync_mss(sk, tp->pmtu_cookie);
tcp_initialize_rcv_mss(sk);
......
......@@ -841,7 +841,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
newtp->rx_opt.mss_clamp = req->mss;
TCP_ECN_openreq_child(newtp, req);
if (newtp->ecn_flags&TCP_ECN_OK)
newsk->sk_no_largesend = 1;
sock_set_flag(newsk, SOCK_NO_LARGESEND);
tcp_ca_init(newtp);
......
......@@ -1040,7 +1040,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
if (sk->sk_route_caps & NETIF_F_TSO) {
sk->sk_route_caps &= ~NETIF_F_TSO;
sk->sk_no_largesend = 1;
sock_set_flag(sk, SOCK_NO_LARGESEND);
tp->mss_cache = tp->mss_cache_std;
}
......@@ -1669,7 +1669,7 @@ int tcp_write_wakeup(struct sock *sk)
/* SWS override triggered forced fragmentation.
* Disable TSO, the connection is too sick. */
if (sk->sk_route_caps & NETIF_F_TSO) {
sk->sk_no_largesend = 1;
sock_set_flag(sk, SOCK_NO_LARGESEND);
sk->sk_route_caps &= ~NETIF_F_TSO;
tp->mss_cache = tp->mss_cache_std;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment