DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@arknetworks.am>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	stable@dpdk.org,
	Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,
	Andy Moreton <amoreton@xilinx.com>
Subject: [PATCH] net/sfc: fix MAC address entry leak in transfer flow parsing
Date: Tue, 14 Feb 2023 17:06:59 +0400	[thread overview]
Message-ID: <20230214130659.6971-1-ivan.malov@arknetworks.am> (raw)

When the action parsing helper discovers it can "attach" to
an existing action set, it must invoke "delete" on the MAC
address(es) that it has "attached" to during parsing. That
is because the action set itself (i.e. not the flow rule
entry) holds a reference of the address(es).

Fixes: 4c6005999e41 ("net/sfc: support MAC address edits in transfer flows")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_mae.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index aab697b204..c254562696 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -3912,6 +3912,8 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 
 	spec_mae->action_set = sfc_mae_action_set_attach(sa, &ctx);
 	if (spec_mae->action_set != NULL) {
+		sfc_mae_mac_addr_del(sa, ctx.src_mac);
+		sfc_mae_mac_addr_del(sa, ctx.dst_mac);
 		sfc_mae_encap_header_del(sa, ctx.encap_header);
 		efx_mae_action_set_spec_fini(sa->nic, ctx.spec);
 		return 0;
-- 
2.17.1


             reply	other threads:[~2023-02-14 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14 13:06 Ivan Malov [this message]
2023-02-14 13:41 ` Andrew Rybchenko
2023-02-14 18:50   ` Ferruh Yigit

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=20230214130659.6971-1-ivan.malov@arknetworks.am \
    --to=ivan.malov@arknetworks.am \
    --cc=amoreton@xilinx.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=viacheslav.galaktionov@arknetworks.am \
    /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).