DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sridhar Pitchai <sridhar.pitchai@outlook.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] rte_eth_from_rings
Date: Mon, 30 Jan 2017 17:20:27 +0000	[thread overview]
Message-ID: <MWHPR01MB24295BD266256AC8EF1C8503EB4B0@MWHPR01MB2429.prod.exchangelabs.com> (raw)
In-Reply-To: <20170130103328.GA100504@bricha3-MOBL3.ger.corp.intel.com>

Thanks Bruce,


Hi Ferruh,

I experimented the following to get the KNI interface up, but not able to get it up yet.


rte_kni_alloc(..) // with rte_eth_dev_info = 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 |= (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 the KNI bound to is the eth_dev created from ring buffer. (my dev environment is ubuntu 16.04 VM but eventual the code will be running on ONL. do i need 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 = kni_fifo_get(kni->req_q, (void **)&req, 1);



________________________________
From: Bruce Richardson <bruce.richardson@intel.com>
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 = 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 ring_p and
> enqueue the pkt into the queue. I am assuming this should work. Kindly correct 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 = fp_p->port_list[port].key.port_id;  // rt from rte_eth_from_rings(...)
>                 ops.change_mtu = _kni_ifconfig_mtu; // static function
>                 ops.config_network_if = _kni_ifconfig; // static functions
> PORT(fp_p, port).kni_p = rte_kni_alloc(PORT(fp_p, port).mbuf_p,
>                                                                 &conf, &ops);
>
> I am assuming this should work as well. I find the netdevs created but when 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 <bruce.richardson@intel.com>
> 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) from vender silicon like broadcom. I am planing to use "rte_eth_from_rings" like model where I will be able to read and write to the ring for the packets 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 rings 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

      reply	other threads:[~2017-01-30 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 19:16 Sridhar Pitchai
2017-01-27 21:36 ` Bruce Richardson
2017-01-27 22:31   ` Sridhar Pitchai
2017-01-30 10:33     ` Bruce Richardson
2017-01-30 17:20       ` Sridhar Pitchai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR01MB24295BD266256AC8EF1C8503EB4B0@MWHPR01MB2429.prod.exchangelabs.com \
    --to=sridhar.pitchai@outlook.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).