Patch "nfp: flower: add hardware offload check for post ct entry" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nfp: flower: add hardware offload check for post ct entry

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfp-flower-add-hardware-offload-check-for-post-ct-en.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 435ba0cb7080cb3f0960b93523f5da947205147a
Author: Hui Zhou <hui.zhou@xxxxxxxxxxxx>
Date:   Wed Jan 24 17:19:08 2024 +0200

    nfp: flower: add hardware offload check for post ct entry
    
    [ Upstream commit cefa98e806fd4e2a5e2047457a11ae5f17b8f621 ]
    
    The nfp offload flow pay will not allocate a mask id when the out port
    is openvswitch internal port. This is because these flows are used to
    configure the pre_tun table and are never actually send to the firmware
    as an add-flow message. When a tc rule which action contains ct and
    the post ct entry's out port is openvswitch internal port, the merge
    offload flow pay with the wrong mask id of 0 will be send to the
    firmware. Actually, the nfp can not support hardware offload for this
    situation, so return EOPNOTSUPP.
    
    Fixes: bd0fe7f96a3c ("nfp: flower-ct: add zone table entry when handling pre/post_ct flows")
    CC: stable@xxxxxxxxxxxxxxx # 5.14+
    Signed-off-by: Hui Zhou <hui.zhou@xxxxxxxxxxxx>
    Signed-off-by: Louis Peens <louis.peens@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240124151909.31603-2-louis.peens@xxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
index da7a47416a208..497766ecdd91d 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
@@ -1797,10 +1797,30 @@ int nfp_fl_ct_handle_post_ct(struct nfp_flower_priv *priv,
 {
 	struct flow_rule *rule = flow_cls_offload_flow_rule(flow);
 	struct nfp_fl_ct_flow_entry *ct_entry;
+	struct flow_action_entry *ct_goto;
 	struct nfp_fl_ct_zone_entry *zt;
+	struct flow_action_entry *act;
 	bool wildcarded = false;
 	struct flow_match_ct ct;
-	struct flow_action_entry *ct_goto;
+	int i;
+
+	flow_action_for_each(i, act, &rule->action) {
+		switch (act->id) {
+		case FLOW_ACTION_REDIRECT:
+		case FLOW_ACTION_REDIRECT_INGRESS:
+		case FLOW_ACTION_MIRRED:
+		case FLOW_ACTION_MIRRED_INGRESS:
+			if (act->dev->rtnl_link_ops &&
+			    !strcmp(act->dev->rtnl_link_ops->kind, "openvswitch")) {
+				NL_SET_ERR_MSG_MOD(extack,
+						   "unsupported offload: out port is openvswitch internal port");
+				return -EOPNOTSUPP;
+			}
+			break;
+		default:
+			break;
+		}
+	}
 
 	flow_rule_match_ct(rule, &ct);
 	if (!ct.mask->ct_zone) {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux