From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ED59C4332F for ; Tue, 8 Nov 2022 18:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbiKHSzu (ORCPT ); Tue, 8 Nov 2022 13:55:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiKHSzt (ORCPT ); Tue, 8 Nov 2022 13:55:49 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B87568C77 for ; Tue, 8 Nov 2022 10:55:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BE49BB81C16 for ; Tue, 8 Nov 2022 18:55:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19F26C433C1; Tue, 8 Nov 2022 18:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667933745; bh=hcbY5QhMZtu8UK5c/lErkAa9+DDKO8NUG4RILBoWs1U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jHe4QQN5hqlryFa2UGJ6gYJDEw8sCG28Np8Ulv/QGq+YeJxbv9jw6XlUm63ZbdOPe dxdqA2Qsa9HVlL6Qj/XOpWtkbW+BVDi1fhbHdoUZWMLxlBj5hycOfzZthtJMbxgOtH q4Vs0urNX+rrv+eKGEunQtCcjZKz1DIrBfOXEmZnB7lhBFfS14hlYqqy7T8SE0COey NmazNXnyXQvprHQMZJ9lkVUskruncindrcvSYVhTCIq7OWiL83f3qYoQ3Q+gcSLjlb Oj0WfyxSxFC/f8U0Tw1calICLPyLX6nvk+ehG4fQfGpbsipE+z5pADzavNywZg9O2a wWMtZq0DFxq1Q== Date: Tue, 8 Nov 2022 10:55:44 -0800 From: Jakub Kicinski To: Hangbin Liu Cc: Jamal Hadi Salim , Marcelo Ricardo Leitner , Cong Wang , netdev@vger.kernel.org, Jiri Pirko , "David S. Miller" , Eric Dumazet , Paolo Abeni , David Ahern Subject: Re: [PATCH (repost) net-next] sched: add extack for tfilter_notify Message-ID: <20221108105544.65e728ad@kernel.org> In-Reply-To: References: <20220929033505.457172-1-liuhangbin@gmail.com> <20221102163646.131a3910@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 8 Nov 2022 17:11:22 +0800 Hangbin Liu wrote: > On Wed, Nov 02, 2022 at 04:36:46PM -0700, Jakub Kicinski wrote: > > Eish. > > > > Hangbin, I'm still against this. Please go back to my suggestions / > > questions. A tracepoint or an attribute should do. Multi-part messages > > are very hard to map to normal programming constructs, and I don't > > think there is any precedent for mutli-part notifications. > > Hi Jakub, > > I checked the doc[1], the NLMSGERR_ATTR_MSG could only be in NLMSG_ERROR and > NLMSG_DONE messages. But the tfilter_notify() set the nlmsg type to > RTM_NEWTFILTER. Would you like to help explain what you mean of using > attribute? Should I send a NLMSG_ERROR/NLMSG_DONE message separately after the > tfilter_notify()? > > [1] https://www.kernel.org/doc/html//next/userspace-api/netlink/intro.html#ext-ack My initial thought was to add an attribute type completely independent of the attribute space defined in enum nlmsgerr_attrs, add it in the TCA_* space. So for example add a TCA_NTF_WARN_MSG which will carry the string message. We can also create a nest to carry the full nlmsgerr_attrs attributes with their existing types (TCA_NTF_EXT_ACK?). Each nest gets to choose what attribute set it carries. That said, most of the ext_ack attributes refer to an input attribute by specifying the offset within the request. The notification recipient will not be able to resolve those in any meaningful way. So since only the string message will be of interest I reckon adding a full nest is an unnecessary complication?