From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xin Long Subject: Re: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list Date: Thu, 25 Aug 2016 12:03:30 +0800 Message-ID: References: <130956b1e880eab780162a795fde156d61d4de0f.1471605833.git.lucien.xin@gmail.com> <20160819175007.GB3578@hmsreliant.think-freely.org> <20160822142538.GA10323@hmsreliant.think-freely.org> <20160824112338.GB11144@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Neil Horman , network dev , linux-sctp@vger.kernel.org, davem , Vlad Yasevich , daniel@iogearbox.net To: Marcelo Ricardo Leitner Return-path: Received: from mail-qk0-f196.google.com ([209.85.220.196]:35430 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754785AbcHYFHv (ORCPT ); Thu, 25 Aug 2016 01:07:51 -0400 In-Reply-To: <20160824112338.GB11144@localhost.localdomain> Sender: netdev-owner@vger.kernel.org List-ID: > Or add a refcnt to its members. > NETDEV_UP, it gets a ++ if it's already there > NETDEV_DOWN, it gets a -- and cleans it up if it reaches 0 > And the rest probably could stay the same. > Yes, it could also avoid the issue of amounts of duplicate addrs. or add a nic index variable to its members. But I still prefer the current patch. 1. This issue only happens when server bind 'ANY' addresses. we don't need to add any new members to struct sctp_sockaddr_entry. especially if it's a really corner issue, we fix this as an improvement. 2. It's yet two issues here, the duplicate addrs may be from a) different local NICs. b) the same one NIC. It may be unexpectable to filter them in NETDEV_UP/DOWN events. 3. We check it only when sctp really binds it, just like sctp_do_bind. What do you think ? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xin Long Date: Thu, 25 Aug 2016 04:03:30 +0000 Subject: Re: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list Message-Id: List-Id: References: <130956b1e880eab780162a795fde156d61d4de0f.1471605833.git.lucien.xin@gmail.com> <20160819175007.GB3578@hmsreliant.think-freely.org> <20160822142538.GA10323@hmsreliant.think-freely.org> <20160824112338.GB11144@localhost.localdomain> In-Reply-To: <20160824112338.GB11144@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Marcelo Ricardo Leitner Cc: Neil Horman , network dev , linux-sctp@vger.kernel.org, davem , Vlad Yasevich , daniel@iogearbox.net > Or add a refcnt to its members. > NETDEV_UP, it gets a ++ if it's already there > NETDEV_DOWN, it gets a -- and cleans it up if it reaches 0 > And the rest probably could stay the same. > Yes, it could also avoid the issue of amounts of duplicate addrs. or add a nic index variable to its members. But I still prefer the current patch. 1. This issue only happens when server bind 'ANY' addresses. we don't need to add any new members to struct sctp_sockaddr_entry. especially if it's a really corner issue, we fix this as an improvement. 2. It's yet two issues here, the duplicate addrs may be from a) different local NICs. b) the same one NIC. It may be unexpectable to filter them in NETDEV_UP/DOWN events. 3. We check it only when sctp really binds it, just like sctp_do_bind. What do you think ?