From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Laight Subject: RE: [PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams Date: Fri, 3 Aug 2018 16:41:38 +0000 Message-ID: <64cefdadefae4961a111d442b3ee8af2@AcuMS.aculab.com> References: <20180724173647.GA8881@localhost.localdomain> <20180803162102.19540-1-khorenko@virtuozzo.com> <20180803162102.19540-2-khorenko@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Cc: "oleg.babin@gmail.com" , "netdev@vger.kernel.org" , "linux-sctp@vger.kernel.org" , "David S . Miller" , "Vlad Yasevich" , Neil Horman , Xin Long , Andrey Ryabinin To: 'Konstantin Khorenko' , Marcelo Ricardo Leitner Return-path: Received: from eu-smtp-delivery-211.mimecast.com ([207.82.80.211]:23338 "EHLO eu-smtp-delivery-211.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727339AbeHCShF (ORCPT ); Fri, 3 Aug 2018 14:37:05 -0400 In-Reply-To: <20180803162102.19540-2-khorenko@virtuozzo.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: From: Konstantin Khorenko > Sent: 03 August 2018 17:21 ... > --- a/net/sctp/stream.c > +++ b/net/sctp/stream.c > @@ -37,6 +37,18 @@ > #include > #include > > +struct sctp_stream_out *sctp_stream_out(const struct sctp_stream *stream, > + __u16 sid) > +{ > + return ((struct sctp_stream_out *)(stream->out)) + sid; > +} > + > +struct sctp_stream_in *sctp_stream_in(const struct sctp_stream *stream, > + __u16 sid) > +{ > + return ((struct sctp_stream_in *)(stream->in)) + sid; > +} > + Those look like they ought to be static inlines in the header file. Otherwise you'll be making SCTP performance worse that it is already. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)