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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 AAD8DC43218 for ; Fri, 26 Apr 2019 16:45:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8438E20679 for ; Fri, 26 Apr 2019 16:45:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbfDZQpO (ORCPT ); Fri, 26 Apr 2019 12:45:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:53506 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726049AbfDZQpN (ORCPT ); Fri, 26 Apr 2019 12:45:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 02AA5ACB1; Fri, 26 Apr 2019 16:45:11 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 3B8B5E0143; Fri, 26 Apr 2019 18:45:11 +0200 (CEST) Date: Fri, 26 Apr 2019 18:45:11 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Johannes Berg , David Ahern , "David S. Miller" , Jiri Pirko , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "netfilter-devel@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next 0/3] make nla_nest_start() add NLA_F_NESTED flag Message-ID: <20190426164511.GJ26549@unicorn.suse.cz> References: <1dcb87486a96785e3b9e6f337392aa904d977a0d.camel@sipsolutions.net> <20190426111954.GG26549@unicorn.suse.cz> <20190426115629.GH26549@unicorn.suse.cz> <18db9ac8b398b215e3523dd5b79c7f86e21864ce.camel@sipsolutions.net> <47f6daf9-2d14-1566-8ed1-fb5d4dd57bf8@gmail.com> <9d9f2e4465ce80593b3a5d08e9948304bdcefbf4.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d9f2e4465ce80593b3a5d08e9948304bdcefbf4.camel@sipsolutions.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 06:02:38PM +0200, Johannes Berg wrote: > On Fri, 2019-04-26 at 09:00 -0600, David Ahern wrote: > > > > What is a valid use case for an attribute sometimes being a nest and > > sometimes not? That seems really weird to me (ie., wrong). They should > > be 2 separate attributes even if the backend processing is the same. > > Yeah, well, in the mentioned case - NL80211_ATTR_VENDOR_DATA - we > basically have something that each driver (sometimes each operation that > uses it) decides what it means, and most drivers like proper netlink > attributes so have nested stuff there. Sometimes not, though in Prague > we decided we should make that documented by requiring a nested policy > and (perhaps, TBD) using something like an ERR_PTR() for "I really want > this to be binary". > > I think as far as this particular attribute is concerned the ship has > sailed, but in the future I'd probably advocate having two attributes. Or put the binary into the nest which would also make it easier to add more data or switch to structured information later. Michal