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 00F29A034E; Tue, 22 Feb 2022 19:32:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7C3740DF4; Tue, 22 Feb 2022 19:32:06 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D5AA040042 for ; Tue, 22 Feb 2022 19:32:05 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21MGu1Sd025490; Tue, 22 Feb 2022 10:32:05 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pfpt0220; bh=+1hKVB/cLse3iuAXbnt9dDvFXY4gUVQQqpxflId3iGo=; b=eHdGZjp0BGXMBbNsjLXf4uoGnyD8rfK/KwycPhGit3Z0ZY1cCDq29Q2/om8vO5y22DfV b92qmKiAyhaSVGRPhDVQB6OhZRfNOdx5JJgrSexzS8uVC3WNhamIGSpIlRPo8VbeKjQZ tog8qoIKWQ7PCTuMRgm7SQqwL0jGa4i0cDz3z/mh3E0U8Cn0m/eNuxtBMFaxzhnBMlXV r5Bu/EunREeTSjiCkkAn/4f7ZNTnSUu/5Anov9JrItuB1E5fCgi5l+m0M9eDJi3ScYAs 5K6w6+sUPhDEnA7873lMFLitUEAUn4+NQ3X0/k8G20BaORN366rizrJD3wLl3kPoDDuK CQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ecw9y2c4n-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Feb 2022 10:32:05 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Feb 2022 10:32:03 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Feb 2022 10:32:03 -0800 Received: from [10.28.175.194] (PE-LT1350.marvell.com [10.28.175.194]) by maili.marvell.com (Postfix) with ESMTP id DAAF83F7060; Tue, 22 Feb 2022 10:32:00 -0800 (PST) Message-ID: <1569098a-88ee-593f-29a4-da9a86cb4ff5@marvell.com> Date: Wed, 23 Feb 2022 00:01:59 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH 10/20] net/cnxk: added Rx metadata negotiate operation Content-Language: en-US To: Jerin Jacob CC: Jerin Jacob , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dpdk-dev References: <20220207072932.22409-1-ndabilpuram@marvell.com> <20220207072932.22409-10-ndabilpuram@marvell.com> From: Nithin Kumar Dabilpuram In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: yAvsiE1SQ-aYOy1cjFND8Re0156fxXxg X-Proofpoint-ORIG-GUID: yAvsiE1SQ-aYOy1cjFND8Re0156fxXxg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-22_06,2022-02-21_02,2021-12-02_01 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 Please see inline. Thanks Nithin On 2/17/22 7:03 PM, Jerin Jacob wrote: > On Mon, Feb 7, 2022 at 1:01 PM Nithin Dabilpuram > wrote: >> >> From: Satha Rao >> >> Added rx_metadata_negotiate api to enable mark update RX offload. >> Removed software logic to enable/disable mark update inside flow >> create/destroy apis. > > APIs Ack. > >> Signed-off-by: Satha Rao >> --- > >> +static int >> +cn10k_nix_rx_metadata_negotiate(struct rte_eth_dev *eth_dev, uint64_t *features) >> +{ >> + struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); >> + >> + *features &= >> + (RTE_ETH_RX_METADATA_USER_FLAG | RTE_ETH_RX_METADATA_USER_MARK); >> + >> + if (*features) { >> + dev->rx_offload_flags |= NIX_RX_OFFLOAD_MARK_UPDATE_F; >> + dev->rx_mark_update = true; >> + } else { >> + dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F; >> + dev->rx_mark_update = false; >> + } >> + >> + cn10k_eth_set_rx_function(eth_dev); >> + >> + return 0; >> +} > > See below. > >> >> +static int >> +cn9k_nix_rx_metadata_negotiate(struct rte_eth_dev *eth_dev, uint64_t *features) >> +{ >> + struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); >> + >> + *features &= >> + (RTE_ETH_RX_METADATA_USER_FLAG | RTE_ETH_RX_METADATA_USER_MARK); >> + >> + if (*features) { >> + dev->rx_offload_flags |= NIX_RX_OFFLOAD_MARK_UPDATE_F; >> + dev->rx_mark_update = true; >> + } else { >> + dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F; >> + dev->rx_mark_update = false; >> + } >> + >> + cn9k_eth_set_rx_function(eth_dev); >> + >> + return 0; >> +} >> + > > The above two functions are duplicates, Please pass the function > pointer and make it as one function > for common code. Though the two functions are same, the fast path offload flags used within them are defined per platform so that in future CN9K and CN10K can have different set of fast path offloads though the two hash defines are same now. They are also in mutually exclusive files.