From patchwork Wed Dec 20 17:35:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 851565 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mojatatu-com.20150623.gappssmtp.com header.i=@mojatatu-com.20150623.gappssmtp.com header.b="yFYa2q+s"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z22422nSgz9s7f for ; Thu, 21 Dec 2017 04:35:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755821AbdLTRfl (ORCPT ); Wed, 20 Dec 2017 12:35:41 -0500 Received: from mail-it0-f44.google.com ([209.85.214.44]:41499 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755532AbdLTRfj (ORCPT ); Wed, 20 Dec 2017 12:35:39 -0500 Received: by mail-it0-f44.google.com with SMTP id x28so7648339ita.0 for ; Wed, 20 Dec 2017 09:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=tB9tw6ADVbm66cpAZhw5vYigsEavu7eIuUR80jsi6io=; b=yFYa2q+sFG7eZKroxF6wblipgDWRWvwRkv20fGdcdfs0bboPxt0NOddQhA53eAR7UH xcwMLi/OSUlk2BnxRIDT8rVe+YNoLBrWRghCZKxwrWzugxg73FbWugM4xY/XIgvZqlcv rfudi3ntQ5SDFVy7IjIsqiwwH//yGIC3LYEtOoynEkUMrCMZpFavdMyGSF67Ad7FiB8Y 1VVJzHK2xvAJ8ASlAftFiYZ1QcmHGg7VyJ5PHp++aUynlSKz6nYS1FjyJXJHhOCQ4C6O Y/F2SBj1JqNzlUHOZmtBMXbGcbfeI5AAkxJGPI8p681DP8m5jtSF3IkVy4kBF3xg9Kq+ wyTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tB9tw6ADVbm66cpAZhw5vYigsEavu7eIuUR80jsi6io=; b=krzqKMgk65x9JHqfJXW2/lkSfmyQR6r2R4Ss2NkmfYXJCvnJLi8u9GXbKqxicb+nLJ rAsYLez+QV2eJbNftXpwWimu5OtLLp1Vo14i2sOhBgknSIEkRRTezR/r5JhmNy9Lr4u2 TGQq2ZBg7AaoH9qceqoNdW74etLD7S6IUZ6xKMwO98cgNKvOWx0OifdNgx7D3bGDjUKe HlnzbTQWRMzaGle5EdaKxBb4r478Xysq8CPmB0BO1RobACdnbI6UchM35agv0pMh1JIl npP7s6IXLOLKMbCd/jEmerTfGTx6ldv87S8yHcwYAss3p4I+PxvMXqe+yfj5In4o88uv uaCg== X-Gm-Message-State: AKGB3mJzlXq4kFE691jvy9EoKceMBCrcl9RywS5bTOnPEyXHBHwFuDYd 7/ZYom9sGQGiaBj2exWzEk97CA== X-Google-Smtp-Source: ACJfBosJftcjY8/PPN6ojLCko5lQvabPrYXfzqRarRwNR63HCVLwbWgqhrnALIZg2DProKY6bMTdUQ== X-Received: by 10.36.239.195 with SMTP id i186mr8201537ith.29.1513791338351; Wed, 20 Dec 2017 09:35:38 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id w75sm9687740iod.66.2017.12.20.09.35.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 09:35:37 -0800 (PST) From: Alexander Aring To: jhs@mojatatu.com Cc: xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, netdev@vger.kernel.org, kernel@mojatatu.com, Alexander Aring , David Ahern Subject: [PATCHv4 net-next 00/14] net: sched: sch: introduce extack support Date: Wed, 20 Dec 2017 12:35:10 -0500 Message-Id: <20171220173524.25874-1-aring@mojatatu.com> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, this patch series basically add support for extack in common qdisc handling. Additional it adds extack pointer to common qdisc callback handling this offers per qdisc implementation to setting the extack message for each failure over netlink. The extack message will be set deeper in qdisc functions but going not deeper as net core api. For qdisc module callback handling, the extack will not be set. This will be part of per qdisc extack handling. I also want to prepare patches to handle extack per qdisc module... so there will come a lot of more patches, just cut them down to make it reviewable. There are some above 80-chars width warnings, which I ignore because it looks more ugly otherwise. This patch-series based on patches by David Ahern which gave me some hints how to deal with extack support. Cc: David Ahern changes since v4: - rebase on current net-next/master - fix several typos (also David Ahren to Ahern, I am sorry) - Add acked by Jamal changes since v3: - remove patch 2/2 lib: nlattr: set extack msg if validate_nla fails since David Ahern has a better solution - Remove check on net admin permission since -EPERM indicates it already - Change rtab to "rate table" - this is what it's stands for - Fix cbs *not* support messages - Fix tcf block error message for allocation, allocation will be still there because there are multiple places which returns -ENOMEM - Finnally also took care about sch_atm, sorry somehow I forgot this one and I hope I didn't forgot any sch implementation to add new callback parameters changes since v2: - add fix coding style patch to catch all checkpatch warnings - add patch for setting netlink extack msg if validate_nla fails - changes in handle generic qdisc errors - remove NL_SET_ERR_MSG from memory allocation errors - remove NL_SET_ERR_MSG from device not found - change STAB to table size - add various new patches to add extack support for common TC functions like qdisc_get_rtab, tcf_block_get, qdisc_alloc and qdisc_create_dflt - users which are interessted in the detailed error messages can assign extack, otherwise NULL. - Add sch_cbq as example for qdisc_ops callback: init, qdisc_class_ops callbacks: change and graft - Add sch_cbs as example for qdisc_ops callback: change - Add sch_drr as example for qdisc_class ops callbacks: tcf_block - Alex Alexander Aring (14): net: sched: fix coding style issues net: sched: sch_api: handle generic qdisc errors net: sched: sch: add extack for init callback net: sched: sch: add extack for change qdisc ops net: sched: sch: add extack to change class net: sched: sch: add extack for block callback net: sched: sch: add extack for graft callback net: sch: api: add extack support in qdisc_get_rtab net: sch: api: add extack support in tcf_block_get net: sch: api: add extack support in qdisc_alloc net: sch: api: add extack support in qdisc_create_dflt net: sch: sch_cbq: add extack support net: sch: sch_cbs: add extack support net: sch: sch_drr: add extack support include/net/pkt_cls.h | 6 +- include/net/pkt_sched.h | 6 +- include/net/sch_generic.h | 21 ++++-- net/sched/act_police.c | 4 +- net/sched/cls_api.c | 17 +++-- net/sched/sch_api.c | 172 ++++++++++++++++++++++++++++++++-------------- net/sched/sch_atm.c | 23 ++++--- net/sched/sch_cbq.c | 78 ++++++++++++++------- net/sched/sch_cbs.c | 31 ++++++--- net/sched/sch_choke.c | 8 ++- net/sched/sch_codel.c | 8 ++- net/sched/sch_drr.c | 40 +++++++---- net/sched/sch_dsmark.c | 19 +++-- net/sched/sch_fifo.c | 11 +-- net/sched/sch_fq.c | 8 ++- net/sched/sch_fq_codel.c | 13 ++-- net/sched/sch_generic.c | 25 ++++--- net/sched/sch_gred.c | 13 ++-- net/sched/sch_hfsc.c | 28 ++++---- net/sched/sch_hhf.c | 8 ++- net/sched/sch_htb.c | 29 ++++---- net/sched/sch_ingress.c | 20 ++++-- net/sched/sch_mq.c | 8 ++- net/sched/sch_mqprio.c | 7 +- net/sched/sch_multiq.c | 19 ++--- net/sched/sch_netem.c | 10 +-- net/sched/sch_pie.c | 8 ++- net/sched/sch_plug.c | 6 +- net/sched/sch_prio.c | 18 +++-- net/sched/sch_qfq.c | 22 +++--- net/sched/sch_red.c | 13 ++-- net/sched/sch_sfb.c | 20 +++--- net/sched/sch_sfq.c | 8 ++- net/sched/sch_tbf.c | 21 +++--- net/sched/sch_teql.c | 3 +- 35 files changed, 486 insertions(+), 265 deletions(-)