From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [patch net-next v7 07/13] net: sched: use block index as a handle instead of qdisc when block is shared Date: Wed, 10 Jan 2018 11:12:44 -0700 Message-ID: <2fff2eb0-6c82-ff50-481f-0636fecd0431@gmail.com> References: <20180109140731.1022-1-jiri@resnulli.us> <20180109140731.1022-8-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mlxsw@mellanox.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, michael.chan@broadcom.com, ganeshgr@chelsio.com, saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, alexander.h.duyck@intel.com, ogerlitz@mellanox.com, john.fastabend@gmail.com, daniel@iogearbox.net To: Jiri Pirko , netdev@vger.kernel.org Return-path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:33673 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbeAJSMr (ORCPT ); Wed, 10 Jan 2018 13:12:47 -0500 Received: by mail-pg0-f67.google.com with SMTP id i196so11442873pgd.0 for ; Wed, 10 Jan 2018 10:12:47 -0800 (PST) In-Reply-To: <20180109140731.1022-8-jiri@resnulli.us> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 1/9/18 7:07 AM, Jiri Pirko wrote: > diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h > index 843e29a..9c026d9 100644 > --- a/include/uapi/linux/rtnetlink.h > +++ b/include/uapi/linux/rtnetlink.h > @@ -541,9 +541,15 @@ struct tcmsg { > int tcm_ifindex; > __u32 tcm_handle; > __u32 tcm_parent; > +/* tcm_block_index is used instead of tcm_parent > + * in case tcm_ifindex == TCM_IFINDEX_MAGIC_BLOCK > + */ > +#define tcm_block_index tcm_parent > __u32 tcm_info; > }; > > +#define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU) > + > enum { > TCA_UNSPEC, > TCA_KIND, This could be more clearly documented for anyone wanting to write an app against the API. Something like: For shared blocks, tcm_ifindex is set to TCM_IFINDEX_MAGIC_BLOCK, and tcm_parent is aliased to tcm_block_index which is the block index.