From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C95D142FA5 for ; Mon, 31 Jul 2023 14:47:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB95D43251; Mon, 31 Jul 2023 14:47:36 +0200 (CEST) Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) by mails.dpdk.org (Postfix) with ESMTP id 379AE4067B; Mon, 31 Jul 2023 14:47:34 +0200 (CEST) Received: by mail-ua1-f47.google.com with SMTP id a1e0cc1a2514c-78caeb69125so1550610241.3; Mon, 31 Jul 2023 05:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690807653; x=1691412453; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T0lOTaHtNmQmmGgb5SenKh40Ov5Knk/4HH1ta1GDUqE=; b=B+9Rs0eaX9Pby1OEBvsPOhh5MM4CKbzSCZmOvk0YSdF2PpXvU/mvPMVFSYiBy2qfGg CUdgaMZRZ1ZdjMczciReP6Vqrvw6f0RTiLN85y/LwaomJPraGXif5IoryYFQCoJJ/7Ux ZgaHusz0m3i5F0jnN/sPRwNEDLRetvHQdIsdDR+4gGZaFIpDqHNsN/uzgjqKoAhaZEfx o3qW8rk0jf5sVH3c0tgffTMqcTxOKw7dNFaqhLI4IUWqSgc/8Auuuk8rH9C0lFAJpbh7 j5zZRUphMigWz9QDjtwOJ+pGtUoFGqqeQ1vcNB9Z3Ft0cGPM3t2xurpSxQwMAwU9LEsl veKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690807653; x=1691412453; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T0lOTaHtNmQmmGgb5SenKh40Ov5Knk/4HH1ta1GDUqE=; b=L8OtbgV7Ht3CTTU9y8JrjgOZqfMjTdLAguBKY6273txQhxvyz4n48YUVDgXyTMZ02q q6cYUbYP8tYz6mYkQ3HXTQjGkzhrWvClCYWCxbpT+5BxO8SUk6hatVHkNmKkilRBhwMr 9heoI4t4Xb0yXewvZQnJAwGcR8/yxvpvzEyqULd9Z7pgGm9IH/6GeJz9eE3KUd7Kf6nW PMSy3ixqIG8f43VfuPw/pq9X5tf/C68Rc7lwZhotc5hWBotJ8HdXYTbFYMv62azwk2wv TIQ+1PCp2s1P4Y4PliQYGwIau1uAAl3g4SDSBHZY+Wmva7eStKRgiuLLatXOdN7YLXVd MsPQ== X-Gm-Message-State: ABy/qLZ8i2Yg7sE922XTA2jR2PHxehsQ9TVcgsZDABe3L2a/MI9lR7Cg 2IiPGiQLtelBPWk5OG9eqidWUFkRTub39xX+PZQ= X-Google-Smtp-Source: APBJJlFCfPuDVFdHVIeC+xYU2Snrsn4vVzpKSRl4aeEGmISjV4TGGMFM+i5h5KK/S2cH+v/+bIrhovUSIX224WuzKow= X-Received: by 2002:a67:e8da:0:b0:445:3bf:9387 with SMTP id y26-20020a67e8da000000b0044503bf9387mr4788057vsn.4.1690807653387; Mon, 31 Jul 2023 05:47:33 -0700 (PDT) MIME-Version: 1.0 References: <20230731025607.3928423-1-psatheesh@marvell.com> In-Reply-To: <20230731025607.3928423-1-psatheesh@marvell.com> From: Jerin Jacob Date: Mon, 31 Jul 2023 18:17:07 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH ] common/cnxk: fix setting default flow action To: psatheesh@marvell.com Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dev@dpdk.org, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Mon, Jul 31, 2023 at 8:26=E2=80=AFAM wrote: > > From: Satheesh Paul > > For MCAM rules with PF/VF action, the PF's default rule action is > is copied and overwritten over the user provided action. Fixing this > by setting default action only if no other action (like queue) is > specified by user. > > Fixes: a07f7ced436def ("common/cnxk: add NPC init and fini") > Cc: stable@dpdk.org > > Signed-off-by: Satheesh Paul > Reviewed-by: Kiran Kumar K Updated the git commit as follows and applied to dpdk-next-net-mrvl/for-next-net. Thanks common/cnxk: fix default flow action setting For MCAM rules with PF/VF action, the PF's default rule action is is copied and overwritten over the user provided action. Fixing this by setting default action only if no other action (like queue) is specified by user. Fixes: a07f7ced436d ("common/cnxk: add NPC init and fini") Cc: stable@dpdk.org Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K > --- > drivers/common/cnxk/hw/nix.h | 1 + > drivers/common/cnxk/roc_npc.c | 17 ++++++++++------- > drivers/common/cnxk/roc_npc_mcam_dump.c | 4 ++++ > 3 files changed, 15 insertions(+), 7 deletions(-) > > diff --git a/drivers/common/cnxk/hw/nix.h b/drivers/common/cnxk/hw/nix.h > index 26dcda680e..d2c80f3c74 100644 > --- a/drivers/common/cnxk/hw/nix.h > +++ b/drivers/common/cnxk/hw/nix.h > @@ -619,6 +619,7 @@ > #define NIX_RX_ACTIONOP_RSS (0x4ull) > #define NIX_RX_ACTIONOP_PF_FUNC_DROP (0x5ull) > #define NIX_RX_ACTIONOP_MIRROR (0x6ull) > +#define NIX_RX_ACTIONOP_DEFAULT (0xfull) > > #define NIX_RX_VTAGACTION_VTAG0_RELPTR (0x0ull) > #define NIX_RX_VTAGACTION_VTAG1_RELPTR (0x4ull) > diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.= c > index 848086c8de..586bc55791 100644 > --- a/drivers/common/cnxk/roc_npc.c > +++ b/drivers/common/cnxk/roc_npc.c > @@ -726,11 +726,15 @@ npc_parse_actions(struct roc_npc *roc_npc, const st= ruct roc_npc_attr *attr, > if (req_act =3D=3D ROC_NPC_ACTION_TYPE_VLAN_STRIP) { > /* Only VLAN action is provided */ > flow->npc_action =3D NIX_RX_ACTIONOP_UCAST; > - } else if (req_act & > - (ROC_NPC_ACTION_TYPE_PF | ROC_NPC_ACTION_TYPE_VF)) { > - flow->npc_action =3D NIX_RX_ACTIONOP_UCAST; > - if (req_act & ROC_NPC_ACTION_TYPE_QUEUE) > - flow->npc_action |=3D (uint64_t)rq << 20; > + } else if (req_act & (ROC_NPC_ACTION_TYPE_PF | ROC_NPC_ACTION_TYP= E_VF)) { > + /* Check if any other action is set */ > + if ((req_act =3D=3D ROC_NPC_ACTION_TYPE_PF) || (req_act = =3D=3D ROC_NPC_ACTION_TYPE_VF)) { > + flow->npc_action =3D NIX_RX_ACTIONOP_DEFAULT; > + } else { > + flow->npc_action =3D NIX_RX_ACTIONOP_UCAST; > + if (req_act & ROC_NPC_ACTION_TYPE_QUEUE) > + flow->npc_action |=3D (uint64_t)rq << 20; > + } > } else if (req_act & ROC_NPC_ACTION_TYPE_DROP) { > flow->npc_action =3D NIX_RX_ACTIONOP_DROP; > } else if (req_act & ROC_NPC_ACTION_TYPE_QUEUE) { > @@ -741,8 +745,7 @@ npc_parse_actions(struct roc_npc *roc_npc, const stru= ct roc_npc_attr *attr, > } else if (req_act & ROC_NPC_ACTION_TYPE_SEC) { > flow->npc_action =3D NIX_RX_ACTIONOP_UCAST_IPSEC; > flow->npc_action |=3D (uint64_t)rq << 20; > - } else if (req_act & > - (ROC_NPC_ACTION_TYPE_FLAG | ROC_NPC_ACTION_TYPE_MARK))= { > + } else if (req_act & (ROC_NPC_ACTION_TYPE_FLAG | ROC_NPC_ACTION_T= YPE_MARK)) { > flow->npc_action =3D NIX_RX_ACTIONOP_UCAST; > } else if (req_act & ROC_NPC_ACTION_TYPE_COUNT) { > /* Keep ROC_NPC_ACTION_TYPE_COUNT_ACT always at the end > diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnx= k/roc_npc_mcam_dump.c > index 01c4212567..ebd2dd69c2 100644 > --- a/drivers/common/cnxk/roc_npc_mcam_dump.c > +++ b/drivers/common/cnxk/roc_npc_mcam_dump.c > @@ -496,6 +496,10 @@ npc_flow_dump_rx_action(FILE *file, uint64_t npc_act= ion) > plt_strlcpy(index_name, "Multicast/mirror table index", > NPC_MAX_FIELD_NAME_SIZE); > break; > + case NIX_RX_ACTIONOP_DEFAULT: > + fprintf(file, "NIX_RX_ACTIONOP_DEFAULT (%" PRIu64 ")\n", > + (uint64_t)NIX_RX_ACTIONOP_DEFAULT); > + break; > default: > plt_err("Unknown NIX_RX_ACTIONOP found"); > return; > -- > 2.39.2 >