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 B49C9A0C43; Wed, 20 Oct 2021 20:34:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7720240150; Wed, 20 Oct 2021 20:34:21 +0200 (CEST) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by mails.dpdk.org (Postfix) with ESMTP id 93CE040142 for ; Wed, 20 Oct 2021 20:34:20 +0200 (CEST) Received: by mail-io1-f48.google.com with SMTP id m20so25749737iol.4 for ; Wed, 20 Oct 2021 11:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9ff0/sbBYlItxB5MLCyXmpVqgI2yin3PXiOgQOwoJOg=; b=pWFCyvQ6niLFWCHEfwotj0tIH3iyO9IiGYdQxzsmeVbhMEruEEEVIPauar/gk8Bezt FAxGjJoGFpfTvGfbJM0Y4if1gJh5s2jKwdcfoyVuJ5WvaqpH2OJTAzFIVPAU/oK7yT9L KbbXOapEpbxLFA42rY0qexREEAWeKPhCzlDdEFarzFXSXMZlBmT0ZVHJDAt2Id9oYzQX 36EQ6Eu9rFuxll/qNOg0axo7G+ZBewXuSZ/yv0m8t1vhFP3LEKRYn3Da5QJAVIXtVp9D xmCBXZK/DJfdScJnCeVwMnOSdR+tZKJWOtsTAaYwzG3Rruwzwegm+htzbfqYBxatZQwc xzCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ff0/sbBYlItxB5MLCyXmpVqgI2yin3PXiOgQOwoJOg=; b=v/4emms76b2xaTfC/4TEFKEd4J22wrxN/YLiqhq7p7aCp9zxng0ZltNNayHg84EckV 8T7RBtRs+gzjFm/BlnM+yKzbWG0iOLUWnmk3GMUbCbOtzpKTK9iu/K4hiG5NDmpx68/0 DpbexfGOjEJsKxjTD0oCfpqVjqaZ+hlhl8GYZYELrVJLn8AaUnbe3pfH6DqjQb1G9Jj1 YlJX8qkzx4wWZY7AWtn6Ff0/j6vWRYWt1O5Gwzxg756F1W3zUwIlWMA1nA+3JH5IApFh cmUUYMbhXR+gXsZIxfNWSzKIuDu9TNP6APRzyLZrc4WHCUrCKmdPemaTwXYS+l0AKFzC 2NNw== X-Gm-Message-State: AOAM5319QjDosoBZt8hcW+8y8XnFmSesEfxQuNQAMj1jUGS/6JdYuTG6 v42aoddBzKUyJ8DqpdWm3V3WQog/uN2HyBoxnK0= X-Google-Smtp-Source: ABdhPJwA4EtX/6+fXyg/QoxWLdz36pUu2yB8tAK1FHXWsIOBTTRJCxEob8Thm/uoUXUQjIAQ069AXlAdQtRuIW1T2Ww= X-Received: by 2002:a05:6602:1799:: with SMTP id y25mr619554iox.38.1634754859916; Wed, 20 Oct 2021 11:34:19 -0700 (PDT) MIME-Version: 1.0 References: <20211005033026.4180257-1-psatheesh@marvell.com> In-Reply-To: <20211005033026.4180257-1-psatheesh@marvell.com> From: Jerin Jacob Date: Thu, 21 Oct 2021 00:03:53 +0530 Message-ID: To: Satheesh Paul Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Ray Kinsella , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/2] common/cnxk: add support for rte flow port ID action type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Oct 5, 2021 at 9:00 AM wrote: > > From: Satheesh Paul > > This patch adds ROC API to support rte flow port ID action type. > > Signed-off-by: Satheesh Paul Could you rebase this series to next-net-mrvl > --- > drivers/common/cnxk/roc_npc.c | 35 +++++++++++++++++++++++++++++++++ > drivers/common/cnxk/roc_npc.h | 11 ++++++++++- > drivers/common/cnxk/version.map | 1 + > 3 files changed, 46 insertions(+), 1 deletion(-) > > diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c > index b724ff9401..658b9054d3 100644 > --- a/drivers/common/cnxk/roc_npc.c > +++ b/drivers/common/cnxk/roc_npc.c > @@ -341,11 +341,38 @@ roc_npc_fini(struct roc_npc *roc_npc) > return 0; > } > > +int > +roc_npc_validate_portid_action(struct roc_npc *roc_npc_src, > + struct roc_npc *roc_npc_dst) > +{ > + struct roc_nix *roc_nix_src = roc_npc_src->roc_nix; > + struct nix *nix_src = roc_nix_to_nix_priv(roc_nix_src); > + struct roc_nix *roc_nix_dst = roc_npc_dst->roc_nix; > + struct nix *nix_dst = roc_nix_to_nix_priv(roc_nix_dst); > + > + if (roc_nix_is_pf(roc_npc_dst->roc_nix)) { > + plt_err("Output port should be VF"); > + return -EINVAL; > + } > + > + if (nix_dst->dev.vf >= nix_src->dev.maxvf) { > + plt_err("Invalid VF for output port"); > + return -EINVAL; > + } > + > + if (nix_src->dev.pf != nix_dst->dev.pf) { > + plt_err("Output port should be VF of ingress PF"); > + return -EINVAL; > + } > + return 0; > +} > + > static int > npc_parse_actions(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, > const struct roc_npc_action actions[], > struct roc_npc_flow *flow) > { > + const struct roc_npc_action_port_id *act_portid; > struct npc *npc = roc_npc_to_npc_priv(roc_npc); > const struct roc_npc_action_mark *act_mark; > const struct roc_npc_action_queue *act_q; > @@ -407,6 +434,14 @@ npc_parse_actions(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, > pf_func = (pf_func | (vf_id + 1)); > break; > > + case ROC_NPC_ACTION_TYPE_PORT_ID: > + act_portid = (const struct roc_npc_action_port_id *) > + actions->conf; > + pf_func &= (0xfc00); > + pf_func = (pf_func | (act_portid->id + 1)); > + req_act |= ROC_NPC_ACTION_TYPE_VF; > + break; > + > case ROC_NPC_ACTION_TYPE_QUEUE: > act_q = (const struct roc_npc_action_queue *) > actions->conf; > diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h > index 65d4bd6edc..113e850b54 100644 > --- a/drivers/common/cnxk/roc_npc.h > +++ b/drivers/common/cnxk/roc_npc.h > @@ -58,7 +58,7 @@ struct roc_npc_flow_item_raw { > const uint8_t *pattern; /**< Byte string to look for. */ > }; > > -#define ROC_NPC_MAX_ACTION_COUNT 12 > +#define ROC_NPC_MAX_ACTION_COUNT 18 > > enum roc_npc_action_type { > ROC_NPC_ACTION_TYPE_END = (1 << 0), > @@ -77,6 +77,7 @@ enum roc_npc_action_type { > ROC_NPC_ACTION_TYPE_VLAN_INSERT = (1 << 13), > ROC_NPC_ACTION_TYPE_VLAN_ETHTYPE_INSERT = (1 << 14), > ROC_NPC_ACTION_TYPE_VLAN_PCP_INSERT = (1 << 15), > + ROC_NPC_ACTION_TYPE_PORT_ID = (1 << 16), > }; > > struct roc_npc_action { > @@ -94,6 +95,12 @@ struct roc_npc_action_vf { > uint32_t id; /**< VF ID. */ > }; > > +struct roc_npc_action_port_id { > + uint32_t original : 1; /**< Use original DPDK port ID if possible. */ > + uint32_t reserved : 31; /**< Reserved, must be zero. */ > + uint32_t id; /**< port ID. */ > +}; > + > struct roc_npc_action_queue { > uint16_t index; /**< Queue index to use. */ > }; > @@ -234,4 +241,6 @@ int __roc_api roc_npc_vtag_actions_sub_return(struct roc_npc *roc_npc, > uint32_t count); > int __roc_api roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, > struct roc_npc_flow *flow); > +int __roc_api roc_npc_validate_portid_action(struct roc_npc *roc_npc_src, > + struct roc_npc *roc_npc_dst); > #endif /* _ROC_NPC_H_ */ > diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map > index 926d5c2167..4cfdbf38f5 100644 > --- a/drivers/common/cnxk/version.map > +++ b/drivers/common/cnxk/version.map > @@ -286,6 +286,7 @@ INTERNAL { > roc_npc_mcam_write_entry; > roc_npc_mcam_read_counter; > roc_npc_profile_name_get; > + roc_npc_validate_portid_action; > roc_plt_init; > roc_plt_init_cb_register; > roc_sso_dev_fini; > -- > 2.25.4 >