From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next v7 07/13] net: sched: use block index as a handle instead of qdisc when block is shared Date: Thu, 11 Jan 2018 10:38:06 +0100 Message-ID: <20180111093806.GB2053@nanopsycho.orion> References: <20180109140731.1022-1-jiri@resnulli.us> <20180109140731.1022-8-jiri@resnulli.us> <2fff2eb0-6c82-ff50-481f-0636fecd0431@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, 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: David Ahern Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:41599 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932547AbeAKJiI (ORCPT ); Thu, 11 Jan 2018 04:38:08 -0500 Received: by mail-wm0-f68.google.com with SMTP id g75so4186316wme.0 for ; Thu, 11 Jan 2018 01:38:08 -0800 (PST) Content-Disposition: inline In-Reply-To: <2fff2eb0-6c82-ff50-481f-0636fecd0431@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Wed, Jan 10, 2018 at 07:12:44PM CET, dsahern@gmail.com wrote: >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. Okay, will add this comment here.