From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46D59C31E5B for ; Mon, 17 Jun 2019 17:41:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CAB62084D for ; Mon, 17 Jun 2019 17:41:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="tXpAdb8f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728689AbfFQRlc (ORCPT ); Mon, 17 Jun 2019 13:41:32 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:40142 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728681AbfFQRlb (ORCPT ); Mon, 17 Jun 2019 13:41:31 -0400 Received: by mail-qk1-f194.google.com with SMTP id c70so6682481qkg.7 for ; Mon, 17 Jun 2019 10:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=7NyA8a7gBq/nfUvm9gvQAx8nzhYfXZQghQdSoODsjl4=; b=tXpAdb8fKWZbdIAXHAp/ul+RojCF16y2UMUTvIYp8XJUgcIHz925XOcQDsauu2028K piArOf+dmyDyf98lPzqa++/2p/JIYjW0854qwVoA3Q5/TeVzki6FyURH7eEpoeJ9gOzP b6EGLo3oSdqGj7Qd+UF66OM/Z0H0v7lZbgGaESWHfntbfzYWYr4dWwvcDWtEpAFGtly/ NLN9oeA5vWdHS5MumSlTzUekgm4sWdhI5Y8MhqQUSxV8B9Oim002JQkfZfY3LmmnQfgv rx+Pi+0ji7TiTdNVfhYmzNTmKVGV7LoZ7ODkKuMtG43iQlg6gEHW5cf5IEWRxwNCQsbv yiYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=7NyA8a7gBq/nfUvm9gvQAx8nzhYfXZQghQdSoODsjl4=; b=iOO5m1hMZKJ+wzA3u+5MlZQVRtSR2FKPVk8rX97e/uYQkTnHeNAYuHWUxDgbU/4gSq eBPJhUY2ZVSlXoVsk0LfGEOrZVpZxoVsULvDUp7L3R5GItNHjSMGTL+lk+rowCBwAt2D jFRk/kGhSQnwT8lOXyRpKKXHQ2tcRH6oTT4/uKOCkal+wyIHgHSqYRAWU9wfWB9Z+e0i MPCzxj4b1gXx4HuspvS0Qma8IdAO1+5sbSmZl9B23vRcPwP3juDkVeZOjBepEc10w672 V3PXgcS+GESkx+zzOJyoG2vsbKHAlLlOYMsHgeiLmaqqXNL4DPdyCt57/0wXPsnwR1Pa S0/w== X-Gm-Message-State: APjAAAW0zA94T0gurdv9Y6XUR/C0tY2dihCH2g76YQFUAvRIoc/BXKK/ InHDivHoZoHQWFf8FSV06qe8jA== X-Google-Smtp-Source: APXvYqyZX4qTliGmBwAA0qlJazpz9hJ63jJXKXGKdIird2/HtvLBbXfXS+VbRg3jjUjjaVqlBbwUgg== X-Received: by 2002:a37:b342:: with SMTP id c63mr12619566qkf.292.1560793288588; Mon, 17 Jun 2019 10:41:28 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id 2sm7928056qtz.73.2019.06.17.10.41.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 10:41:28 -0700 (PDT) Date: Mon, 17 Jun 2019 10:41:18 -0700 From: Jakub Kicinski To: Davide Caratti Cc: "David S. Miller" , Dave Watson , Boris Pismenny , Aviad Yehezkel , John Fastabend , Daniel Borkmann , netdev@vger.kernel.org Subject: Re: [RFC PATCH net-next 1/2] tcp: ulp: add functions to dump ulp-specific information Message-ID: <20190617104118.362ac55b@cakuba.netronome.com> In-Reply-To: References: <20190605161400.6c87d173@cakuba.netronome.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 17 Jun 2019 15:06:33 +0200, Davide Caratti wrote: > > > + if (icsk->icsk_ulp_ops->get_info_size) > > > + size += icsk->icsk_ulp_ops->get_info_size(sk); > > > > I don't know the diag code, is the socket locked at this point? > > as far as I can see, it's not. Thanks a lot for noticing this! > > anyway, I see a similar pattern for icsk_ca_ops: when we set the congestion > control with do_tcp_setsockopt(), the socket is locked - but then, when 'ss' > reads a diag request with INET_DIAG_CONG bit set, the value of icsk->icsk_ca_ops > is accessed with READ_ONCE(), surrounded by rcu_read_{,un}lock(). > > Maybe it's sufficient to do something similar, and then the socket lock can be > optionally taken within icsk_ulp_ops->get_info(), only in case we need to access > members of sk that are protected with the socket lock? Sounds reasonable, we just need to keep that in mind as we extend TLS code do dump more information.