From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from SNT004-OMC2S36.hotmail.com (snt004-omc2s36.hotmail.com [65.55.90.111]) by dpdk.org (Postfix) with ESMTP id D9FC538EB for ; Mon, 30 Jan 2017 18:20:29 +0100 (CET) Received: from NAM01-BY2-obe.outbound.protection.outlook.com ([65.55.90.71]) by SNT004-OMC2S36.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 30 Jan 2017 09:20:29 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Rl/4BI4aeu/xYNReaYxfTJg3XZYCvr0E0S04B3UTJyM=; b=diPAsbnR+XvZGpjGVI6jIeDwyhu79tKBOpgZq6Qt9rI6sHONJMuJLkmZpV8846YfNmc1EV/tU19DeadiB+EZPNi4BY3+I8pKrj0zy4aOe6LMBFJlIPOMUOUF9rtckYF+xOyEyihdEi3wPm0YEuNfp51mpDzfY7pZmSjWSM/fGoJHJNVXhl85EciecqHvAWaiUq4lN7IIlVcQRsFgAHYyVIyRoTFR+Pdhp2h6dN7DZQ8xFvTEDdFBxZ8FPAuTd65vzUv6KGZxggR/kIwerv+7w1HQcxF38IJt7t6KPougC703VrXwyy93Tuoo3lOAQhTJre+pvc+PPqXOz1yA9pkhwA== Received: from SN1NAM01FT003.eop-nam01.prod.protection.outlook.com (10.152.64.53) by SN1NAM01HT142.eop-nam01.prod.protection.outlook.com (10.152.65.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.2; Mon, 30 Jan 2017 17:20:28 +0000 Received: from MWHPR01MB2429.prod.exchangelabs.com (10.152.64.56) by SN1NAM01FT003.mail.protection.outlook.com (10.152.65.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.2 via Frontend Transport; Mon, 30 Jan 2017 17:20:27 +0000 Received: from MWHPR01MB2429.prod.exchangelabs.com ([10.168.202.139]) by MWHPR01MB2429.prod.exchangelabs.com ([10.168.202.139]) with mapi id 15.01.0860.026; Mon, 30 Jan 2017 17:20:27 +0000 From: Sridhar Pitchai To: Bruce Richardson CC: "dev@dpdk.org" , "ferruh.yigit@intel.com" Thread-Topic: [dpdk-dev] rte_eth_from_rings Thread-Index: AQHSeNEcRFPkerJFR0OwOwUl5qaAJqFM2TSAgAAKZHiAA/NdgIAAbkE6 Date: Mon, 30 Jan 2017 17:20:27 +0000 Message-ID: References: <20170127213629.GA91748@bricha3-MOBL3.ger.corp.intel.com> , <20170130103328.GA100504@bricha3-MOBL3.ger.corp.intel.com> In-Reply-To: <20170130103328.GA100504@bricha3-MOBL3.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=outlook.com; x-incomingtopheadermarker: OriginalChecksum:B143A24C36F8D58293E3CC2300BBE4CAF5A15813E2AF3118A15C085CAE8D424D; UpperCasedChecksum:975024C485187DD72D90AC4EA5107745AC6EBFAA99FECE565003185E76F747CF; SizeAsReceived:7988; Count:39 x-tmn: [onrqLTfJVhah787c78vw3b3HjKez4obj] x-incomingheadercount: 39 x-eopattributedmessage: 0 x-microsoft-exchange-diagnostics: 1; SN1NAM01HT142; 7:fwxKIkkgJWkXXz5pMHJeD89xinHCWWU/l1+kUp+DmTbLE/Yqw61X1CkZgcA4HCt3X6EL/7NixhL9iMqUgvAl2EHe6/xcKttxT54SK6H3HLzsuMt2g/0MT6/sV3gz6MIBX9vjNGxRUpn7VR+wIdLRbRnX+VYJhhyfRHVyvwfYOUANCNBVewgBBqBFDQ87THOPHZfrveEkEwe3/+R9jLW25FIRSTkYKS9lpyQWhI6NzVEtjjMWh/iaXHHuR9PXgjEjwfybjMYih2gBY/vU5ao+4mR8ccj2brvfzJVEvXXY3YMDbNXNcuVJzuGs5wBj5jOsxSy25sNff6+vNeChO2oNFS4iWCUrO4hPfeCZ+90WFMILu2MunEEDJWnKdl4HGJSn7A3DdSUdHtFb7PaR0+kWcBMLS1FiovAPywOA9Fndo91pU+P7q6a/q+zItBaL2+Rua+ohochyV6HEF/Qqy3UnIg== x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(10019020)(98900005); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1NAM01HT142; H:MWHPR01MB2429.prod.exchangelabs.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: 1d711bb4-0584-4bc6-362c-08d4493448ec x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(1601124038)(5061506344)(1603103113)(1603101340)(1601125047)(1701031023); SRVR:SN1NAM01HT142; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444111334)(444112120)(432015012)(82015046); SRVR:SN1NAM01HT142; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM01HT142; x-forefront-prvs: 0203C93D51 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2017 17:20:27.5788 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM01HT142 X-OriginalArrivalTime: 30 Jan 2017 17:20:29.0232 (UTC) FILETIME=[27645300:01D27B1D] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] rte_eth_from_rings 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: Mon, 30 Jan 2017 17:20:30 -0000 Thanks Bruce, Hi Ferruh, I experimented the following to get the KNI interface up, but not able to g= et it up yet. rte_kni_alloc(..) // with rte_eth_dev_info =3D NULL ; ; rte_kni_register_handlers // with rte_eth_dev_info set with right call_back= for port_up_down and if_mtu ; ; ; I also added rte_kni_handle_request(kni_p) with these i am not able to bring the port UP. I also tried to do ioctl in = interface, ifr.ifr_flags |=3D (IFF_UP | IFF_RUNNING); ioctl(fp_p->port_ioctl, SIOCSIFFLAGS, &ifr); this call fails. What am i missing ? can you kindly point out my mistake here. the eth_dev t= he KNI bound to is the eth_dev created from ring buffer. (my dev environmen= t is ubuntu 16.04 VM but eventual the code will be running on ONL. do i nee= d to have any kernel flags. i am running rte_kni.ko without any args) Thanks, Sridhar **put some syslog into ret_kni and find rte_kni_handle_request is failling at ret =3D kni_fifo_get(kni->req_q, (void **)&req, 1); ________________________________ From: Bruce Richardson Sent: Monday, January 30, 2017 2:33 AM To: Sridhar Pitchai Cc: dev@dpdk.org; ferruh.yigit@intel.com Subject: Re: [dpdk-dev] rte_eth_from_rings On Fri, Jan 27, 2017 at 10:31:52PM +0000, Sridhar Pitchai wrote: > Thanks Bruce. > > > I have created eth_dev from the rings as below. > rt =3D rte_eth_from_rings(port_p->name, > (struct rte_ring * const*)port_p->rx_ring_p, 2, > (struct rte_ring * const*)port_p->tx_ring_p, = 2, > rte_socket_id()); > > Lets say I have a call back something like > > pkt_rx(void * pkt_p, struct pkt_metadata_t *meta_p) > > which is called when there is a pkt at the chip. > inside this function(pkt_rx) i will find the port and the corresponding r= ing_p and > enqueue the pkt into the queue. I am assuming this should work. Kindly co= rrect me if i misunderstood you. > Yes, it should work. > > question 2: > Can use this eth_dev to create KNI interface, like below. > rte_eth_dev_info_get(fp_p->port_list[port].key.port_id, &dev_info); > ; > ; > ; > ops.port_id =3D fp_p->port_list[port].key.port_id; // rt from rte_eth_fr= om_rings(...) > ops.change_mtu =3D _kni_ifconfig_mtu; // static function > ops.config_network_if =3D _kni_ifconfig; // static functi= ons > PORT(fp_p, port).kni_p =3D rte_kni_alloc(PORT(fp_p, port).mbuf_p, > &conf, &o= ps); > > I am assuming this should work as well. I find the netdevs created but wh= en i try to configure > them i am facing the following error. > > root@ VM snaproute/softpath (master) >ifconfig PORT_8 > PORT_8 Link encap:Ethernet HWaddr be:35:c3:0f:f8:2f > BROADCAST MULTICAST MTU:1500 Metric:1 > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) > > root@ VM snaproute/softpath (master) >ifconfig PORT_8 20.1.1.1/24 up > SIOCSIFFLAGS: Timer expired > SIOCSIFFLAGS: Timer expired > root@ VM snaproute/softpath (master) > > +Ferruh as KNI maintainer, to see if he can help out with this question. /Bruce > Thanks for the help. > > Thanks, > Sridhar Pitchai > > > ________________________________ > From: Bruce Richardson > Sent: Friday, January 27, 2017 1:36 PM > To: Sridhar Pitchai > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] rte_eth_from_rings > > On Fri, Jan 27, 2017 at 07:16:25PM +0000, Sridhar Pitchai wrote: > > Hi, > > > > I am trying to write a data path for packets punted to CPU(slowpath) fr= om vender silicon like broadcom. I am planing to use "rte_eth_from_rings" l= ike model where I will be able to read and write to the ring for the packet= s punted from vendor chip. > > > > > > the eth_dev abstraction provided by "rte_eth_from_rings" helps to build= the dpdk data path. Can someone help me on how to read and write to the ri= ngs that is emulating the eth_dev. > > > > > To use the rings like an ethdev just use rte_eth_rx_burst and > rte_eth_tx_burst, passing in the port id of your newly created rings > ethdev. To access them directly as rings, just use the ring > enqueue/dequeue functions passing in the ring pointer as normal. > > Regards, > /Bruce