From: Jon M. <jon...@er...> - 2019-10-29 11:25:13
|
Hi Ying, You're right. I'll fix this. Anyway, I just realized another improvement I could make, so I'll send a new version with both changes. Regards ///jon > -----Original Message----- > From: Ying Xue <yin...@wi...> > Sent: 29-Oct-19 06:24 > To: Jon Maloy <jon...@er...>; Jon Maloy <ma...@do...> > Cc: Mohan Krishna Ghanta Krishnamurthy <moh...@er...>; > par...@gm...; Tung Quang Nguyen <tun...@de...>; Hoang > Huu Le <hoa...@de...>; Tuong Tong Lien <tuo...@de...>; Gordan > Mihaljevic <gor...@de...>; tip...@li... > Subject: Re: [net-next v3 1/1] tipc: add smart nagle feature > > On 10/29/19 1:37 AM, Jon Maloy wrote: > > @@ -3007,6 +3068,9 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt, > > case TIPC_GROUP_LEAVE: > > res = tipc_sk_leave(tsk); > > break; > > + case TIPC_NODELAY: > > + tsk->nodelay = true; > > + break; > > default: > > res = -EINVAL; > > } > > Once user sets tsk->nodelay to true, there is no chance to set it back > to false. Although this scenario rarely happens for us, it's better that > we can provide the function. > > For example, below is how TCP supports TCP_NODELAY option: > > case TCP_NODELAY: > if (val) { > /* TCP_NODELAY is weaker than TCP_CORK, so that > * this option on corked socket is remembered, but > * it is not activated until cork is cleared. > * > * However, when TCP_NODELAY is set we make > * an explicit push, which overrides even TCP_CORK > * for currently queued segments. > */ > tp->nonagle |= TCP_NAGLE_OFF|TCP_NAGLE_PUSH; > tcp_push_pending_frames(sk); > } else { > tp->nonagle &= ~TCP_NAGLE_OFF; > } > break; |