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 104ACA034E; Tue, 21 Dec 2021 11:19:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B70C40141; Tue, 21 Dec 2021 11:19:23 +0100 (CET) Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) by mails.dpdk.org (Postfix) with ESMTP id A28C840040 for ; Tue, 21 Dec 2021 11:19:22 +0100 (CET) Received: by mail-il1-f177.google.com with SMTP id d14so9820489ila.1 for ; Tue, 21 Dec 2021 02:19:22 -0800 (PST) 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=kOpAWWlkKZnGWOJTC3KwjmtWJtTK4XWCIHjOhsr9AAA=; b=h+AHcYHg9luInspbW21AoycO9ZmTbZRxujZ2oqhruakjJuSAgwbj32Az+2chBo/txG Hy2zZSK7fb82D9Ekcy1jq4Aj6EXaJFYrthERS4X5kPU65XqjIud7Unj8pz3Woi5YwDqf ivPsL/Ecj3TkRvo3ekm7eIKciU+sbnhFaB3NK0HgDsR0bYFODquS7JdnsqDtgG4ag3Lg SoYkBLJpyCoW7tm5O2VzKDYcodf0KD8+dVpQVOtAHr0gXsvyfjWjccSG6dtm1Ltpw9RG 8GKMiavSaGEWZICHCvdAWj+YMihAweHsQLVxCWlSfUYtTyhP8L6TDM/EVkkov8nPOT3y 7mRg== 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=kOpAWWlkKZnGWOJTC3KwjmtWJtTK4XWCIHjOhsr9AAA=; b=GtDC8DOU+kMrIZH1+QYlIOuiLNEjLnXD5r69dOsPBzBuZ2VQPingTh0onZjIbMYjDm BrkoZx9cwALeQmvjzNemZxkoQF0RFodW/XMWBJQ4PXfDs9rWUQUygFKvZgGaAMueICBp axjosp3m3Fw6V1WKqIIrqAjgN89/ivgnXsc/K+dtBK3sRlOeNd2Ags1Ne3ao77NpC8lc NPGvDALQIFgwwKkVeaW06tVe7hzOmLsL59U5rWoOb01b505HfxA5jayVGodxyeK2cv/O U+A2HTZ5ujlgBFi6SXFZ6pi8Wevx6XI2Vbua2Y5SpLQO6ctWUcXggg48u0HtCtlkaD6+ jpGA== X-Gm-Message-State: AOAM531KezwAG5w5SRUUIy1s5baGzI3KgIQNQWpaxfEBlpgJN0ALPuLm E4IAz/KH1b4plVvbGlrwXFihXHpAUoQ/sIFAxrM= X-Google-Smtp-Source: ABdhPJy2GRLWCo+cVNahPo7QGX9AaJv3cBK8hP3znLluy9DmT4TaCgQamS0S4+vaGdRMcOOEMQSZbQyVNkSg6RnhCNA= X-Received: by 2002:a05:6e02:1906:: with SMTP id w6mr1195350ilu.192.1640081961959; Tue, 21 Dec 2021 02:19:21 -0800 (PST) MIME-Version: 1.0 References: <20211109094204.2343402-1-psatheesh@marvell.com> In-Reply-To: <20211109094204.2343402-1-psatheesh@marvell.com> From: Jerin Jacob Date: Tue, 21 Dec 2021 15:48:55 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH 22.02 1/2] common/cnxk: support to set channel mask for SDP interfaces To: Satheesh Paul , Ferruh Yigit , Andrew Rybchenko Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dpdk-dev Content-Type: text/plain; charset="UTF-8" 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 On Tue, Nov 9, 2021 at 3:12 PM wrote: > > From: Satheesh Paul > > ROC changes to support setting channel mask for SDP interfaces. > > Signed-off-by: Satheesh Paul Series Acked-by: Jerin Jacob Series applied to dpdk-next-net-mrvl/for-next-net. Thanks. > --- > drivers/common/cnxk/roc_npc.c | 13 +++++++++++++ > drivers/common/cnxk/roc_npc.h | 3 +++ > drivers/common/cnxk/roc_npc_mcam.c | 10 ++++++++++ > drivers/common/cnxk/roc_npc_priv.h | 3 +++ > 4 files changed, 29 insertions(+) > > diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c > index 503c74748f..d18dfd4259 100644 > --- a/drivers/common/cnxk/roc_npc.c > +++ b/drivers/common/cnxk/roc_npc.c > @@ -1152,6 +1152,19 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, > int rc; > > npc->channel = roc_npc->channel; > + npc->is_sdp_link = roc_nix_is_sdp(roc_npc->roc_nix); > + if (npc->is_sdp_link) { > + if (roc_npc->is_sdp_mask_set) { > + npc->sdp_channel = roc_npc->sdp_channel; > + npc->sdp_channel_mask = roc_npc->sdp_channel_mask; > + } else { > + /* By default set the channel and mask to cover > + * the whole SDP channel range. > + */ > + npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START; > + npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START; > + } > + } > > flow = plt_zmalloc(sizeof(*flow), 0); > if (flow == NULL) { > diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h > index e13d557136..8c24126ae8 100644 > --- a/drivers/common/cnxk/roc_npc.h > +++ b/drivers/common/cnxk/roc_npc.h > @@ -195,6 +195,9 @@ struct roc_npc { > uint64_t rx_parse_nibble; > /* Parsed RSS Flowkey cfg for current flow being created */ > uint32_t flowkey_cfg_state; > + bool is_sdp_mask_set; > + uint16_t sdp_channel; > + uint16_t sdp_channel_mask; > > #define ROC_NPC_MEM_SZ (5 * 1024) > uint8_t reserved[ROC_NPC_MEM_SZ]; > diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c > index ba7f89b45b..80851d6f9f 100644 > --- a/drivers/common/cnxk/roc_npc_mcam.c > +++ b/drivers/common/cnxk/roc_npc_mcam.c > @@ -575,6 +575,16 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow, > flow->npc_action |= (uint64_t)pf_func << 4; > flow->mcam_data[0] |= (uint64_t)inl_dev->channel; > flow->mcam_mask[0] |= (uint64_t)inl_dev->chan_mask; > + } else if (npc->is_sdp_link) { > + req->entry_data.kw[0] &= ~(GENMASK(11, 0)); > + req->entry_data.kw_mask[0] &= ~(GENMASK(11, 0)); > + req->entry_data.kw[0] |= (uint64_t)npc->sdp_channel; > + req->entry_data.kw_mask[0] |= > + (uint64_t)npc->sdp_channel_mask; > + flow->mcam_data[0] &= ~(GENMASK(11, 0)); > + flow->mcam_mask[0] &= ~(GENMASK(11, 0)); > + flow->mcam_data[0] |= (uint64_t)npc->sdp_channel; > + flow->mcam_mask[0] |= (uint64_t)npc->sdp_channel_mask; > } else { > req->entry_data.kw[0] |= (uint64_t)npc->channel; > req->entry_data.kw_mask[0] |= (BIT_ULL(12) - 1); > diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h > index 712302bc5c..86c10ea082 100644 > --- a/drivers/common/cnxk/roc_npc_priv.h > +++ b/drivers/common/cnxk/roc_npc_priv.h > @@ -360,6 +360,9 @@ struct npc { > uint32_t keyw[NPC_MAX_INTF]; /* max key + data len bits */ > uint32_t mcam_entries; /* mcam entries supported */ > uint16_t channel; /* RX Channel number */ > + bool is_sdp_link; > + uint16_t sdp_channel; > + uint16_t sdp_channel_mask; > uint32_t rss_grps; /* rss groups supported */ > uint16_t flow_prealloc_size; /* Pre allocated mcam size */ > uint16_t flow_max_priority; /* Max priority for flow */ > -- > 2.25.4 >