From patchwork Thu Dec 21 06:38:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 135419 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79F964373A; Thu, 21 Dec 2023 07:38:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54B45402EA; Thu, 21 Dec 2023 07:38:34 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6AECE402E5; Thu, 21 Dec 2023 07:38:33 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BL6IGIt019052; Wed, 20 Dec 2023 22:38:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= pfpt0220; bh=XcXY827QeAhyBRHbze6bb6+dxR0jQBMiwvhXmWGl0TE=; b=W88 ySSMG0y2zQ+t+UgXScoaXr0RaU2C9Fxbv69zIyd6QCIZgYyA8fg+YdZCybUJ4YSz VKSnke8tPb7jDigGj5Pj3V1RqaVCxx2LnBh7ruKcncrfIbGV5S6zrb6aURd0e2+R rN/hk1wXidOCgsSZycXRsIUr5kHJUk1hE53pxXk7CdfbHDYRm3PPd7NfK7/wzwON L2yHibXLzKtdw8H0vwCv2CtP+KaDL4hAF8gaAWhrN48amvb4Fk7/Q5siMZrFyw2t P7cXuVbAWhj0tyF83FBavrIIv/NgQH08pysi4yftyzDvLkZlpJZQrsJeZNXXNUDH Kdo3g95Su4JDz1EnTQQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3v4fyr037x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 22:38:32 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 20 Dec 2023 22:38:30 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 20 Dec 2023 22:38:30 -0800 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id C80793F7057; Wed, 20 Dec 2023 22:38:27 -0800 (PST) From: Harman Kalra To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Harman Kalra , Subject: [PATCH 1/2] common/cnxk: fix mbox region copy Date: Thu, 21 Dec 2023 12:08:10 +0530 Message-ID: <20231221063811.17376-1-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Proofpoint-GUID: 4su7V-sdqJrQmCk8JKHHTj8_9I_B58KL X-Proofpoint-ORIG-GUID: 4su7V-sdqJrQmCk8JKHHTj8_9I_B58KL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 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 Using proper API to perform copy to mbox device memory region Fixes: 02719901d50f ("common/cnxk: send link status event to VF") Cc: stable@dpdk.org Signed-off-by: Harman Kalra --- drivers/common/cnxk/roc_dev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c index e7e89bf3d6..084343c3b4 100644 --- a/drivers/common/cnxk/roc_dev.c +++ b/drivers/common/cnxk/roc_dev.c @@ -198,9 +198,8 @@ af_pf_wait_msg(struct dev *dev, uint16_t vf, int num_msg) vf_msg = mbox_alloc_msg(&dev->mbox_vfpf_up, vf, sz); if (vf_msg) { mbox_req_init(MBOX_MSG_CGX_LINK_EVENT, vf_msg); - memcpy((uint8_t *)vf_msg + - sizeof(struct mbox_msghdr), &linfo, - sizeof(struct cgx_link_user_info)); + mbox_memcpy((uint8_t *)vf_msg + sizeof(struct mbox_msghdr), &linfo, + sizeof(struct cgx_link_user_info)); vf_msg->rc = msg->rc; vf_msg->pcifunc = msg->pcifunc; From patchwork Thu Dec 21 06:38:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 135420 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A316C4373A; Thu, 21 Dec 2023 07:38:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCB5D40E36; Thu, 21 Dec 2023 07:38:37 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B0E86402E5; Thu, 21 Dec 2023 07:38:36 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BL1SX8u027848; Wed, 20 Dec 2023 22:38:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=pfpt0220; bh=NLIYJZDCkkRy0qAfV+2IE RmCb69ich11pUDgfrmtWks=; b=P0saWLQcrmvST7u3hL1OiPLGpYqgXC80g0h7E sVu815TonCB6ObdLH3ShTYaeZMEidLL4iHX5J2QrqCO1A/FT6pWzrR2xqFEUiInC 4JY4OxlfCKwERgz5KlPx+mY788GSi06NZlvnGhQeMWffa7kXJR0J9lgmsu6btKea bNBjeQWV3fMmp1bZZwd3m7stPhcjHFYxTMaJlxOr9YjQr9kMO04RpP9we2rKjytB /P6iSamAhKxJwcKqh/iqyFQ4DCicBHpVQ3q2emC3HJxbpTN61uNiXWKNfv677DZr mOQg/ujUVaK31AQMXrd/Cpn4oS8pBLRucK/UdNmNdO3esrAqg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3v3ntrpp0f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 22:38:35 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 20 Dec 2023 22:38:33 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 20 Dec 2023 22:38:33 -0800 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id 1CF843F7079; Wed, 20 Dec 2023 22:38:30 -0800 (PST) From: Harman Kalra To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Harman Kalra , Subject: [PATCH 2/2] common/cnxk: fix VLAN check for inner header Date: Thu, 21 Dec 2023 12:08:11 +0530 Message-ID: <20231221063811.17376-2-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231221063811.17376-1-hkalra@marvell.com> References: <20231221063811.17376-1-hkalra@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: BHtTI10zjgYFFHf5RofkwwsJXcC543u- X-Proofpoint-ORIG-GUID: BHtTI10zjgYFFHf5RofkwwsJXcC543u- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 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 Adding the has vlan check in inner headers i.e in LF layer. If has_vlan is 0 it should be masked out while installing flow rule. Fixes: c34ea71b878d ("common/cnxk: add NPC parsing API") Cc: stable@dpdk.org Signed-off-by: Harman Kalra --- drivers/common/cnxk/roc_npc_parse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c index 9ceb707ebb..571d6b8e5d 100644 --- a/drivers/common/cnxk/roc_npc_parse.c +++ b/drivers/common/cnxk/roc_npc_parse.c @@ -1097,6 +1097,7 @@ npc_parse_lf(struct npc_parse_state *pst) { const struct roc_npc_item_info *pattern, *last_pattern; char hw_mask[NPC_MAX_EXTRACT_HW_LEN]; + const struct roc_npc_flow_item_eth *eth_item; struct npc_parse_item_info info; int lid, lt, lflags; int nr_vlans = 0; @@ -1113,10 +1114,12 @@ npc_parse_lf(struct npc_parse_state *pst) lt = NPC_LT_LF_TU_ETHER; lflags = 0; + eth_item = pst->pattern->spec; + /* No match support for vlan tags */ info.def_mask = NULL; info.hw_mask = NULL; - info.len = pst->pattern->size; + info.len = sizeof(eth_item->hdr); info.spec = NULL; info.mask = NULL; info.hw_hdr_len = 0; @@ -1147,12 +1150,15 @@ npc_parse_lf(struct npc_parse_state *pst) } info.hw_mask = &hw_mask; - info.len = pst->pattern->size; + info.len = sizeof(eth_item->hdr); info.hw_hdr_len = 0; npc_get_hw_supp_mask(pst, &info, lid, lt); info.spec = NULL; info.mask = NULL; + if (eth_item && eth_item->has_vlan) + pst->set_vlan_ltype_mask = true; + rc = npc_parse_item_basic(pst->pattern, &info); if (rc != 0) return rc;