* SCTP control socket question @ 2008-03-27 12:03 Denis V. Lunev 2008-03-27 12:48 ` Vlad Yasevich 0 siblings, 1 reply; 8+ messages in thread From: Denis V. Lunev @ 2008-03-27 12:03 UTC (permalink / raw) To: vladislav.yasevich; +Cc: Netdev List, lksctp-developers Hello, Vlad! I have read SCTP sources and found that SCTP control socket (sctp_ctl_socket) remains hashed unlike similar staff in UDP/TCP etc. Am I wrong, that it should not be hashed or not? Regards, Den ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SCTP control socket question 2008-03-27 12:03 SCTP control socket question Denis V. Lunev @ 2008-03-27 12:48 ` Vlad Yasevich 2008-03-27 13:09 ` Denis V. Lunev 0 siblings, 1 reply; 8+ messages in thread From: Vlad Yasevich @ 2008-03-27 12:48 UTC (permalink / raw) To: Denis V. Lunev; +Cc: Netdev List, lksctp-developers Denis V. Lunev wrote: > Hello, Vlad! > > I have read SCTP sources and found that SCTP control socket > (sctp_ctl_socket) remains hashed unlike similar staff in UDP/TCP etc. > > Am I wrong, that it should not be hashed or not? Why do you believe that the socket is hashed? That socket is only allocated and referenced. It's should not be in any hash tables since we hold a global reference on it. -vlad ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SCTP control socket question 2008-03-27 12:48 ` Vlad Yasevich @ 2008-03-27 13:09 ` Denis V. Lunev 2008-03-27 13:15 ` Vlad Yasevich 0 siblings, 1 reply; 8+ messages in thread From: Denis V. Lunev @ 2008-03-27 13:09 UTC (permalink / raw) To: Vlad Yasevich; +Cc: Netdev List, lksctp-developers On Thu, 2008-03-27 at 08:48 -0400, Vlad Yasevich wrote: > Denis V. Lunev wrote: > > Hello, Vlad! > > > > I have read SCTP sources and found that SCTP control socket > > (sctp_ctl_socket) remains hashed unlike similar staff in UDP/TCP etc. > > > > Am I wrong, that it should not be hashed or not? > > Why do you believe that the socket is hashed? That socket is only > allocated and referenced. It's should not be in any hash tables > since we hold a global reference on it. sctp_ctl_sock_init __sock_create inet(6)_create sk->sk_prot->hash(sk); For this purpose sk->sk_prot->unhash is explicitly called for ICMP/TCP etc cases. Regards, Den ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SCTP control socket question 2008-03-27 13:09 ` Denis V. Lunev @ 2008-03-27 13:15 ` Vlad Yasevich 2008-03-27 13:43 ` Denis V. Lunev 0 siblings, 1 reply; 8+ messages in thread From: Vlad Yasevich @ 2008-03-27 13:15 UTC (permalink / raw) To: Denis V. Lunev; +Cc: Netdev List, lksctp-developers Denis V. Lunev wrote: > On Thu, 2008-03-27 at 08:48 -0400, Vlad Yasevich wrote: >> Denis V. Lunev wrote: >>> Hello, Vlad! >>> >>> I have read SCTP sources and found that SCTP control socket >>> (sctp_ctl_socket) remains hashed unlike similar staff in UDP/TCP etc. >>> >>> Am I wrong, that it should not be hashed or not? >> Why do you believe that the socket is hashed? That socket is only >> allocated and referenced. It's should not be in any hash tables >> since we hold a global reference on it. > > sctp_ctl_sock_init > __sock_create > inet(6)_create > sk->sk_prot->hash(sk); > > For this purpose sk->sk_prot->unhash is explicitly called for ICMP/TCP > etc cases. > > Regards, > Den > Ahhh... ;-) struct proto sctp_prot = { ... .hash = sctp_hash, ... } static void sctp_hash(struct sock *sk) { /* STUB */ } SCTP currently does't do any hashing on the sockets. It hashes SCTP structures that live under the socket. Regards -vlad ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SCTP control socket question 2008-03-27 13:15 ` Vlad Yasevich @ 2008-03-27 13:43 ` Denis V. Lunev 2008-03-27 14:01 ` Vlad Yasevich 0 siblings, 1 reply; 8+ messages in thread From: Denis V. Lunev @ 2008-03-27 13:43 UTC (permalink / raw) To: Vlad Yasevich; +Cc: Netdev List, lksctp-developers [-- Attachment #1: Type: text/plain, Size: 1131 bytes --] On Thu, 2008-03-27 at 09:15 -0400, Vlad Yasevich wrote: > Denis V. Lunev wrote: > > On Thu, 2008-03-27 at 08:48 -0400, Vlad Yasevich wrote: > >> Denis V. Lunev wrote: > >>> Hello, Vlad! > >>> > >>> I have read SCTP sources and found that SCTP control socket > >>> (sctp_ctl_socket) remains hashed unlike similar staff in UDP/TCP etc. > >>> > >>> Am I wrong, that it should not be hashed or not? > >> Why do you believe that the socket is hashed? That socket is only > >> allocated and referenced. It's should not be in any hash tables > >> since we hold a global reference on it. > > > > sctp_ctl_sock_init > > __sock_create > > inet(6)_create > > sk->sk_prot->hash(sk); > > > > For this purpose sk->sk_prot->unhash is explicitly called for ICMP/TCP > > etc cases. > > > > Regards, > > Den > > > > Ahhh... ;-) > > struct proto sctp_prot = { > ... > .hash = sctp_hash, > ... > } > > static void sctp_hash(struct sock *sk) > { > /* STUB */ > } > > > SCTP currently does't do any hashing on the sockets. It hashes SCTP structures > that live under the socket. will you mind against this? [-- Attachment #2: 1.txt --] [-- Type: text/x-patch, Size: 655 bytes --] diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5aea911..8d1b2bc 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -680,16 +680,13 @@ static int sctp_ctl_sock_init(void) else family = PF_INET; - err = sock_create_kern(family, SOCK_SEQPACKET, IPPROTO_SCTP, - &sctp_ctl_socket); + err = inet_csk_ctl_sock_create(&sctp_ctl_socket, + family, SOCK_SEQPACKET, IPPROTO_SCTP); if (err < 0) { printk(KERN_ERR "SCTP: Failed to create the SCTP control socket.\n"); return err; } - sctp_ctl_socket->sk->sk_allocation = GFP_ATOMIC; - inet_sk(sctp_ctl_socket->sk)->uc_ttl = -1; - return 0; } ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: SCTP control socket question 2008-03-27 13:43 ` Denis V. Lunev @ 2008-03-27 14:01 ` Vlad Yasevich 2008-03-27 14:15 ` Pavel Emelyanov 0 siblings, 1 reply; 8+ messages in thread From: Vlad Yasevich @ 2008-03-27 14:01 UTC (permalink / raw) To: Denis V. Lunev; +Cc: Netdev List, lksctp-developers Denis V. Lunev wrote: > On Thu, 2008-03-27 at 09:15 -0400, Vlad Yasevich wrote: >> Denis V. Lunev wrote: >>> On Thu, 2008-03-27 at 08:48 -0400, Vlad Yasevich wrote: >>>> Denis V. Lunev wrote: >>>>> Hello, Vlad! >>>>> >>>>> I have read SCTP sources and found that SCTP control socket >>>>> (sctp_ctl_socket) remains hashed unlike similar staff in UDP/TCP etc. >>>>> >>>>> Am I wrong, that it should not be hashed or not? >>>> Why do you believe that the socket is hashed? That socket is only >>>> allocated and referenced. It's should not be in any hash tables >>>> since we hold a global reference on it. >>> sctp_ctl_sock_init >>> __sock_create >>> inet(6)_create >>> sk->sk_prot->hash(sk); >>> >>> For this purpose sk->sk_prot->unhash is explicitly called for ICMP/TCP >>> etc cases. >>> >>> Regards, >>> Den >>> >> Ahhh... ;-) >> >> struct proto sctp_prot = { >> ... >> .hash = sctp_hash, >> ... >> } >> >> static void sctp_hash(struct sock *sk) >> { >> /* STUB */ >> } >> >> >> SCTP currently does't do any hashing on the sockets. It hashes SCTP structures >> that live under the socket. > > will you mind against this? > That's fine. My one concern is that someone may erroneously interpret that SCTP sockets are derived from inet_connection_sock, but I can live with that. -vlad ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SCTP control socket question 2008-03-27 14:01 ` Vlad Yasevich @ 2008-03-27 14:15 ` Pavel Emelyanov 2008-03-28 3:30 ` David Miller 0 siblings, 1 reply; 8+ messages in thread From: Pavel Emelyanov @ 2008-03-27 14:15 UTC (permalink / raw) To: Vlad Yasevich, Denis V. Lunev; +Cc: Netdev List, lksctp-developers >> will you mind against this? >> > > That's fine. My one concern is that someone may erroneously interpret that SCTP > sockets are derived from inet_connection_sock, but I can live with that. Agree. I'd rename it into some not-so-inet-related function. > -vlad > > -- > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SCTP control socket question 2008-03-27 14:15 ` Pavel Emelyanov @ 2008-03-28 3:30 ` David Miller 0 siblings, 0 replies; 8+ messages in thread From: David Miller @ 2008-03-28 3:30 UTC (permalink / raw) To: xemul; +Cc: vladislav.yasevich, den, netdev, lksctp-developers From: Pavel Emelyanov <xemul@openvz.org> Date: Thu, 27 Mar 2008 17:15:53 +0300 > >> will you mind against this? > >> > > > > That's fine. My one concern is that someone may erroneously interpret that SCTP > > sockets are derived from inet_connection_sock, but I can live with that. > > Agree. I'd rename it into some not-so-inet-related function. Can someone formally submit a final patch? Thanks. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-03-28 3:30 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-03-27 12:03 SCTP control socket question Denis V. Lunev 2008-03-27 12:48 ` Vlad Yasevich 2008-03-27 13:09 ` Denis V. Lunev 2008-03-27 13:15 ` Vlad Yasevich 2008-03-27 13:43 ` Denis V. Lunev 2008-03-27 14:01 ` Vlad Yasevich 2008-03-27 14:15 ` Pavel Emelyanov 2008-03-28 3:30 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).