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 BDA1FA0C41 for ; 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 A2127410E5; Fri, 11 Jun 2021 09:01:39 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 1A63F4014F 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-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-SGChpUjtN1SpOc89wXfBQA-1; Fri, 11 Jun 2021 03:01:35 -0400 X-MC-Unique: SGChpUjtN1SpOc89wXfBQA-1 Received: by mail-vs1-f71.google.com with SMTP id m14-20020a67fe4e0000b0290255df7450beso1644350vsr.8 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=c6H/bkNv6CLBRdAC3rDXrHz31KGHCv7GqEmdOHsFN7TYF5sBEGg8b8FUlTP4np/+rf gN7RkH47p8g+Sun2+ZdIgrZcMnmuHgsziOacYbgru9RTApWrJ14KncPZ/eNTw+zyOpKt HYdZKA+DYc5ziv7Ucw9cGlnhjJmHPhzRZiqI6j54qYi3a1c19wH46nOT7ekY9F7G+n6z 8oe0DZ/RNzdG0YUkM5ugSR7BPkoLWj68adVhuZsKdeLkaqxtosY6UwnneRTPWuy86JvG heZS2neGP3B9mRecwgHaZS/9/4B5uXoHf7/p2Xwf6JDZB1YeVVhCc6Ylwxv9pPmCKtEP pOmg== X-Gm-Message-State: AOAM531nLuoCo3SfgwAbBbj8xeb0Uv98KqMhBsatAWpFG3Bn1yFByEt7 PLjKdewO/mK0knJefu6IvC7qO2F2HYwTV3fVfHvUZu5Ux00cjKrk6q88Tw6LPwYr1fgJLVbYCry rNwiD+cV9K95XnWlUrrVGnms= X-Received: by 2002:a67:7cc4:: with SMTP id x187mr7886669vsc.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-stable] [PATCH] examples/l2fwd: fix l2fwd long options parse issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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