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 3BA70A00C3; Mon, 19 Sep 2022 15:30:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2329840E0F; Mon, 19 Sep 2022 15:30:41 +0200 (CEST) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by mails.dpdk.org (Postfix) with ESMTP id 06BD940141 for ; Mon, 19 Sep 2022 15:30:39 +0200 (CEST) Received: by mail-qk1-f177.google.com with SMTP id d17so19649766qko.13 for ; Mon, 19 Sep 2022 06:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=FYIgXe0fSMgZYF2LdmpImBnkVOZD/W94TT2/caB5gic=; b=Iu9873mN7ohs1NgTdiJS0Dp+3Wiphv0jjjWdQcBtRnsvb/jeyw0kDY37/09mtGLPAn HfC3jZ50WVZr1wSR2hVixoQ+feXlw6kL4jm+XpmvC6tr9qrn/6RrM9yv3JQf9mtksdFp PHIF6N7B6CgU8vcMoxmq5TGRljf25TduF8AzmGcdj+eyZzsGcBOUpqy454cxE4aeHMz3 gWxAxPgWr6/Nett25GHhSDJHoWhAKxTZ65EiJ0BMEAKCIcWHhC2P6rsxNoddp8VxAgb2 J47GesJW1sNRlpzsyH0ZnXd0RCLZGUNVZE6G7/HesBS2zociZ0VzugE1ZAATkleBDrEt gKtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=FYIgXe0fSMgZYF2LdmpImBnkVOZD/W94TT2/caB5gic=; b=J3fGduFPKx5ocNeJdE+XSIGvKMlYr8nnPurfbrSZzujKH0KMc7nTryFW/VQ6Rz0GEW PryRNpUtcRW5ppXjwK+IML4zsEBrHTVcWYFKpIiUjhoq/cL8Hu+GcPLZf9bgE8CCQwYR UezwAXVXH6O/91h5W0mObA38bfUQaqRckrZ2F0+GGAP8f73Kyf14l+ddrxphJFRr5JiJ 6K6xpwUdLDZ8ZIP6VyGMQwlbas3bpiTFV5N0+ZsDkgyaT8/qn5UfkNtqtLf5IbAxROJE ITjIfbKuTunVtlQwv110ZjysyoC1iw4IMINdPI+KHk6gyzY33iE7kV6fjb9xuQaJbwpd 045w== X-Gm-Message-State: ACrzQf023m3oW6E4u8+SYrifcrrs0GPasb/WHyMn2Fee5OVV6xyYUZGo 4/iCqF3gVYJ1ABVkWCwFxF9CeqgiXLZMIbOX0UM= X-Google-Smtp-Source: AMsMyM4XSTGKjfpY/cSu3pnzqfYJf3hnXekPD5gUqu3R2hwJ8cz4kVidCAUTBXUZ0p4NIYHLuEjfxmxmn0vTPHABOzU= X-Received: by 2002:ae9:efc4:0:b0:6cb:e44c:723a with SMTP id d187-20020ae9efc4000000b006cbe44c723amr12416984qkg.402.1663594238230; Mon, 19 Sep 2022 06:30:38 -0700 (PDT) MIME-Version: 1.0 References: <20220801061629.1862969-1-psatheesh@marvell.com> <20220829062442.49728-1-psatheesh@marvell.com> <20220829062442.49728-3-psatheesh@marvell.com> In-Reply-To: <20220829062442.49728-3-psatheesh@marvell.com> From: Jerin Jacob Date: Mon, 19 Sep 2022 19:00:11 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH v2 3/3] common/cnxk: update MKEX capability flags To: psatheesh@marvell.com Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dev@dpdk.org 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 Mon, Aug 29, 2022 at 11:55 AM wrote: > > From: Satheesh Paul > > Update MKEX capability flags to enable parsing > VLAN PCP, DSCP and GTPv1 TEID. > > Signed-off-by: Satheesh Paul > Reviewed-by: Kiran Kumar K > --- Series applied to dpdk-next-net-mrvl/for-next-net. Thanks. > v2: > * Fixed clang build issue > > drivers/common/cnxk/roc_npc_mcam.c | 86 ++++++++++++------------------ > drivers/common/cnxk/roc_npc_priv.h | 12 +++-- > 2 files changed, 44 insertions(+), 54 deletions(-) > > diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c > index 245eeb0107..82a9756189 100644 > --- a/drivers/common/cnxk/roc_npc_mcam.c > +++ b/drivers/common/cnxk/roc_npc_mcam.c > @@ -232,80 +232,64 @@ npc_get_kex_capability(struct npc *npc) > memset(&kex_cap, 0, sizeof(kex_cap)); > > /* Ethtype: Offset 12B, len 2B */ > - kex_cap.bit.ethtype_0 = npc_is_kex_enabled( > - npc, NPC_LID_LA, NPC_LT_LA_ETHER, 12 * 8, 2 * 8); > + kex_cap.bit.ethtype_0 = npc_is_kex_enabled(npc, NPC_LID_LA, NPC_LT_LA_ETHER, 12 * 8, 2 * 8); > /* QINQ VLAN Ethtype: offset 8B, len 2B */ > - kex_cap.bit.ethtype_x = npc_is_kex_enabled( > - npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 8 * 8, 2 * 8); > + kex_cap.bit.ethtype_x = > + npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 8 * 8, 2 * 8); > /* VLAN ID0 : Outer VLAN: Offset 2B, len 2B */ > - kex_cap.bit.vlan_id_0 = npc_is_kex_enabled( > - npc, NPC_LID_LB, NPC_LT_LB_CTAG, 2 * 8, 2 * 8); > - /* VLAN ID0 : Inner VLAN: offset 6B, len 2B */ > - kex_cap.bit.vlan_id_x = npc_is_kex_enabled( > - npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 6 * 8, 2 * 8); > + kex_cap.bit.vlan_id_0 = npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_CTAG, 2 * 8, 2 * 8); > + /* VLAN PCP0 : Outer VLAN: Offset 2B, len 1B */ > + kex_cap.bit.vlan_pcp_0 = npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_CTAG, 2 * 8, 2 * 1); > + /* VLAN IDX : Inner VLAN: offset 6B, len 2B */ > + kex_cap.bit.vlan_id_x = > + npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 6 * 8, 2 * 8); > /* DMCA: offset 0B, len 6B */ > - kex_cap.bit.dmac = npc_is_kex_enabled(npc, NPC_LID_LA, NPC_LT_LA_ETHER, > - 0 * 8, 6 * 8); > + kex_cap.bit.dmac = npc_is_kex_enabled(npc, NPC_LID_LA, NPC_LT_LA_ETHER, 0 * 8, 6 * 8); > /* IP proto: offset 9B, len 1B */ > - kex_cap.bit.ip_proto = > - npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 9 * 8, 1 * 8); > + kex_cap.bit.ip_proto = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 9 * 8, 1 * 8); > + /* IPv4 dscp: offset 1B, len 1B, IPv6 dscp: offset 0B, len 2B */ > + kex_cap.bit.ip_dscp = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 1 * 8, 1 * 8) && > + npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, 0, 2 * 8); > /* UDP dport: offset 2B, len 2B */ > - kex_cap.bit.udp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, > - NPC_LT_LD_UDP, 2 * 8, 2 * 8); > + kex_cap.bit.udp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_UDP, 2 * 8, 2 * 8); > /* UDP sport: offset 0B, len 2B */ > - kex_cap.bit.udp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, > - NPC_LT_LD_UDP, 0 * 8, 2 * 8); > + kex_cap.bit.udp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_UDP, 0 * 8, 2 * 8); > /* TCP dport: offset 2B, len 2B */ > - kex_cap.bit.tcp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, > - NPC_LT_LD_TCP, 2 * 8, 2 * 8); > + kex_cap.bit.tcp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_TCP, 2 * 8, 2 * 8); > /* TCP sport: offset 0B, len 2B */ > - kex_cap.bit.tcp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, > - NPC_LT_LD_TCP, 0 * 8, 2 * 8); > + kex_cap.bit.tcp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_TCP, 0 * 8, 2 * 8); > /* IP SIP: offset 12B, len 4B */ > - kex_cap.bit.sip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, > - 12 * 8, 4 * 8); > + kex_cap.bit.sip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 12 * 8, 4 * 8); > /* IP DIP: offset 14B, len 4B */ > - kex_cap.bit.dip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, > - 14 * 8, 4 * 8); > + kex_cap.bit.dip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 14 * 8, 4 * 8); > /* IP6 SIP: offset 8B, len 16B */ > - kex_cap.bit.sip6_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, > - 8 * 8, 16 * 8); > + kex_cap.bit.sip6_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, 8 * 8, 16 * 8); > /* IP6 DIP: offset 24B, len 16B */ > - kex_cap.bit.dip6_addr = npc_is_kex_enabled( > - npc, NPC_LID_LC, NPC_LT_LC_IP6, 24 * 8, 16 * 8); > + kex_cap.bit.dip6_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, 24 * 8, 16 * 8); > /* ESP SPI: offset 0B, len 4B */ > - kex_cap.bit.ipsec_spi = npc_is_kex_enabled(npc, NPC_LID_LE, > - NPC_LT_LE_ESP, 0 * 8, 4 * 8); > + kex_cap.bit.ipsec_spi = npc_is_kex_enabled(npc, NPC_LID_LE, NPC_LT_LE_ESP, 0 * 8, 4 * 8); > /* VXLAN VNI: offset 4B, len 3B */ > - kex_cap.bit.ld_vni = npc_is_kex_enabled(npc, NPC_LID_LE, > - NPC_LT_LE_VXLAN, 0 * 8, 3 * 8); > + kex_cap.bit.ld_vni = npc_is_kex_enabled(npc, NPC_LID_LE, NPC_LT_LE_VXLAN, 0 * 8, 3 * 8); > > /* Custom L3 frame: varied offset and lengths */ > - kex_cap.bit.custom_l3 = > - npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_CUSTOM0, 0, 0); > - kex_cap.bit.custom_l3 |= (uint64_t)npc_is_kex_enabled(npc, NPC_LID_LC, > - NPC_LT_LC_CUSTOM1, 0, 0); > + kex_cap.bit.custom_l3 = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_CUSTOM0, 0, 0); > + kex_cap.bit.custom_l3 |= > + (uint64_t)npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_CUSTOM1, 0, 0); > /* SCTP sport : offset 0B, len 2B */ > - kex_cap.bit.sctp_sport = npc_is_kex_enabled( > - npc, NPC_LID_LD, NPC_LT_LD_SCTP, 0 * 8, 2 * 8); > + kex_cap.bit.sctp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_SCTP, 0 * 8, 2 * 8); > /* SCTP dport : offset 2B, len 2B */ > - kex_cap.bit.sctp_dport = npc_is_kex_enabled( > - npc, NPC_LID_LD, NPC_LT_LD_SCTP, 2 * 8, 2 * 8); > + kex_cap.bit.sctp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_SCTP, 2 * 8, 2 * 8); > /* ICMP type : offset 0B, len 1B */ > - kex_cap.bit.icmp_type = npc_is_kex_enabled( > - npc, NPC_LID_LD, NPC_LT_LD_ICMP, 0 * 8, 1 * 8); > + kex_cap.bit.icmp_type = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_ICMP, 0 * 8, 1 * 8); > /* ICMP code : offset 1B, len 1B */ > - kex_cap.bit.icmp_code = npc_is_kex_enabled( > - npc, NPC_LID_LD, NPC_LT_LD_ICMP, 1 * 8, 1 * 8); > + kex_cap.bit.icmp_code = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_ICMP, 1 * 8, 1 * 8); > /* ICMP id : offset 4B, len 2B */ > - kex_cap.bit.icmp_id = npc_is_kex_enabled(npc, NPC_LID_LD, > - NPC_LT_LD_ICMP, 4 * 8, 2 * 8); > + kex_cap.bit.icmp_id = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_ICMP, 4 * 8, 2 * 8); > /* IGMP grp_addr : offset 4B, len 4B */ > - kex_cap.bit.igmp_grp_addr = npc_is_kex_enabled( > - npc, NPC_LID_LD, NPC_LT_LD_IGMP, 4 * 8, 4 * 8); > + kex_cap.bit.igmp_grp_addr = > + npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_IGMP, 4 * 8, 4 * 8); > /* GTPU teid : offset 4B, len 4B */ > - kex_cap.bit.gtpu_teid = npc_is_kex_enabled( > - npc, NPC_LID_LE, NPC_LT_LE_GTPU, 4 * 8, 4 * 8); > + kex_cap.bit.gtpv1_teid = npc_is_kex_enabled(npc, NPC_LID_LE, NPC_LT_LE_GTPU, 4 * 8, 4 * 8); > return kex_cap.all_bits; > } > > diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h > index b08539d8f8..1a597280d1 100644 > --- a/drivers/common/cnxk/roc_npc_priv.h > +++ b/drivers/common/cnxk/roc_npc_priv.h > @@ -100,6 +100,7 @@ enum npc_err_status { > enum npc_mcam_intf { NPC_MCAM_RX, NPC_MCAM_TX }; > > typedef union npc_kex_cap_terms_t { > + /** Packet Matching Rule term fields */ > struct { > /** Total length of received packet */ > uint64_t len : 1; > @@ -111,10 +112,14 @@ typedef union npc_kex_cap_terms_t { > uint64_t vlan_id_0 : 1; > /** Last VLAN ID (inner) */ > uint64_t vlan_id_x : 1; > + /** PCP in the first VLAN header */ > + uint64_t vlan_pcp_0 : 1; > /** destination MAC address */ > uint64_t dmac : 1; > /** IP Protocol or IPv6 Next Header */ > uint64_t ip_proto : 1; > + /** DSCP in IP header */ > + uint64_t ip_dscp : 1; > /** Destination UDP port, implies IPPROTO=17 */ > uint64_t udp_dport : 1; > /** Destination TCP port implies IPPROTO=6 */ > @@ -155,12 +160,13 @@ typedef union npc_kex_cap_terms_t { > uint64_t sctp_sport : 1; > /** Destination SCTP port */ > uint64_t sctp_dport : 1; > - /** GTPU Tunnel endpoint identifier */ > - uint64_t gtpu_teid : 1; > - > + /** GTPv1 tunnel endpoint identifier */ > + uint64_t gtpv1_teid : 1; > } bit; > + > /** All bits of the bit field structure */ > uint64_t all_bits; > + > } npc_kex_cap_terms_t; > > struct npc_parse_item_info { > -- > 2.35.3 >