From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4735CA0559; Mon, 16 Mar 2020 16:30:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 81BD51C07B; Mon, 16 Mar 2020 16:30:06 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 63B881C0AD for ; Mon, 16 Mar 2020 16:30:05 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02GFKT7C029483 for ; Mon, 16 Mar 2020 08:30:04 -0700 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 : content-type : mime-version; s=pfpt0818; bh=Li4bn9v2MrbFt75MQxX9pvhoZ2qDe/DeGrEt/eLkyE4=; b=vhbo2Z/gSdFafLbN3KerPP17sTb2d7V9/JvIEMtcOn7SVqjECm4Uu8kDnINYBd4ptaFs V3URk0blbD6WIIRGuW0FB9xn1hxJAQ667ZfVVPGeV1e279+MP1e0mJ17M7kGsgjsiPjV JdK6sB7c1m3N8gdd304iuHIK6BB0lvAadLpWYJSdWI8VIfxDv3u5sOA7n64PJGjmf6+H xwMymoEBoojsAbDP08/1kr1nfyzvGIHqNKJ9im+NljQ76S+qQe9I6AC9pYnrt7KvFBH4 BY/taE0qlJdBOK1jdKtaszWuZ4sdwdsxQ3YXxgeQldaQOpRULJtr+CJCzZqmMeueSJy8 /Q== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2yrxsmf9em-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 16 Mar 2020 08:30:04 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Mar 2020 08:30:03 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Mar 2020 08:30:02 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.50) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 16 Mar 2020 08:30:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b4xe4Gw5wx3bxXGdPXz6MBAkjidKrtVwHY4p1jYj3k9VRoLabESAIO4cqpJz0k34tdTmU+BeUp9CVN011VkfXSEvIIgnGDe7i3rkaUKguyCJndSJbgkK3gMxzL7AR7fSYJDo0MUhGWncfdh65IGmhpYxRYy7KJUr1SS3LPiPq4v0roTJ3L+s2Uk5fBwa/ZXA9ILUWMXCMn3XLxK5FPX4SQcPtoxZuo2jsnUY9R/i5ErF8iOHmyvE62h88ny8MwDQVaa6v0eeZ1Qms4R+jU2LbeVZtf7E+joj3MTSb/rnDYremmDpHeQMBLMbemQo6wsT0FnaVLaRkB0FlaAVxPkxbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Li4bn9v2MrbFt75MQxX9pvhoZ2qDe/DeGrEt/eLkyE4=; b=TL1EE45bWwoMzZdJ7nfKUZMcUjty8WXa0o2GJk0rMm9HaBWAa5o+DkquDygnO2auItKqrdqnHTeA6dxgFV09PSZLAdEaiAQamtz9Jv5fNnCw4jHN9J5FP03yDX8lp7B9OfetQ4p35hEg6eTqLh/CLJCbKp7WB513MSQmwkHWaKxryzcHrRc5SPAgYztcEehoH/l8J8mG1g6FzdJJUHe/V49Kt0GvoWxp6ugooiIw/JRDDJzyG8LAf92crHcHgSLy836jxOYvoVYM3d06NRRqeKLgJxOHc2RY+ehXBGuM8h5YFggSTTIXmUL+AIJw56GiUO6+cn6DtGtg/5fXkxNFfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Li4bn9v2MrbFt75MQxX9pvhoZ2qDe/DeGrEt/eLkyE4=; b=fXO553irKf+Qi6WJtiKChs/WbZfhpeybzcjgn4z2BhWZ2seUutgDp7yXAb1jGXnHV8c+r6IBtiMJ8N+H0X7IKxbOKwnE0l6JHtFuyrcc2KGJ4H3tkLYPmG8Gr7s+Ww4OPjqy8I3fC2g5ITbshVlwHlYaPatZ09O5YOA5/k9XbY0= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) by MN2PR18MB3592.namprd18.prod.outlook.com (2603:10b6:208:26c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.19; Mon, 16 Mar 2020 15:30:00 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::f829:3e55:94f6:4efb]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::f829:3e55:94f6:4efb%5]) with mapi id 15.20.2814.021; Mon, 16 Mar 2020 15:30:00 +0000 From: Harman Kalra To: CC: , Date: Mon, 16 Mar 2020 20:59:12 +0530 Message-ID: <1584372553-28710-4-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584372553-28710-1-git-send-email-hkalra@marvell.com> References: <1584372553-28710-1-git-send-email-hkalra@marvell.com> Content-Type: text/plain X-ClientProxiedBy: BM1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::22) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hkarlara-OptiPlex-3046.marvell.com (115.113.156.2) by BM1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2814.13 via Frontend Transport; Mon, 16 Mar 2020 15:29:58 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a13d6021-17b1-4b1a-deac-08d7c9bee3d8 X-MS-TrafficTypeDiagnostic: MN2PR18MB3592: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:220; X-Forefront-PRVS: 03449D5DD1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(39850400004)(136003)(376002)(346002)(396003)(199004)(66476007)(956004)(478600001)(66556008)(186003)(86362001)(26005)(16526019)(36756003)(66946007)(6486002)(4326008)(6636002)(316002)(55236004)(7696005)(37006003)(52116002)(107886003)(2616005)(8676002)(8936002)(2906002)(81166006)(5660300002)(81156014)(34206002)(6666004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3592; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HLUAtquGREfkJ0xYfYKe686V7XAKducUBks6VGjUn6QUbVdgdaqfGpB1a7ABC7A+YREgSewcD4sbnOEyvZmGCGJOeUICgwwgLbsN5RB+ZVfmoql7UivP11N4c8dDNlFvXRvOHjGibWFTLghV10LuoVFI9BQwJcoKmuPvgJW4P98IsQQOt86BeHWunwz3Gph3RgU6CCnIOBkMsqGg9oHoG4viGkKDSq6zZZnR6WdkEmEKxM5UoDXfoM9siNv2MywK44JPa9FZT8wWwlxEjEUPpVQL3cYowsIurDKWcLho7zYD2hiKkldODRXktKzFF/oY4JyJJ7wHEcrYkXWL1DSQi+3ERieE4C1RWP0E1V/vO/qM8xU+cexgLVDsTrRTyVvAb/e3Ztyac8jpLgzEo0WRgMzeaSDWZhN7NEE4hbO2epzaBrEhMbWLyOfHKYLrR055 X-MS-Exchange-AntiSpam-MessageData: 24OSTmXDJfCrgpmi2hBCjhtZYOLSrmtmNJz25w1VtkFEGXqLo1+9wjofOrDgOgbW4gD587fi12+xr/Ef+BWkfGNz763QPfaqdKOzwZ3M5rdxvPfISGg38XRQTRHrdfsTP5Hb+jFTHRUt59d9eFokIw== X-MS-Exchange-CrossTenant-Network-Message-Id: a13d6021-17b1-4b1a-deac-08d7c9bee3d8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2020 15:30:00.5681 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s+baOmCURwwxAgiox+sjU1tXpyECDyNvnJ7QnHbDT7QACMUb8f+GGroJx9Pnxk0c/UWZ6ykjM/agKNJ7TiNetA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3592 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-16_06:2020-03-12, 2020-03-16 signatures=0 Subject: [dpdk-dev] [PATCH 3/4] event/octeontx: add VLAN filter offload support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Vamsi Attunuru Adding rx burst function pointer hooks for vlan filter offload in event PMD. Signed-off-by: Vamsi Attunuru --- drivers/event/octeontx/ssovf_worker.c | 38 +++++++++++++++------------ drivers/event/octeontx/ssovf_worker.h | 9 +++++++ drivers/net/octeontx/octeontx_rxtx.h | 11 +++++--- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c index 5d8e213ce..093f6f000 100644 --- a/drivers/event/octeontx/ssovf_worker.c +++ b/drivers/event/octeontx/ssovf_worker.c @@ -91,7 +91,7 @@ ssows_release_event(struct ssows *ws) ssows_swtag_untag(ws); } -#define R(name, f0, flags) \ +#define R(name, f1, f0, flags) \ static uint16_t __rte_noinline __hot \ ssows_deq_ ##name(void *port, struct rte_event *ev, uint64_t timeout_ticks) \ { \ @@ -347,49 +347,53 @@ SSO_TX_ADPTR_ENQ_FASTPATH_FUNC dev->txa_enqueue_same_dest = dev->txa_enqueue; /* Assigning dequeue func pointers */ - const event_dequeue_t ssow_deq[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_ ##name, + const event_dequeue_t ssow_deq[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; dev->dequeue = ssow_deq + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; - const event_dequeue_burst_t ssow_deq_burst[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_burst_ ##name, + const event_dequeue_burst_t ssow_deq_burst[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_burst_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; dev->dequeue_burst = ssow_deq_burst + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; if (edev->is_timeout_deq) { - const event_dequeue_t ssow_deq_timeout[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_timeout_ ##name, + const event_dequeue_t ssow_deq_timeout[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_timeout_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; - dev->dequeue = ssow_deq_timeout - [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; + dev->dequeue = ssow_deq_timeout + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] + [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; - const event_dequeue_burst_t ssow_deq_timeout_burst[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_timeout_burst_ ##name, + const event_dequeue_burst_t ssow_deq_timeout_burst[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_timeout_burst_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; - dev->dequeue_burst = ssow_deq_timeout_burst - [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; + dev->dequeue_burst = ssow_deq_timeout_burst + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] + [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; } } diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index 61332304a..e23bd057e 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -84,6 +84,15 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info, mbuf->data_len = mbuf->pkt_len; } + if (!!(flag & OCCTX_RX_VLAN_FLTR_F)) { + if (likely(wqe->s.w2.vv)) { + mbuf->ol_flags |= PKT_RX_VLAN; + mbuf->vlan_tci = + ntohs(*((uint16_t *)((char *)mbuf->buf_addr + + mbuf->data_off + wqe->s.w4.vlptr + 2))); + } + } + mbuf->port = rte_octeontx_pchan_map[port_info >> 4][port_info & 0xF]; rte_mbuf_refcnt_set(mbuf, 1); diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h index e7656f333..515c4699a 100644 --- a/drivers/net/octeontx/octeontx_rxtx.h +++ b/drivers/net/octeontx/octeontx_rxtx.h @@ -489,10 +489,13 @@ T(noff_ol3ol4csum_l3l4csum_mseg, 1, 1, 1, 1, 14, \ MULT_F) /* RX offload macros */ +#define VLAN_FLTR_F OCCTX_RX_VLAN_FLTR_F #define MULT_RX_F OCCTX_RX_MULTI_SEG_F -/* [MULTI_SEG] */ -#define OCCTX_RX_FASTPATH_MODES \ -R(no_offload, 0, OCCTX_RX_OFFLOAD_NONE) \ -R(mseg, 1, MULT_RX_F) \ +/* [VLAN_FLTR][MULTI_SEG] */ +#define OCCTX_RX_FASTPATH_MODES \ +R(no_offload, 0, 0, OCCTX_RX_OFFLOAD_NONE) \ +R(mseg, 0, 1, MULT_RX_F) \ +R(vlan, 1, 0, VLAN_FLTR_F) \ +R(vlan_mseg, 1, 1, VLAN_FLTR_F | MULT_RX_F) #endif /* __OCTEONTX_RXTX_H__ */ -- 2.18.0