DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Murthy, Krishna J" <krishna.j.murthy@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] [README]:Running DPDK in a LXC-based Container
Date: Wed, 8 Oct 2014 13:44:30 +0000	[thread overview]
Message-ID: <910C5016C9E77747B5B12EF34B54ADA92A3FA2CE@IRSMSX108.ger.corp.intel.com> (raw)

                 Running DPDK in a LXC-based Container 
================================================================================
Author: Krishnamurthy Jambur

Note: This README assumes you have the a LXC based container running on 
      the IA platform. This was tested on Windriver OVP Linux 6.0 

In this README we are will go through some of the unique steps involved 
in attaching a NIC to the LXC-based Container and the running a sample 
DPDP application in the container. 

1. Attaching NIC device to the container
----------------------------------------
Let's assume for this example that you would like to have a management interface
and then separate dedicated 10G NIC to run DPDK. With this requirement your LXC 
config file should have one networking sections one for veth. For the 10G NIC we
need to use uio device file system 

veth uses a paired set of network interfaces, one inside the container specified 
by the option lxc.network.name, and one in the host specified by the option 
lxc.network.pair. The latter is attached automatically to a bridge in the host 
if the name of the bridge is specified by the option lxc.network.link.

# networking-veth
lxc.network.type = veth
lxc.network.link = virbr0
lxc.network.veth.pair = vc0
lxc.network.name = eth0
lxc.network.hwaddr = ac:de:48:34:01:01
lxc.network.flags = up
lxc.network.ipv4 = 192.168.122.12/24
lxc.network.ipv4.gateway = 192.168.122.1
 
once you have this your LXC container will have an IP using bridge. Next step 
is to install DPDK igb_uio on the host and then bind it to the the 10G Niantic 
NIC ports as usual. Once installed do ls -l /dev/uio* on the host. These are the
uioX interface corresponding to the the NIC ports to which DPDK igb_uio is 
binded. DPDK application will use these device files. In order to provide access
to these device files inside the LXC container not down the major number [e.g. 
in this case 249] and add this config to the LXC config file 

lxc.cgroup.devices.allow = c 249:* rwm

once you start the container then you need to create these uio0, uio1,... 
devices nodes inside the container file system using mknod command as usual 
with the same major and minor numbers. 

mknod /dev/uio3 c 249 0
mknod /dev/uio3 c 249 3
mknod /dev/uio2 c 249 2
mknod /dev/uio1 c 249 1

2. Host allocated Huge page access inside container
----------------------------------------------------
For this set it is assumes that you would have pre-allocated hugepages and 
mounted on the on the host. Once you have this set-up then you need to provide 
access to hugetlbfs file system to the container using the LXC config file. 

lxc.mount.entry = /mnt/huge mnt/huge none bind,create=dir 0 0

once you have this DPDK application will be able to use the host mounted huge 
pages in the container. 

Next step is run the DPDK application as usual in the LXC Container

Regards,
Krishna 

--------------------------------------------------------------
Intel Shannon Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
Business address: Dromore House, East Park, Shannon, Co. Clare

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

             reply	other threads:[~2014-10-08 13:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 13:44 Murthy, Krishna J [this message]
2014-10-10  0:26 ` Xie, Huawei
2015-06-17  6:01 Mohit Saxena
2016-02-11  5:01 Pushpasis Sarkar
2016-02-11 12:04 ` Alejandro Lucero
     [not found] ` <1455193461352.1476199754@boxbe>
2016-02-11 12:56   ` Pushpasis Sarkar
2016-02-11 13:08     ` Bruce Richardson
     [not found]     ` <1455197317303.1476199754@boxbe>
2016-02-11 16:19       ` Pushpasis Sarkar

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=910C5016C9E77747B5B12EF34B54ADA92A3FA2CE@IRSMSX108.ger.corp.intel.com \
    --to=krishna.j.murthy@intel.com \
    --cc=dev@dpdk.org \
    /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).