From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamal Hadi Salim Subject: Re: [patch net-next v6 06/11] net: sched: use block index as a handle instead of qdisc when block is shared Date: Sun, 7 Jan 2018 08:11:19 -0500 Message-ID: <47d2949d-6ebc-6113-8bd1-3ecdb15563f8@mojatatu.com> References: <20180105230929.5645-1-jiri@resnulli.us> <20180105230929.5645-7-jiri@resnulli.us> <20180106204312.GF2099@nanopsycho> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, 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, dsahern@gmail.com To: Jiri Pirko , netdev@vger.kernel.org Return-path: Received: from mail-it0-f65.google.com ([209.85.214.65]:39633 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753283AbeAGNLX (ORCPT ); Sun, 7 Jan 2018 08:11:23 -0500 Received: by mail-it0-f65.google.com with SMTP id 68so6464947ite.4 for ; Sun, 07 Jan 2018 05:11:23 -0800 (PST) In-Reply-To: <20180106204312.GF2099@nanopsycho> Content-Language: en-GB Sender: netdev-owner@vger.kernel.org List-ID: On 18-01-06 03:43 PM, Jiri Pirko wrote: > >> @@ -886,8 +887,13 @@ static int tcf_fill_node(struct net *net, struct sk_buff *skb, >> tcm->tcm_family = AF_UNSPEC; >> tcm->tcm__pad1 = 0; >> tcm->tcm__pad2 = 0; >> - tcm->tcm_ifindex = qdisc_dev(q)->ifindex; >> - tcm->tcm_parent = parent; >> + if (q) { >> + tcm->tcm_ifindex = qdisc_dev(q)->ifindex; >> + tcm->tcm_parent = parent; >> + } else { >> + tcm->tcm_ifindex = 0; /* block index is stored in parent */ >> + tcm->tcm_parent = block->index; >> + } > > Please guys, please look at this reuse (also on clt side). I would like > you to double-check this reuse of existing API for balock_index carrying > purpose. I believe it's UAPI safe. But please, check it out carefully. > Should not break any ABI/UAPI AFAIK. Maybe go for a negative ifindex (not sure if zero means something speacial to someone). cheers, jamal