From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82DD081AC8 for ; Thu, 28 Mar 2024 16:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711641856; cv=none; b=YPWqHzsF5O3H7qK9cmBsAvul9Fl/eN8HpC0doB9JNrHoAlAmmBZubQe7GgDsSi/dlzfWkimSXB1ae604QTGe37uoEM6d1JBtK1h1yWlELmHSrNwLLaFylOEdV3XcyNHIQOwjIJoBmkedvHSgVePie0zu41Q+t+LIeks6Ni8sK54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711641856; c=relaxed/simple; bh=KK2v1418WypJheLGoKpRArY2cxHxE+8oYPik6mgxvOA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SfKcpuRcEM54WSHjyGY8clSPeNFpzuKZA30NosfDd2vEjzh27WKyxx/hqI1QZImvCigAUszilI0pjhj6FwFWRFVAOKjAQiMzlJBEWA6a3DlHyK+s3rcZ+V8ZFcL+5YUNiLM4e6LNwjv8KYHjt/OXMLumkbC9tiComMq11igGidE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m4RGhuJ5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m4RGhuJ5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 040B6C433F1; Thu, 28 Mar 2024 16:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711641856; bh=KK2v1418WypJheLGoKpRArY2cxHxE+8oYPik6mgxvOA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=m4RGhuJ5+tB5O0WnEURm52VlT1uZlUVhQ0ZbtdYEWj91dbv2UXmhwIe6Qm3tapx03 18+emVjrVQI0Bh65tslmKhGbCR0G/PlKe9+w2YeJhjp1EjXUZCmvnUqSGKTM4lbMHD XOud7zWUCKQqNAe1uni+7Ter2XCrBTw8YuQaSX5h7f3wlqQZEMS5mX3X8+YhOT/6mJ s7mPxokTUyXK9RqllGktY5fHrI9iFPjwKU4NPCnebQ63VJsdiW/1h/hHeDPMEeMpyl 0aolY21QIeG/X9v/lf+AiC7uvn9xMNDIHI7T4MhORY6+KcMRUyFC+ayjjv3vDPRwd8 QtmOaj2zpgBaw== Date: Thu, 28 Mar 2024 09:04:15 -0700 From: Jakub Kicinski To: Hangbin Liu Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Donald Hunter , Jiri Pirko , Jacob Keller , Stanislav Fomichev Subject: Re: [PATCH net-next 2/2] ynl: support un-nest sub-type for indexed-array Message-ID: <20240328090415.3a6a7fb9@kernel.org> In-Reply-To: References: <20240326063728.2369353-1-liuhangbin@gmail.com> <20240326063728.2369353-3-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 28 Mar 2024 15:41:53 +0800 Hangbin Liu wrote: > > # ip link add bond0 type bond mode 1 \ > > arp_ip_target 192.168.1.1,192.168.1.2 ns_ip6_target 2001::1,2001::2 > > # ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_link.yaml \ > > --do getlink --json '{"ifname": "bond0"}' --output-json | jq '.linkinfo' > > > > "arp-ip-target": [ > > { > > "1": "192.168.1.1" > > }, > > { > > "2": "192.168.1.2" > > } > > ], > > For index array, do you think if we need to add the index in the result > like upper example? Or we just omit the index and show it like: Yes, the index in some funny dumps can actually be non-contiguous. You should use the value from the attr, like the nest does.