From patchwork Fri Jan 1 23:25:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 355958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DD3EC433E0 for ; Fri, 1 Jan 2021 23:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC8602072C for ; Fri, 1 Jan 2021 23:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727146AbhAAX1N (ORCPT ); Fri, 1 Jan 2021 18:27:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbhAAX1N (ORCPT ); Fri, 1 Jan 2021 18:27:13 -0500 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050::465:102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91FDCC0613C1 for ; Fri, 1 Jan 2021 15:26:32 -0800 (PST) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4D71PH41SMzQlY3; Sat, 2 Jan 2021 00:26:27 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pmachata.org; s=MBO0001; t=1609543585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gle0vtMIVZMesU3tvmOBxGiadQ9e6zl1S4q9t4+Ukgc=; b=hOq7aQdlny0gGC6GIH0MVHl9UOm+YbtxXD2qQeCEKZ+4SCdzpS93qLN1C6u6Zvqo3puYQ1 RgqnviF5OkTNjpHfTaaf0scbbHpicAuEo1LF/7Gp4u13jPeEQ+H03Aa0Byt3zManJAmQea uU0HzKAM2k4oe7OwQuFe0nmHOaCZxhLAsasqqyCS2cd+sosADlIOd2Lqr0cFoSCKOKJ1Im cSMszOxVOFohxfqd+LM2XTXWIgg/RsnflcH9zOqg2LgmFU3he7ylTCCLD9DvcmJQaZpJpc pytncecY6EdmF2l+hv9wPjbmTKO6jy+iry3VZ72NDKR8wgd+BfTH8TtvEPxrnA== Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id 5uOPJ0T4GPwn; Sat, 2 Jan 2021 00:26:22 +0100 (CET) From: Petr Machata To: netdev@vger.kernel.org, dsahern@gmail.com, stephen@networkplumber.org Cc: Petr Machata Subject: [PATCH iproute2 1/3] dcb: Set values with RTM_SETDCB type Date: Sat, 2 Jan 2021 00:25:50 +0100 Message-Id: <61a95beac0ea7f2979ffd5ba5f4a08f000cc091a.1609543363.git.me@pmachata.org> In-Reply-To: References: MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -0.06 / 15.00 / 15.00 X-Rspamd-Queue-Id: 58D511835 X-Rspamd-UID: cac559 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org dcb currently sends all netlink messages with a type RTM_GETDCB, even the set ones. Change to the appropriate type. Signed-off-by: Petr Machata --- dcb/dcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dcb/dcb.c b/dcb/dcb.c index adec57476e1d..f5c62790e27e 100644 --- a/dcb/dcb.c +++ b/dcb/dcb.c @@ -177,7 +177,7 @@ int dcb_set_attribute(struct dcb *dcb, const char *dev, int attr, const void *da struct nlattr *nest; int ret; - nlh = dcb_prepare(dcb, dev, RTM_GETDCB, DCB_CMD_IEEE_SET); + nlh = dcb_prepare(dcb, dev, RTM_SETDCB, DCB_CMD_IEEE_SET); nest = mnl_attr_nest_start(nlh, DCB_ATTR_IEEE); mnl_attr_put(nlh, attr, data_len, data); From patchwork Fri Jan 1 23:25:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 355957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 793F5C43381 for ; Fri, 1 Jan 2021 23:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46DAC2072C for ; Fri, 1 Jan 2021 23:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727324AbhAAX1e (ORCPT ); Fri, 1 Jan 2021 18:27:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727038AbhAAX1e (ORCPT ); Fri, 1 Jan 2021 18:27:34 -0500 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F34FDC0613ED for ; Fri, 1 Jan 2021 15:26:53 -0800 (PST) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4D71PG6rjNzQlKL; Sat, 2 Jan 2021 00:26:26 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pmachata.org; s=MBO0001; t=1609543585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zCHY+iNV/zG2h4FeSKcpBhT5LjiorSyP0zYyDtzm+1k=; b=zBGmvKi54H9kKFDZSxyJO/utVZUBWTx0+fzgyjTeX/Pm+xJIgDNxRpyp+98Fa1pyrmSVo3 QJvooFIKocTXierTLKnyu9DEqMQuHCRug7Ng0uIyG1bLw6M6EcMDsUV+/GGm1G0XX02JKn aH89+dyiKiJ/WNRVdZRwHlxOAWE6Z7yyjSNHdbMjO2SH7qm+fcVBRd7Jh2sqE6vRhfSt0z stg3QrBiPK2PKKG1VY6Mnmn95akY1zjsZFzCsLXzbbikaxy9V24+qLDYal+yqtRDyhxqG+ dOlpjKvzaJYxhBhVyfHDjwq0SYdLsfiU/3d/M892Rm+i4TJUsBwur37shlmX9Q== Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id bQFvrk3rXucq; Sat, 2 Jan 2021 00:26:23 +0100 (CET) From: Petr Machata To: netdev@vger.kernel.org, dsahern@gmail.com, stephen@networkplumber.org Cc: Petr Machata Subject: [PATCH iproute2 3/3] dcb: Change --Netns/-N to --netns/-n Date: Sat, 2 Jan 2021 00:25:52 +0100 Message-Id: <5288d48567203a91e26df6ea94b59d1eb253c222.1609543363.git.me@pmachata.org> In-Reply-To: References: MIME-Version: 1.0 X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.25 / 15.00 / 15.00 X-Rspamd-Queue-Id: DD4CF1831 X-Rspamd-UID: 15f3b7 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This to keep compatible with the major tools, ip and tc. Also document the option in the man page, which was neglected. Signed-off-by: Petr Machata --- dcb/dcb.c | 8 ++++---- man/man8/dcb.8 | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dcb/dcb.c b/dcb/dcb.c index 0e3c87484f2a..6640deef5688 100644 --- a/dcb/dcb.c +++ b/dcb/dcb.c @@ -332,7 +332,7 @@ static void dcb_help(void) { fprintf(stderr, "Usage: dcb [ OPTIONS ] OBJECT { COMMAND | help }\n" - " dcb [ -f | --force ] { -b | --batch } filename [ -N | --Netns ] netnsname\n" + " dcb [ -f | --force ] { -b | --batch } filename [ -n | --netns ] netnsname\n" "where OBJECT := { buffer | ets | maxrate | pfc }\n" " OPTIONS := [ -V | --Version | -i | --iec | -j | --json\n" " | -p | --pretty | -s | --statistics | -v | --verbose]\n"); @@ -379,7 +379,7 @@ int main(int argc, char **argv) { "json", no_argument, NULL, 'j' }, { "pretty", no_argument, NULL, 'p' }, { "statistics", no_argument, NULL, 's' }, - { "Netns", required_argument, NULL, 'N' }, + { "netns", required_argument, NULL, 'n' }, { "help", no_argument, NULL, 'h' }, { NULL, 0, NULL, 0 } }; @@ -396,7 +396,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - while ((opt = getopt_long(argc, argv, "b:fhijpsvN:V", + while ((opt = getopt_long(argc, argv, "b:fhijn:psvV", long_options, NULL)) >= 0) { switch (opt) { @@ -419,7 +419,7 @@ int main(int argc, char **argv) case 's': dcb->stats = true; break; - case 'N': + case 'n': if (netns_switch(optarg)) { ret = EXIT_FAILURE; goto dcb_free; diff --git a/man/man8/dcb.8 b/man/man8/dcb.8 index 5964f25d386d..7293bb303577 100644 --- a/man/man8/dcb.8 +++ b/man/man8/dcb.8 @@ -27,6 +27,13 @@ dcb \- show / manipulate DCB (Data Center Bridging) settings .SH OPTIONS +.TP +.BR "\-n" , " \--netns " +switches +.B dcb +to the specified network namespace +.IR NETNS . + .TP .BR "\-V" , " --Version" Print the version of the