From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 238FAA0C40; Fri, 11 Jun 2021 09:01:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFF4A4067C; Fri, 11 Jun 2021 09:01:38 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 949034014F for ; Fri, 11 Jun 2021 09:01:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623394897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BCXh/cSP7xJj7d1olRiuiIKPDYixxGPxHPbpDHD/9vI=; b=hnfd9UYGQ2GgR6Jo4Ir9IM1Q2dD8FSgWFXfPAfE7VhUrL+NxiP7R1ofLcjeUXWw6+BwhuH ZfjVDaFJXMYWhVaEdFwUo/4Jijgx24ELrAB5UQMUA/N+r0ZyIF43MAEmi7XBQfr4xVPrCp XPYx5DDN8moA7F75wni+35lE4Wthndk= Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-580--cua1cUcOWerp2P21mqZmw-1; Fri, 11 Jun 2021 03:01:35 -0400 X-MC-Unique: -cua1cUcOWerp2P21mqZmw-1 Received: by mail-ua1-f71.google.com with SMTP id f15-20020a9f2bcf0000b02901f8fe91b89cso2137711uaj.0 for ; Fri, 11 Jun 2021 00:01:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BCXh/cSP7xJj7d1olRiuiIKPDYixxGPxHPbpDHD/9vI=; b=Bp7AlD3IjhuwmmsVbNavfT1yFRESMIBZ801bl0awQqJingiRDjy4lfGiIgz8eWiKzO okMFkIw8lxgs/dgMwP2rho/FmuNOZvr68l298RxaPGyAHpC/HLRNfrUCVLZ2UZXevvTG KR+cFeruXw68XAjU57cXwDpsoy8yTaAsxTIFUiPIsBwYGQ1AVNH6ZG9SdHfDKu19gVs2 hcRndr3sCN1oM+94f2CuGZYt4L6WMK95bYy1AAgzZzXIBt4pa+DDcpI3NThofmH0dXDA F6TFo7eYz+apY9tsC8cLnXaYHulK7IBuMFcOQcr5nlTqOIvJTI9/Sktppz2hzf7PV+IP /fqQ== X-Gm-Message-State: AOAM532klwhCJRsxbd+uiQagGcnq7a0r6ut7MRpVem1d9o2b7I+7LbRa 8pax3guA/04WZDbMYKu25kDnkG/FvnxfmuksjtU8I1/k+4eJK9zo1CD07j2zh6sYLWQ6iOByEXW WX/ov2J45SqHzUesEcR0= X-Received: by 2002:a67:7cc4:: with SMTP id x187mr7886672vsc.17.1623394895341; Fri, 11 Jun 2021 00:01:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv8E+vYTQkrirn61QfmCfixXs5RTqviAHI+snRuGA+yf0c+eZuHYRipZspi7TOalptMmuyGxtkMw8ByyjTIhg= X-Received: by 2002:a67:7cc4:: with SMTP id x187mr7886649vsc.17.1623394895109; Fri, 11 Jun 2021 00:01:35 -0700 (PDT) MIME-Version: 1.0 References: <20210610010159.1813398-1-sunchenglian@loongson.cn> In-Reply-To: <20210610010159.1813398-1-sunchenglian@loongson.cn> From: David Marchand Date: Fri, 11 Jun 2021 09:01:23 +0200 Message-ID: To: SunChengLian Cc: dev , dpdk stable , Bruce Richardson Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/l2fwd: fix l2fwd long options parse issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jun 10, 2021 at 3:02 AM SunChengLian wrote: > > Readd other long options case in l2fwd_parse_args function > to ensure all long options will work well. Please, be more explicit about the thing you want to fix. I understand --no-mac-updating is broken. You want to fix this long option. Is this correct? The Fixes: should follow the common format. I recommend setting this alias in your config so that you only need to call "git fixline $sha1": $ git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'" So here, it should be: Fixes: fa19eb20d212 ("examples/l2fwd: add forwarding port mapping option") And I recommend aligning this example with others. Iow do something like: diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 32d405e65a..06cf8e1f14 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -433,13 +433,14 @@ enum { /* first long only option value must be >= 256, so that we won't * conflict with short options */ - CMD_LINE_OPT_MIN_NUM = 256, + CMD_LINE_OPT_MAC_UPDATING_NUM = 256, + CMD_LINE_OPT_NO_MAC_UPDATING_NUM, CMD_LINE_OPT_PORTMAP_NUM, }; static const struct option lgopts[] = { - { CMD_LINE_OPT_MAC_UPDATING, no_argument, &mac_updating, 1}, - { CMD_LINE_OPT_NO_MAC_UPDATING, no_argument, &mac_updating, 0}, + { CMD_LINE_OPT_MAC_UPDATING, no_argument, 0, CMD_LINE_OPT_MAC_UPDATING_NUM}, + { CMD_LINE_OPT_NO_MAC_UPDATING, no_argument, 0, CMD_LINE_OPT_NO_MAC_UPDATING_NUM}, { CMD_LINE_OPT_PORTMAP_CONFIG, 1, 0, CMD_LINE_OPT_PORTMAP_NUM}, {NULL, 0, 0, 0} }; @@ -492,6 +493,14 @@ l2fwd_parse_args(int argc, char **argv) break; /* long options */ + case CMD_LINE_OPT_MAC_UPDATING_NUM: + mac_updating = 1; + break; + + case CMD_LINE_OPT_NO_MAC_UPDATING_NUM: + mac_updating = 0; + break; + case CMD_LINE_OPT_PORTMAP_NUM: ret = l2fwd_parse_port_pair_config(optarg); if (ret) { In a followup patch, the "mac-updating" option can be removed since the associated mac_updating variable is set to 1 by default. -- David Marchand