DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] KNI interface operational state UP issue
@ 2015-01-10  1:20 Aziz Hajee
  2015-01-12 11:24 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: Aziz Hajee @ 2015-01-10  1:20 UTC (permalink / raw)
  To: dev

I am using the dpdk1.6.0r1
The rte_kni.lo is loaded:
lsmod | grep kni
rte_kni               279134  1

however, the ifconfig vEth0, and vEth1 does not show link up ?
How do i get the operational state up for these interfaces.
$ sudo tcpdump -i vEth0
tcpdump: vEth0: That device is not up

ifconfig vEth0
vEth0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:12 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:3388 (3.3 KB)  TX bytes:0 (0.0 B)

 ifconfig vEth1
vEth1     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:60 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:10252 (10.2 KB)  TX bytes:0 (0.0 B)

These KNI interfaces are created as per dmeg below from the CREATE IOCTL.
sudo ifconfig vEth0 192.168.0.11 netmask 255.255.0.0
SIOCSIFFLAGS: Timer expired
aziz@fast-1:~/stm15-0108/stm/dpdk/dpdk-1.6.0r1_ss/lib/librte_eal/linuxapp/kni$
ifconfig vEth0
vEth0     Link encap:Ethernet  HWaddr 90:e2:ba:5f:1a:64
          inet addr:192.168.0.11  Bcast:192.168.255.255  Mask:255.255.0.0
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:50 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:14488 (14.4 KB)  TX bytes:0 (0.0 B)

Trying to set the vEth0 up, looks like it is doing the callback in the dpdk
to the corresponding PMD NIC interface, and not the vEth0 kernel interface.


Thanks,
-aziz
===========================================
dmesg shows the KNI module driver and creating the KNI interfaces:

[ 1349.192958] KNI: ######## DPDK kni module loading ########
[ 1349.193003] KNI: loopback disabled
[ 1349.193004] KNI: ######## DPDK kni module loaded  ########
.....

[ 1503.695034] KNI: Single kernel thread for all KNI devices
[ 1503.695109] KNI: /dev/kni opened
[ 1503.695122] KNI: IOCTL num=0xc0880002 param=0x7f76c77fcb10
[ 1503.695123] KNI: Creating kni...
[ 1503.695128] KNI: kni_net_init
......
...
[ 1503.695139] KNI: PCI: 06:00.00 8086:10fb
[ 1503.695142] KNI: pci_bus: 06:00:00
[ 1503.734041] igb_uio 0000:06:00.0: (PCI Express:5.0GT/s:Width x8)
[ 1503.734046] 90:e2:ba:5f:1a:64
[ 1503.734138] igb_uio 0000:06:00.0 (unregistered net_device): MAC: 2, PHY:
0, PBA No: E68793-006
[ 1503.734197] igb_uio 0000:06:00.0 (unregistered net_device): Enabled
Features: RxQ: 1 TxQ: 1
[ 1503.734226] igb_uio 0000:06:00.0 (unregistered net_device): Intel(R) 10
Gigabit Network Connection
[ 1503.734228] KNI: PCI found: pci=0xffff882ff99db000,
lad_dev=0xffff882ff33c0000
[ 1503.734674] KNI: IOCTL num=0xc0880002 param=0x7f76c77fcb10
[ 1503.734675] KNI: Creating kni...
[ 1503.734680] KNI: kni_net_init
.......
[ 1503.734690] KNI: PCI: 06:00.01 8086:10fb
[ 1503.734693] KNI: pci_bus: 06:00:00
[ 1503.734694] KNI: pci_bus: 06:00:01
[ 1503.774033] igb_uio 0000:06:00.1: (PCI Express:5.0GT/s:Width x8)
[ 1503.774038] 90:e2:ba:5f:1a:65
[ 1503.774129] igb_uio 0000:06:00.1 (unregistered net_device): MAC: 2, PHY:
0, PBA No: E68793-006
[ 1503.774154] igb_uio 0000:06:00.1 (unregistered net_device): Enabled
Features: RxQ: 1 TxQ: 1
[ 1503.774169] igb_uio 0000:06:00.1 (unregistered net_device): Intel(R) 10
Gigabit Network Connection
[ 1503.774184] KNI: PCI found: pci=0xffff882ff99dc000,
lad_dev=0xffff882ff3870000

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] KNI interface operational state UP issue
  2015-01-10  1:20 [dpdk-dev] KNI interface operational state UP issue Aziz Hajee
@ 2015-01-12 11:24 ` Bruce Richardson
  2015-01-15  0:59   ` Aziz Hajee
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2015-01-12 11:24 UTC (permalink / raw)
  To: Aziz Hajee; +Cc: dev

On Fri, Jan 09, 2015 at 05:20:26PM -0800, Aziz Hajee wrote:
> I am using the dpdk1.6.0r1
> The rte_kni.lo is loaded:
> lsmod | grep kni
> rte_kni               279134  1
> 
> however, the ifconfig vEth0, and vEth1 does not show link up ?
> How do i get the operational state up for these interfaces.
> $ sudo tcpdump -i vEth0
> tcpdump: vEth0: That device is not up
> 
> ifconfig vEth0
> vEth0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:12 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:3388 (3.3 KB)  TX bytes:0 (0.0 B)
> 
>  ifconfig vEth1
> vEth1     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:60 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:10252 (10.2 KB)  TX bytes:0 (0.0 B)
> 
> These KNI interfaces are created as per dmeg below from the CREATE IOCTL.
> sudo ifconfig vEth0 192.168.0.11 netmask 255.255.0.0
> SIOCSIFFLAGS: Timer expired
> aziz@fast-1:~/stm15-0108/stm/dpdk/dpdk-1.6.0r1_ss/lib/librte_eal/linuxapp/kni$
> ifconfig vEth0
> vEth0     Link encap:Ethernet  HWaddr 90:e2:ba:5f:1a:64
>           inet addr:192.168.0.11  Bcast:192.168.255.255  Mask:255.255.0.0
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:50 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:14488 (14.4 KB)  TX bytes:0 (0.0 B)
> 
> Trying to set the vEth0 up, looks like it is doing the callback in the dpdk
> to the corresponding PMD NIC interface, and not the vEth0 kernel interface.
> 
With KNI, the actual underlying NIC interface is still under the control of the
DPDK application. What happens is that any ethtool requests that go to the kernel
driver, get passed into the userspace DPDK application to make the actual changes
to the hardware port. Does DPDK itself report the port as being up?

/Bruce

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] KNI interface operational state UP issue
  2015-01-12 11:24 ` Bruce Richardson
@ 2015-01-15  0:59   ` Aziz Hajee
  0 siblings, 0 replies; 3+ messages in thread
From: Aziz Hajee @ 2015-01-15  0:59 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

Yes, the DPDK reports port is UP.
By the following change in the registered callback function to comment out
stop/start the dpdk interface, I can bring the KNI vEthX interfaces up:
(I guess, the reason is the ret value is now the default ret = 0, and no
error from stop/start. )

kni_config_network_interface(uint8_t port_id, uint8_t if_up)
{
        int ret = 0;

        if (port_id >= rte_eth_dev_count() || port_id >= RTE_MAX_ETHPORTS) {
                RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
                return -EINVAL;
        }

        RTE_LOG(INFO, KNI, "Configure network interface of %d %s\n",
                                        port_id, if_up ? "up" : "down");

//        if (if_up != 0) { /* Configure network interface up */
//                rte_eth_dev_stop(port_id);
//                ret = rte_eth_dev_start(port_id);
//        } else /* Configure network interface down */
//                rte_eth_dev_stop(port_id);

        if (ret < 0)
                RTE_LOG(ERR, KNI, "Failed to start port %d\n", port_id);

Question:
1. Where does the vEth0 ifname given to the ifconfig command, gets mapped
to the dpdk port_id 0 in the callback

thanks.
-aziz

===================================

# ifconfig vEth0
vEth0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:13 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:3186 (3.1 KB)  TX bytes:0 (0.0 B)

# ifconfig vEth0 192.16.1.1
# ifconfig vEth0
vEth0     Link encap:Ethernet  HWaddr 90:e2:ba:5f:1a:64
          inet addr:192.16.1.1  Bcast:192.16.1.255  Mask:255.255.255.0
          inet6 addr: fe80::92e2:baff:fe5f:1a64/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:37 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3186 (3.1 KB)  TX bytes:0 (0.0 B)



On Mon, Jan 12, 2015 at 3:24 AM, Bruce Richardson <
bruce.richardson@intel.com> wrote:

> On Fri, Jan 09, 2015 at 05:20:26PM -0800, Aziz Hajee wrote:
> > I am using the dpdk1.6.0r1
> > The rte_kni.lo is loaded:
> > lsmod | grep kni
> > rte_kni               279134  1
> >
> > however, the ifconfig vEth0, and vEth1 does not show link up ?
> > How do i get the operational state up for these interfaces.
> > $ sudo tcpdump -i vEth0
> > tcpdump: vEth0: That device is not up
> >
> > ifconfig vEth0
> > vEth0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
> >           BROADCAST MULTICAST  MTU:1500  Metric:1
> >           RX packets:12 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:3388 (3.3 KB)  TX bytes:0 (0.0 B)
> >
> >  ifconfig vEth1
> > vEth1     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
> >           BROADCAST MULTICAST  MTU:1500  Metric:1
> >           RX packets:60 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:10252 (10.2 KB)  TX bytes:0 (0.0 B)
> >
> > These KNI interfaces are created as per dmeg below from the CREATE IOCTL.
> > sudo ifconfig vEth0 192.168.0.11 netmask 255.255.0.0
> > SIOCSIFFLAGS: Timer expired
> > aziz@fast-1
> :~/stm15-0108/stm/dpdk/dpdk-1.6.0r1_ss/lib/librte_eal/linuxapp/kni$
> > ifconfig vEth0
> > vEth0     Link encap:Ethernet  HWaddr 90:e2:ba:5f:1a:64
> >           inet addr:192.168.0.11  Bcast:192.168.255.255  Mask:255.255.0.0
> >           BROADCAST MULTICAST  MTU:1500  Metric:1
> >           RX packets:50 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:14488 (14.4 KB)  TX bytes:0 (0.0 B)
> >
> > Trying to set the vEth0 up, looks like it is doing the callback in the
> dpdk
> > to the corresponding PMD NIC interface, and not the vEth0 kernel
> interface.
> >
> With KNI, the actual underlying NIC interface is still under the control
> of the
> DPDK application. What happens is that any ethtool requests that go to the
> kernel
> driver, get passed into the userspace DPDK application to make the actual
> changes
> to the hardware port. Does DPDK itself report the port as being up?
>
> /Bruce
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-15  0:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-10  1:20 [dpdk-dev] KNI interface operational state UP issue Aziz Hajee
2015-01-12 11:24 ` Bruce Richardson
2015-01-15  0:59   ` Aziz Hajee

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).