[dpdk-dev] [PATCH v2 0/5] add dpdk packet capture support for tcpdump

2016-02-29 Thread Pattan, Reshma
Hi,

> -Original Message-
> From: Pavel Fedin [mailto:p.fedin at samsung.com]
> Sent: Wednesday, February 24, 2016 3:05 PM
> To: Pattan, Reshma 
> Cc: dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v2 0/5] add dpdk packet capture support for
> tcpdump
> 
>  Hello!
> 
> > >  2. What if i don't want separate RX and TX streams either? It only
> > > prevents me from seeing the complete picture.
> >
> > Do you mean not to have separate pcap files for tx and rx? If so, I
> > would prefer to keep this as it is.
> 
>  I mean - add an option not to have separate files.

OK, I will make changes in v3.

> 
> > >  3. vhostuser ports are missing. Perhaps not really related to this
> > > patchset, i just don't know how much code "server" part of vhostuser
> > > shares with normal PMDs, but anyway, ability to dump them too would be
> nice to have.
> > >
> >
> > I think this can be done in future i.e. when vhost as PMD is
> > available. But as of now vhost is library.
> 
>  I expected "server"-side vhost to be the same as "client" part (AKA virtio), 
> just
> use another mechanism for exchanging control information (via socket). Is it 
> not
> true? I suppose, driving queues from both sides should be quite symmetric.
> 

At this stage of release adding these changes is difficult as I don't have 
knowledge on vhost.
But at the same if anyone from committee would like to make these enhancements 
are welcome.

Thanks,
Reshma




[dpdk-dev] [PATCH v2 0/5] add dpdk packet capture support for tcpdump

2016-02-23 Thread Pattan, Reshma
Hi,

> -Original Message-
> From: Pavel Fedin [mailto:p.fedin at samsung.com]
> Sent: Thursday, February 18, 2016 2:08 PM
> To: Pattan, Reshma ; dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v2 0/5] add dpdk packet capture support for
> tcpdump
> 
> 
>  1. Perhaps, ability to separate queues is useful for something. But not 
> always.
> For example, what if i want to capture all the traffic which passes through 
> some
> interface (common use case)? For example, with OpenVSwitch i can have 9
> queues on my networking card. So, i have to enumerate all of them:
> (0,0)(0,1)(0,2)... It's insane and inconvenient with many queues. What if you
> could have shorthand notation, like (0) or (0,*) for this?

I will fix this in my next version of patch.

>  2. What if i don't want separate RX and TX streams either? It only prevents 
> me
> from seeing the complete picture.

Do you mean not to have separate pcap files for tx and rx? If so, I would 
prefer to keep this as it is.
Because pcap changes need to be replaced with TUN/TAP pmd once available in 
future. 

>  3. vhostuser ports are missing. Perhaps not really related to this patchset, 
> i just
> don't know how much code "server" part of vhostuser shares with normal PMDs,
> but anyway, ability to dump them too would be nice to have.
> 

I think this can be done in future i.e. when vhost as PMD is available. But as 
of now vhost is library.

>  Not directly related, but could we have some interface to tcpdump or
> wireshark? Would be good to have ability to dump packets in real time.

This  can be done in future once KNI or TUN/TAP PMDs is  available in DPDK.

Thanks,
Reshma


[dpdk-dev] [PATCH v2 0/5] add dpdk packet capture support for tcpdump

2016-02-18 Thread Pavel Fedin
 Hello!

 With the aforementioned fix (disabling src_ip_filter  if zero) i've got the 
patch series working. Now i have some more notes on
usability:

> 2)Start proc_info(runs as secondary process by default)application with new 
> parameters for
> tcpdump.
> ex: sudo ./build/app/proc_info/dpdk_proc_info -c 0x4 -n 2 -- -p 0x3 --tcpdump 
> '(0,0)(1,0)' --
> src-ip-filter="2.2.2.2"

 1. Perhaps, ability to separate queues is useful for something. But not 
always. For example, what if i want to capture all the
traffic which passes through some interface (common use case)? For example, 
with OpenVSwitch i can have 9 queues on my networking
card. So, i have to enumerate all of them: (0,0)(0,1)(0,2)... It's insane and 
inconvenient with many queues. What if you could have
shorthand notation, like (0) or (0,*) for this?
 2. What if i don't want separate RX and TX streams either? It only prevents me 
from seeing the complete picture.
 3. vhostuser ports are missing. Perhaps not really related to this patchset, i 
just don't know how much code "server" part of
vhostuser shares with normal PMDs, but anyway, ability to dump them too would 
be nice to have.

 Not directly related, but could we have some interface to tcpdump or 
wireshark? Would be good to have ability to dump packets in
real time.

Kind regards,
Pavel Fedin
Senior Engineer
Samsung Electronics Research center Russia




[dpdk-dev] [PATCH v2 0/5] add dpdk packet capture support for tcpdump

2016-02-12 Thread Reshma Pattan
This patch set include design to capture dpdk port packets for tcpdump.

This patch set include test-pmd changes to verify patch set given in 
Dependencies 1.

Current  patch set is dependent on below patch set. Below patch set must be 
applied before applying current patch set.

Dependencies 1:
http://dpdk.org/dev/patchwork/patch/9750/
http://dpdk.org/dev/patchwork/patch/9751/
http://dpdk.org/dev/patchwork/patch/9752/

Dependencies 2:
Patches 2/5 and 3/5 of current patch set contains pcap based design.
So to run and compile these patches, libpcap must be installed and pcap config 
option should be set to yes i.e. CONFIG_RTE_LIBRTE_PMD_PCAP=y.

packet capture flow for tcpdump:

Part of design is implemented in secondary process (proc_info.c) and some part 
in primary process (eal_interrupt.c).

Communication between both the processes is provided using socket and rte_ring.

[Secondary process:]
*Changes are included in patch 3/5

*User should request packet capture via proc_info app command line with port, 
queue and src ip filter information.

Note: As initial development basic src filter option only provided.

*proc_info sends port, queue and src ip filter information to primary along 
with register rx tx cbs message.

*proc_info creates  two pcap devices for writing ingress and egress packets of 
port and queue.

*Runs in a while loop, dequeue packets sent by primary over shared rte_ring and 
writes to respective pcap files.

[Primary Process]:
*Changes are included in patch 4/5.

*Create rte_rings and mempool used for communicating packets with secondary.

*Create socket, waits on socket for message from secondary.

*Upon receiving the register rx tx cbs message, registers 
rte_eth_rxtx_callbacks for receiving ingress and egress packets of given port 
and queue.

*RX callback:
Gets packet, apply src ip filter, for matched packets, duplicate packets 
will be
created from mempool and new duplicated packets will be enqueued to
rte_ring for secondary to dequeue and write to pcap.

*TX callback:
Gets packets, apply src ip filter, for matched packets increments reference
counter of the packet, enqueue to other rte_ring for secondary to dequeue 
and
write to pcap.

[Secondary Process]:
*When secondary is terminated with ctrl+c, secondary sends remove rx tx cbs 
message to primary.

*[Primary Process]:
*When primary receives remove rx tx cbs message should take care of removing 
registered rxtx callbacks.

Users who wish to view packets can run "tcpdump -r RX_pcap.pcap/TX_pcap.pcap"
to view packets of interest.

Running the changes:
===
1)Start any primary sample application.
ex:sudo ./examples/rxtx_callbacks/build/rxtx_callbacks -c 0x2 -n 2

2)Start proc_info(runs as secondary process by default)application with new 
parameters for tcpdump.
ex: sudo ./build/app/proc_info/dpdk_proc_info -c 0x4 -n 2 -- -p 0x3 --tcpdump 
'(0,0)(1,0)' --src-ip-filter="2.2.2.2"

3)Start traffic from traffic generator.

4)Now you can view ingress and egress packets of dpdk ports matching 
src-ip-filter written to /tmp/RX_pcap.pcap  and /tmp/TX_pcap.pcap respectively.

5)Stop the secondary process using ctrl+c and rerun it and packet capturing 
should resume again.

Note: Writing to PCAP files will be stopped once the folder size where pcap 
files exists reaches its max value.

v2:
* extended nb_rxq/nb_txq check to other fwd modes along with rx_only and 
tx_only.
* changed some of the global variables to static in proc_info/main.c and 
eal_interrupts.c.
* release notes updated.

Reshma Pattan (5):
  app/test-pmd: fix nb_rxq and np_txq checks
  drivers/net/pcap: add public api to create pcap device
  app/proc_info: add tcpdump support in secondary process
  lib/librte_eal: add tcpdump support in primary process
  doc: update doc for tcpdump feature

 app/proc_info/main.c |  451 +-
 app/test-pmd/cmdline.c   |   11 +-
 app/test-pmd/parameters.c|   14 +-
 app/test-pmd/testpmd.c   |   28 ++-
 doc/guides/rel_notes/release_16_04.rst   |9 +-
 drivers/net/pcap/Makefile|4 +-
 drivers/net/pcap/rte_eth_pcap.c  |  156 -
 drivers/net/pcap/rte_eth_pcap.h  |   87 +
 drivers/net/pcap/rte_pmd_pcap_version.map|8 +
 lib/librte_eal/linuxapp/eal/Makefile |5 +-
 lib/librte_eal/linuxapp/eal/eal_interrupts.c |  375 +-
 11 files changed, 1105 insertions(+), 43 deletions(-)
 create mode 100644 drivers/net/pcap/rte_eth_pcap.h

-- 
1.7.4.1