From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Mashak Subject: Re: [PATCH net-next 1/1] net sched qdisc: pass netlink message flags in event notification Date: Thu, 02 Nov 2017 18:44:48 -0400 Message-ID: <85h8ucgv1b.fsf@mojatatu.com> References: <1509054014-23254-1-git-send-email-mrv@mojatatu.com> <85mv4atyk6.fsf@mojatatu.com> <85o9ooo6g0.fsf@mojatatu.com> <85fua0nxnu.fsf@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain Cc: David Miller , Linux Kernel Network Developers , Jamal Hadi Salim , Jiri Pirko To: Cong Wang Return-path: Received: from mail-io0-f169.google.com ([209.85.223.169]:48302 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934438AbdKBWov (ORCPT ); Thu, 2 Nov 2017 18:44:51 -0400 Received: by mail-io0-f169.google.com with SMTP id d66so2455945ioe.5 for ; Thu, 02 Nov 2017 15:44:50 -0700 (PDT) In-Reply-To: (Cong Wang's message of "Tue, 31 Oct 2017 17:55:00 -0700") Sender: netdev-owner@vger.kernel.org List-ID: Cong Wang writes: > On Mon, Oct 30, 2017 at 2:17 PM, Roman Mashak wrote: >> Cong Wang writes: >> >>> On Mon, Oct 30, 2017 at 11:07 AM, Roman Mashak wrote: >>>> Cong Wang writes: >>>> >>>>> On Sat, Oct 28, 2017 at 8:36 PM, Roman Mashak wrote: >>>>>> Cong Wang writes: >>>>> >>>>> Hmm, I thought you use RTM_NEWQDISC+RTM_DELQDISC to >>>>> determine it is replacement, no? >>>> >>>> Create is RTM_NEWQDISC and NLM_F_EXCL|NLM_F_CREATE, replacement is >>>> RTM_NEWQDISC and NLM_F_REPLACE in netlink flags. >>> >>> Is there any reason we can't use RTM_NEWQDISC+RTM_DELQDISC >>> rather than NLM_F_REPLACE to determine it is replacement? >>> >> >> I'm not sure this would be valid semantics for replace operation, look at >> the rfc3549: >> >> Additional flag bits for NEW requests >> NLM_F_REPLACE Replace existing matching config object with >> this request. >> > > I am not saying NLM_F_REPLACE is not correct, I am saying the > RTM_NEWQDISC+RTM_DELQDISC in a same message probably > exists for a reason. > > >>> Note, RTM_NEWQDISC+RTM_DELQDISC are put in a same >>> message not two. >> >> Hmm, could you clarify how do you expect to put two event IDs in nlmsg_type? > > Looking at qdisc_notify(), it is essentially two skb_put() on a same > skb, right? So two nlmsghdr in one skb? Or I read it wrong? So there will be two netlink messages in a single skb, and the user receives two events. But apparently this only happens when a new _egress_ qdisc is being added and the default egress qdisc is deleted.