patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
	Chaoyong He <chaoyong.he@corigine.com>,
	stable@dpdk.org
Subject: [PATCH v2 1/6] net/nfp: fix the set MAC flow action
Date: Tue, 21 Feb 2023 18:35:08 +0800	[thread overview]
Message-ID: <20230221103513.412-2-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20230221103513.412-1-chaoyong.he@corigine.com>

The former logic of set MAC source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right MAC address as expected.

Fixes: 4f6983154570 ("net/nfp: support MAC source flow action")
Fixes: eecc7ca3088a ("net/nfp: support MAC destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 0c38925701..f373171d7e 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2066,6 +2066,7 @@ nfp_flow_action_set_mac(char *act_data,
 		bool mac_src_flag,
 		bool mac_set_flag)
 {
+	uint8_t i;
 	size_t act_size;
 	struct nfp_fl_act_set_eth *set_eth;
 	const struct rte_flow_action_set_mac *set_mac;
@@ -2084,9 +2085,13 @@ nfp_flow_action_set_mac(char *act_data,
 	if (mac_src_flag) {
 		rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff;
 	} else {
 		rte_memcpy(&set_eth->eth_addr[0],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[i] = 0xff;
 	}
 }
 
-- 
2.29.3


  parent reply	other threads:[~2023-02-21 10:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230221064930.3399-1-chaoyong.he@corigine.com>
2023-02-21  6:49 ` [PATCH " Chaoyong He
2023-02-21  6:49 ` [PATCH 2/6] net/nfp: fix the set IPv4 " Chaoyong He
2023-02-21  6:49 ` [PATCH 3/6] net/nfp: fix the set IPv6 " Chaoyong He
2023-02-21  6:49 ` [PATCH 4/6] net/nfp: fix the set TP " Chaoyong He
2023-02-21  6:49 ` [PATCH 5/6] net/nfp: fix the set TTL " Chaoyong He
2023-02-21  6:49 ` [PATCH 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He
     [not found] ` <20230221103513.412-1-chaoyong.he@corigine.com>
2023-02-21 10:35   ` Chaoyong He [this message]
2023-02-21 10:35   ` [PATCH v2 2/6] net/nfp: fix the set IPv4 " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 3/6] net/nfp: fix the set IPv6 " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 4/6] net/nfp: fix the set TP " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 5/6] net/nfp: fix the set TTL " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He

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=20230221103513.412-2-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=stable@dpdk.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).