From: Simon Horman <simon.horman@corigine.com>
To: Marcin Szycik <marcin.szycik@linux.intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
Subject: Re: [PATCH iwl-next 1/2] ice: Add direction metadata
Date: Fri, 23 Jun 2023 09:25:04 +0200 [thread overview]
Message-ID: <ZJVI0CaH2haaM8Br@corigine.com> (raw)
In-Reply-To: <20230622133513.28551-2-marcin.szycik@linux.intel.com>
On Thu, Jun 22, 2023 at 03:35:12PM +0200, Marcin Szycik wrote:
> Currently it is possible to create a filter which breaks TX traffic, e.g.:
>
> tc filter add dev $PF1 ingress protocol ip prio 1 flower ip_proto udp
> dst_port $PORT action mirred egress redirect dev $VF1_PR
>
> This adds a rule which might match both TX and RX traffic, and in TX path
> the PF will actually receive the traffic, which breaks communication.
>
> To fix this, add a match on direction metadata flag when adding a tc rule.
>
> Because of the way metadata is currently handled, a duplicate lookup word
> would appear if VLAN metadata is also added. The lookup would still work
> correctly, but one word would be wasted. To prevent it, lookup 0 now always
> contains all metadata. When any metadata needs to be added, it is added to
> lookup 0 and lookup count is not incremented. This way, two flags residing
> in the same word will take up one word, instead of two.
>
> Note: the drop action is also affected, i.e. it will now only work in one
> direction.
>
> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-06-23 7:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 13:35 [PATCH iwl-next 0/2] ice: Direction metadata in tc filter Marcin Szycik
2023-06-22 13:35 ` [PATCH iwl-next 1/2] ice: Add direction metadata Marcin Szycik
2023-06-23 7:25 ` Simon Horman [this message]
2023-07-03 11:50 ` [Intel-wired-lan] " Buvaneswaran, Sujai
2023-06-22 13:35 ` [PATCH iwl-next 2/2] ice: Rename enum ice_pkt_flags values Marcin Szycik
2023-06-23 7:32 ` Simon Horman
2023-07-03 11:51 ` [Intel-wired-lan] " Buvaneswaran, Sujai
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=ZJVI0CaH2haaM8Br@corigine.com \
--to=simon.horman@corigine.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=marcin.szycik@linux.intel.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).