From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0088.outbound.protection.outlook.com [104.47.33.88]) by dpdk.org (Postfix) with ESMTP id C148F1B38C for ; Tue, 3 Oct 2017 15:53:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Q0yRojiSJLbh8dxRVUtb2EUHbaBbJTSAdzubu5zHt/o=; b=Y/KjM0WJfVJ6p8tW9hPQAWg9sT/f2GEwHMbLXhxRe4tvmR1OZrKuVlRsyBBQeadyCFNeKQSXnIBYsTO9IrcZ0PZnCPeLZiRddULZSMSLzap+9qnbNPOWS9lLlihDxYG8U9NPQCpCJdPGM30OsYKimNnFhenM7hdD1ORb3sn4/1w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (111.93.218.67) by CO2PR07MB2519.namprd07.prod.outlook.com (10.166.201.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 13:53:04 +0000 Date: Tue, 3 Oct 2017 19:22:49 +0530 From: Jerin Jacob To: "Rao, Nikhil" Cc: bruce.richardson@intel.com, gage.eads@intel.com, dev@dpdk.org, thomas@monjalon.net, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, narender.vangati@intel.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com, santosh.shukla@caviumnetworks.com Message-ID: <20171003135248.GA10493@jerin> References: <1506028634-22998-1-git-send-email-nikhil.rao@intel.com> <1506028634-22998-4-git-send-email-nikhil.rao@intel.com> <20170922091032.GA5895@jerin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0043.INDPRD01.PROD.OUTLOOK.COM (10.174.214.29) To CO2PR07MB2519.namprd07.prod.outlook.com (10.166.201.6) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3f58704-3982-48fb-cd6f-08d50a6613a7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CO2PR07MB2519; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 3:EgFsQ5mITROlSuae5fBDxmkFR77jr2TrjHcbk4BEW8veSyVszrYoWK+S3DxlUmICQa7QDlFrGQ2FcWullopeoAemontRrHhaKFtMVwZeYcEJLhzu5QTyM4cxanJNz3AB3tgK6NYVOJu4xsckvAg3/Q7Gdpv7oHFJKGjN2U3xRWbYTUixs2cbjEMxjFIwa6oNXv22u0nw7XU0pGnRTSC1qXcLFrByoteL0KOr7AWO9cA2lTBmz/QrXFMmlhgZ/zg3; 25:UyX3qZDREpdiQqkUrd0q2KU1vaUxy8tLT8JXgOo4cO/FQTIhmSTOM/VP6ZiOHO6XRLGU01rWGPDgFSfMxLf5e/0r3zOGPZgZno30piW+ynUAbi7dmR48x9CGmRu/hjLYZKdNKSOXVqpSvnNoRJiawXlBPzLgrCIDQmXftlMzJjx8YzJRCg2luIrQNl3CL2Ef/ZkoUsNiUACfJwD81rI7RaVZxXT7j4tIBzgbFNo1z3lLhl3J1knKfM3ut857x8rOYkjaOd7mAtpjdymrwnRGXq5ZW46dUCZNku1JnSpphO+jM1hsHFYk4gldcfYIir0cHJX2ZkpZIry32Jlrhxx89w==; 31:O8t47vtoRAEAT33ubOEX85D0gkuFZK2EX2g1PQ8+cv9yKeHGfjm1hKJ2TwINF4C/R4xQrOZxIBgvflErauevayl/bnXZPEkN5El8PYUCbzd8l3pajmWKi7WZ/rp30z8DnT3Ugsv58eOnCln/XhwFD1Yz0Qrd7pZOsom2XWpWX/z46t3YGArSJdrxBBrRotippHRp8XlR/+7zRJHlJDZ/Bye12CquwmFoMuVwzbezcyE= X-MS-TrafficTypeDiagnostic: CO2PR07MB2519: X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 20:nGeJdEuze/TEgjMz+N4RK0gdbpc4crNbQFUAYLDFtJ4Zus+a9nJq56wZEHbnVgjfmiPaASUKM6LjHcya7oJUsm6r2M/eJ8lsdkbdauyxMSJ4qVGoo+WNGMm/AFcmBsc/PqPSKD5auuXzfI71IXMqaFUOuvn1JWTrTwAYOXt2Tp0DmKQkgvasDSKk6+zV8E0xSjZ621yZBTb8x0Lydh+kEKHMqrEhlQCky8spADst4QR950p5va0h89H8c3TSg4ZPa993kysBrFV2u5gr4vqzScVm0HbNdAoMEaYLOjYaa318lbNyM2HuktiKDzp8g8zD4W/I/w5gzIbZ59yEuloXJ3XhOnwEq6aKEpYaK/SEy/Tn76xBoshh+0BiZhSPHbzMtKj4pbFPbjwrpDTph2zbFdX5NUDGEakiPOhnxuTkwjgiJ2cL8jhNqR1KFcp3GG1IT3g1uPq8ZmbvjrFjmX8J48PpNdLrFPiusQwSGAVPc7c/+gaPjhfqLpO7PrphPtKmDDVSSZqX/x7mZYN1E5nvxlSWY7+kpi7lcYdeHnMyePtfqqKuhW7dmw5KIldgheSdaTu/z39H/g7t4zqUvBu3hCw904x8yB15jNPgkIiA9Xw= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR07MB2519; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR07MB2519; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 4:sREaHIepufG8P84wZ1II+w7DfjN+ZeNaPXoqazRaI9WalkCoxY09Uq7dxZsRlDzY5pR4gn1/L4dDnSz/3/tQGpLj9gBJs1h2KJd8+P4nvlASuRtoVXSik0sqry1Zrc69HVyw6wy7lb4Z9qRvUKb69ZnHCZ6KQkRgLQ6X07QLmTdcVq7/qd2ESxmDQvbBGKTkgp9MGTtaPvq8c5uPaqFyiE1YRGgtoDbbOj61y0ezpVBMBZ93dpCck6HsHiAiIn6FX5hgpezM89zgQ8SAWOqQ04AbZ9mxHrWaaGdmLJQur34Fe/CuCpDApFVbuvTIyCu8s36kCTIupA5SAaCFNTPEuw== X-Forefront-PRVS: 044968D9E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(13464003)(189002)(51914003)(53936002)(55016002)(9686003)(6496005)(6666003)(68736007)(50466002)(6916009)(2950100002)(42882006)(23676002)(97736004)(229853002)(107886003)(8936002)(8676002)(81156014)(81166006)(4326008)(6246003)(72206003)(16526017)(66066001)(50986999)(8656003)(93886005)(575784001)(58126008)(478600001)(83506001)(54356999)(316002)(76176999)(7736002)(47776003)(305945005)(6116002)(3846002)(1076002)(105586002)(5009440100003)(106356001)(101416001)(25786009)(33716001)(7416002)(2906002)(33656002)(5660300001)(2870700001)(189998001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2519; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDTzJQUjA3TU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dkeTZvU05hem1MVm40c2xE?= =?utf-8?B?LzlhUXREUGVCaElDeWVOU3JXS2NyNVNWYWsrZ2lBejZZOXc9PQ==?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 6:Vn0x73NSB9PjOxMninyoSO7kBgLkQvxwWoa6tR7hXkKzp3rFKmdU7n6v0cnS5vR41c1HOAysfNR2aEEVcTNXy0vHaeBjH7Rq0oG57fgoCMDFrs8Ghr5FR2mjrwKIS34h7lufJN0N3DfgUmYro20lezXn2s+JLxRkUkxghVbQKXiFemqgBxQWZoUCKQ40YBfs5LPjZ/aSDsaER2r6hqn0d4rtIjg34SXOaWoTjHPPL5nEof297cCCf4bF43lwnOfQdZf8mmjpOBABVAYemhHmFMVXy1Pk0SffbA7f/YwabeK+NzZ2dHl/w4//B3BhFhSd3QaBsls3dRLhbb0ddb6mBw==; 5:sPP050qg836QEHp2qt4TjeVHCxVnVyK9x3OJD74k6hOuRAnH/mpSxtblTnXyg+/ev8GELP/aojnmEipVq9oZjAjcaZobIcVbhyUYlvTMTdjZWvsgfglmNkrXUdJzzV+QOaU9YDo4+m5wTtkdg9N4tA==; 24:0Ck271kqGf1lOt4hOy+glkkiSmHFmegKxoWNWIbwIfllUKrt1EWJoidUwwBoNCvese2No56+4UI2fX+/wV58NHFpRudLHTf86Ve7t6vJdN0=; 7:DDmTZx11rTwlBZ3d8Do15kNIvwX8ywFhOFrgUmj6qb/q5dzE7SmvbglvDeitYkVlIGiXN1UYU9kNdcQMalP0fydI/YTQefb4E5eZLye3R5U6/7VXt9GYyL9qO1lOSJT6uTGnTRo3uUc5dfYccMeeEvd1xfMo+oWg2AYRloXiAhVK+HAYDuxM/Pq2yvSOWKC5aHUgt12RfFHG/lPv6MdLE/3PMme3SyWc977hJGvgRe0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2017 13:53:04.0655 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2519 Subject: Re: [dpdk-dev] [PATCH v4 3/4] eventdev: Add eventdev ethernet Rx adapter 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: , X-List-Received-Date: Tue, 03 Oct 2017 13:53:10 -0000 -----Original Message----- > Date: Sun, 24 Sep 2017 23:46:51 +0530 > From: "Rao, Nikhil" > To: Jerin Jacob > CC: bruce.richardson@intel.com, gage.eads@intel.com, dev@dpdk.org, > thomas@monjalon.net, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, > nipun.gupta@nxp.com, narender.vangati@intel.com, > erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com, > santosh.shukla@caviumnetworks.com > Subject: Re: [PATCH v4 3/4] eventdev: Add eventdev ethernet Rx adapter > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 > Thunderbird/52.3.0 > > > OK, Thanks for the detailed review. Will add the programmer guide to RC1. OK. Thanks. > > > > > > > > Yes, if create() and queue_add() are called from different processes, it > wouldn't work. > > > > + > > > +static uint8_t default_rss_key[] = { > > > + 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, > > > + 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, > > > + 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, > > > + 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, > > > + 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa, > > > +}; > > > > Looks like the scope of this array is only for rte_event_eth_rx_adapter_init, > > if so please move it to stack. > > > OK. > > > > > > +static uint8_t *rss_key_be; > > > > Can we remove this global variable add it in in adapter memory? > > > > There is currently struct rte_event_eth_rx_adapter > **rte_event_eth_rx_adapter that is an array of pointers to the adapters. > rss_key_be points to memory after this array. > > are you thinking of something like: > > struct { > struct rte_event_eth_rx_adapter **rte_event_eth_rx_adapter > uint8_t *rss_key_be; > } global; I was thinking, to hold 40B in struct rte_event_eth_rx_adapter for rss_key_be and initialize per rx_adapter to avoid global variable as fill_event_buffer() has access to rte_event_eth_rx_adapter. Something like below as rough idea. ➜ [dpdk-next-eventdev] $ git diff lib/librte_eventdev/rte_event_eth_rx_adapter.c diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c index cd19e7c28..ba6148931 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c @@ -37,6 +37,7 @@ struct rte_eth_event_enqueue_buffer { }; struct rte_event_eth_rx_adapter { + uint8_t rss_key[40]; /* event device identifier */ uint8_t eventdev_id; /* per ethernet device structure */ > > > +static inline uint32_t > > > +eth_rx_poll(struct rte_event_eth_rx_adapter *rx_adapter) > > > +static int > > > +event_eth_rx_adapter_service_func(void *args) > > > +{ > > > + struct rte_event_eth_rx_adapter *rx_adapter = args; > > > + struct rte_eth_event_enqueue_buffer *buf; > > > + > > > + buf = &rx_adapter->event_enqueue_buffer; > > > + if (!rte_spinlock_trylock(&rx_adapter->rx_lock)) > > > + return 0; > > > + if (eth_rx_poll(rx_adapter) == 0 && buf->count) > > > + flush_event_buffer(rx_adapter); > > > + rte_spinlock_unlock(&rx_adapter->rx_lock); > > > + return 0; > > > +} > > > + > > > +static int > > > +rte_event_eth_rx_adapter_init(void) > > > +{ > > > + const char *name = "rte_event_eth_rx_adapter_array"; > > > + const struct rte_memzone *mz; > > > + unsigned int sz; > > > + unsigned int rss_key_off; > > > + > > > + sz = sizeof(*rte_event_eth_rx_adapter) * > > > + RTE_MAX_EVENT_ETH_RX_ADAPTER_INSTANCE; > > > > I think, you need to use size of struct rte_event_eth_rx_adapter here. if so, > > we need **rte_event_eth_rx_adapter here. Right? > > > > test code > > struct abc { > > > > uint64_t a[64]; > > }; > > > > struct abc **k; > > > > int main() > > { > > printf("%d %d %d\n", sizeof(k), sizeof(*k), sizeof(**k)); > > > > return 0; > > } > > > > $./a.out > > 8 8 512 > > > > The struct rte_event_eth_rx_adapter gets allocated in > rte_event_eth_rx_adapter_create_ext() OK. I missed that. > > > > > + if (mz) { > > > + rte_convert_rss_key((uint32_t *)default_rss_key, > > > + (uint32_t *)(uintptr_t)(mz->addr_64 + rss_key_off), > > > + RTE_DIM(default_rss_key)); > > > + } else { > > > + RTE_EDEV_LOG_ERR("failed to reserve memzone err = %" > > > + PRId32, rte_errno); > > > + return -rte_errno; > > > + } > > > + } > > > + > > > + rte_event_eth_rx_adapter = mz->addr; > > > + rss_key_be = (uint8_t *)(mz->addr_64 + rss_key_off); > > > + return 0; > > > +} > > > + > > > +static int > > > +default_conf_cb(uint8_t id, uint8_t dev_id, > > > + struct rte_event_eth_rx_adapter_conf *conf, void *arg) > > > +{ > > > + > > > + ret = rte_event_port_setup(dev_id, port_id, port_conf); > > > + if (ret) { > > > + RTE_EDEV_LOG_ERR("failed to setup event port %u\n", > > > + port_id); > > > > return or add goto to exit from here to avoid calling rte_event_dev_start below > > > Could do the return but I wanted to leave the device in the same state as it > was at entry into this function. Thoughts ? Will calling rte_event_dev_start() down(in case if wont return) change the state? if not, it is fine. No another comments. Looks good to me.