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 B8C09A034F; Wed, 10 Nov 2021 14:56:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BA834068B; Wed, 10 Nov 2021 14:56:25 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 79F7840683 for ; Wed, 10 Nov 2021 14:56:23 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10163"; a="256362220" X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208";a="256362220" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2021 05:56:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208";a="452307372" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga003.jf.intel.com with ESMTP; 10 Nov 2021 05:56:22 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 10 Nov 2021 05:56:21 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 10 Nov 2021 05:56:21 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 10 Nov 2021 05:56:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=njLxEAsz7HAGikC3etDAf5wBa53p3OX8kJ9yZ0QnC7RGMDG6hy+DAefN2gMBmbMWPcKBw2gKtazqRZtxaVPUR3dQ4xLHZKSpVfY4I9W2ISs2BXyJne/TeQR/uTTJWs/6LviB7Q7G97yEUnvMtHf3CwnjyYeh5kyZb/C+4Ywjvo3W6oUWHxyOt9iXgBD1Ehsg39D/vvvWZRMQu0NF1Sey84rmuh1CTZnpe/ruYA9EdlpNmCQoHEt8xoc2HZSpshILHJCNc2ql0HlPTMy6B4oL0Ri+HNaYIf0e6u2r8Op4hTKuoU6DBKNp1O85l0mnlwA4ZETCH6cFEkVRLNfKcPQ/FA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l48J84SOBNWrEmbYC9xdypHNx2RAymsxU9zAPtxP5eg=; b=BponxJHbb1Up8evC7ZZSsrBi6K66TiTM8qyy9fTA6jv8N7s9R1rpLa9i4W/4BqSXunuyvnYO7sX8v04u6hBEVCLM39EgYz7bRGPAjbUdibk+DFRlpb3bpv3wOu6hhd2erozHzAZ7w51K3Oh4Fqi7VBs+x6cJsrW9cfsxQK5eERPK2j4IQqsRCQpA0FLBuEhUy+XrgTf5f+jk82baqlV8X8raaR4DsnFwY1UzRBDuUrp48HyHVOvIhqevKbRcV7fuvzUFrgUd0UtidXIghlaBBJFfOq94gh7HXM+9Oh6G/8uhm0J40EIxQbaGA76YVQL13sp5+qxiLs0ii3q6eA/sQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l48J84SOBNWrEmbYC9xdypHNx2RAymsxU9zAPtxP5eg=; b=BebZReWvXjcQgxVmCkGPAo0SFqW1je7kBRfXseelj5NVCjwglNQncSQFqF2IGbRw4QIfui6liDQ96L68FMFJT4yjROux4rPYOnaSvODNMOxk2lq/n/z/LOHCMqeI5V8JOej/W2mLdfokVcOjaGOIOGZJbKZ/xlUvLmlySejI3pE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5079.namprd11.prod.outlook.com (2603:10b6:510:3d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Wed, 10 Nov 2021 13:56:20 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%6]) with mapi id 15.20.4669.017; Wed, 10 Nov 2021 13:56:20 +0000 Message-ID: Date: Wed, 10 Nov 2021 13:56:14 +0000 Content-Language: en-US To: Apeksha Gupta , , CC: , , References: <20211109113432.11876-6-apeksha.gupta@nxp.com> <20211110074829.16654-1-apeksha.gupta@nxp.com> <20211110074829.16654-5-apeksha.gupta@nxp.com> From: Ferruh Yigit Subject: Re: [PATCH v9 4/5] net/enetfec: add Rx/Tx support X-User: ferruhy In-Reply-To: <20211110074829.16654-5-apeksha.gupta@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0197.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::22) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO4P123CA0197.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.17 via Frontend Transport; Wed, 10 Nov 2021 13:56:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9919fd8d-7423-404b-cf03-08d9a451dfc0 X-MS-TrafficTypeDiagnostic: PH0PR11MB5079: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lvod+JojxTxmGBJ2r7YokYQLOCBF7PrBn4Y1WK2MIHge0tj3OOnaw/Vdj19KyTmsm1Y5hkNpeI+C3VYltnQCZXxUqFZmSxSzOA/VB12AGLFWjKy99R/q46aBpSBSjBhIUiG5ob3vbxsMvmen6IsPQPlKX3QKXs9LbKihgjc+6LDcl/ghrcnRLMYKoLAGWFcZAkHgplNN8VZXGBbTQAe/kOUzzzlkxIy57nPnGi8NfoqSbLbDd/X4SqOxxDwV8w9dhlw+KaVtuAeh2eon50xzIYUjh/EwKylSQQ9AbJgoSHDFN+wrlDBGYTrFv2F/Mni3IvRP6t5Musx9tr6fXSBH3Z2Mxyst2E/Ku97JeCm9yPLeADSH/JyQavwdx+DPtTclDXWYDdHPxt56bQVY0FxUGJ2/rPS9IKcS56/vKn6WCRGkJClXRG9/VoAIWch5uLNtmwcvLKhV6/ih8ADxHnb0hndR3XkzNkX/bEMC81tQUk+FzdSydUHvuk62Hh5ZrokNf4Kof18aXGM1sCG/5a+BPeK57801bO3ob/GVS3VmXxQAZxyZ6TO9lpLYKlb3+oYzuIE7p0NNcQ8cM+JnRIHw9NUJBz3UAbJ0T0AUoxFnVmDXLXAjeEdaM5DT2SU+fR1OgTUnsiev+bSKrs5J1KaV7UHb+RROcbPTlydISOijoROBv0uo8FRhsmeCYhr704kY38+/xFUoRPaGcbYfW/QNzg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(508600001)(2616005)(956004)(83380400001)(16576012)(8936002)(4326008)(6486002)(31696002)(6666004)(44832011)(8676002)(36756003)(82960400001)(31686004)(38100700002)(186003)(2906002)(53546011)(66476007)(66556008)(66946007)(26005)(86362001)(316002)(5660300002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WjdTR3IwVzhLWkYxejVRWTc4cjM4R3liUWpXVEdzVEhnYU5yM3Z5RzRNUEdQ?= =?utf-8?B?bGIyRWtBREx6NzBMVnBhNllRUDFQKzJNVVgydVpUaE4vNHRiZGEzWjc4UU5s?= =?utf-8?B?NW5jYjNWd0lhMWFNM0t0U3hORE1xODFyeHRlbFhPTHFCN1p2UEdEcmpLTm9m?= =?utf-8?B?U0ZIZDJKUG9aMW1tWVhBM3JRMmp1cHEwak04U2Uybm80YzRjMnZOT3E1b3RT?= =?utf-8?B?SVdJb1cvR2NrM0dITVhBUjdSN3VUalJkNjRldElzdENoeXdXWVladHpmVDV4?= =?utf-8?B?NW41Rk9Ka0FjdFNtUEsxMzBtWFFQV3JtS201d0dpWkdxU1dINFFzK3dPZlNw?= =?utf-8?B?cVRyeGVGM3gyOWpkOU5JUFFsdDhvbW9iejBqK0pWL1NnT2lHR3M3dlBVMVJr?= =?utf-8?B?M1doeFpFbDNMc1VKanNOeTNmU2VVclVTNGxzbWZDUUpFOG5MdlpHb1NKMFVl?= =?utf-8?B?RlZVZzVmUjNxTGZQM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B5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 13:56:20.5197 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s2sdjlprX4H3jAOn10I8+8FJzWe5xUOUFbLmufobUOxmpYSJK/SDfAU7zJMUiD+WMIJJC+zuLdlstr2hWkdOzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5079 X-OriginatorOrg: intel.com 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 11/10/2021 7:48 AM, Apeksha Gupta wrote: > This patch adds burst enqueue and dequeue operations to the enetfec > PMD. Loopback mode is also added, compile time flag 'ENETFEC_LOOPBACK' is > used to enable this feature. By default loopback mode is disabled. > Basic features added like promiscuous enable, basic stats. > Commit log needs to be updated since 'ENETFEC_LOOPBACK' is not more exists. > Signed-off-by: Sachin Saxena > Signed-off-by: Apeksha Gupta <...> > +static int > +enetfec_eth_link_update(struct rte_eth_dev *dev, > + int wait_to_complete __rte_unused) > +{ > + struct rte_eth_link link; > + unsigned int lstatus = 1; > + > + memset(&link, 0, sizeof(struct rte_eth_link)); > + > + link.link_status = lstatus; > + link.link_speed = ETH_SPEED_NUM_1G; Can you please use updated macro: RTE_ETH_SPEED_NUM_1G <...> > +/* This function does enetfec_rx_queue processing. Dequeue packet from Rx queue > + * When update through the ring, just set the empty indicator. > + */ > +uint16_t > +enetfec_recv_pkts(void *rxq1, __rte_unused struct rte_mbuf **rx_pkts, I am sure 'rx_pkts' is used, can drop '__rte_unused'. > + uint16_t nb_pkts) > +{ > + struct rte_mempool *pool; > + struct bufdesc *bdp; > + struct rte_mbuf *mbuf, *new_mbuf = NULL; > + unsigned short status; > + unsigned short pkt_len; > + int pkt_received = 0, index = 0; > + void *data; > + struct enetfec_priv_rx_q *rxq = (struct enetfec_priv_rx_q *)rxq1; > + struct rte_eth_stats *stats = &rxq->fep->stats; > + pool = rxq->pool; > + bdp = rxq->bd.cur; > + > + /* Process the incoming packet */ > + status = rte_le_to_cpu_16(rte_read16(&bdp->bd_sc)); > + while ((status & RX_BD_EMPTY) == 0) { > + if (pkt_received >= nb_pkts) > + break; > + > + new_mbuf = rte_pktmbuf_alloc(pool); > + if (unlikely(new_mbuf == NULL)) { > + stats->ierrors++; 'rx_mbuf_alloc_failed' is used to store mbuf alloc failures, not 'ierrors'. <...> > + > + if (mbuf->nb_segs > 1) { > + ENETFEC_PMD_DEBUG("SG not supported"); It is not good idea to use dynamic debug macros in the datapath. 'ENETFEC_DP_LOG()' is the one to use.