mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eddy Tao <taoyuan_eddy@hotmail.com>
To: Simon Horman <simon.horman@corigine.com>
Cc: netdev@vger.kernel.org, Pravin B Shelar <pshelar@ovn.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	dev@openvswitch.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v1 1/1] net: openvswitch: remove unnecessary vlan init in key_extract
Date: Wed, 8 Feb 2023 11:08:44 +0800	[thread overview]
Message-ID: <OS3P286MB229533DAC2CF9CE98C54B428F5D89@OS3P286MB2295.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <Y+KIr5Pwlpoy/sn3@corigine.com>

Hi, Simon:

     Thanks for looking into this. by looking into the compiled 
instructions, i am convinced the patch is logically correct but not help 
in performance, and it adds complexity,

Below function is actually optimized to one movq instruction with no 
special -O settings on my centos8, which seems good enough for me

static void clear_vlan(struct sw_flow_key *key)
{
     key->eth.vlan.tci = 0;
     key->eth.vlan.tpid = 0;
     key->eth.cvlan.tci = 0;
     key->eth.cvlan.tpid = 0;
}

optimized to movq   $0x0,0x158(%rbx)

I am withdrawing this patch

About your comment below, since it is after the parse_vlan handling, the 
code looks fine and does not affect the logic of the patch

 >>I think you missed the following case further down: >>>>if 
(unlikely(key->eth.type == htons(0))) Have a great day

eddy




      reply	other threads:[~2023-02-08  3:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  4:31 Eddy Tao
2023-02-07 17:21 ` Simon Horman
2023-02-08  3:08   ` Eddy Tao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OS3P286MB229533DAC2CF9CE98C54B428F5D89@OS3P286MB2295.JPNP286.PROD.OUTLOOK.COM \
    --to=taoyuan_eddy@hotmail.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    --cc=simon.horman@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®