From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] librte_pmd_af_packet: add PMD for AF_PACKET-based virtual devices Date: Mon, 24 Nov 2014 17:16:15 +0100 Message-ID: <3215753.nFC6kHmbmP@xps13> References: <20141114144536.GC1893@tuxdriver.com> <1416239878-3556-1-git-send-email-linville@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "John W. Linville" Return-path: In-Reply-To: <1416239878-3556-1-git-send-email-linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" > This is a Linux-specific virtual PMD driver backed by an AF_PACKET > socket. This implementation uses mmap'ed ring buffers to limit copying > and user/kernel transitions. The PACKET_FANOUT_HASH behavior of > AF_PACKET is used for frame reception. In the current implementation, > Tx and Rx queues are always paired, and therefore are always equal > in number -- changing this would be a Simple Matter Of Programming. > > Interfaces of this type are created with a command line option like > "--vdev=eth_af_packet0,iface=...". There are a number of options availabe > as arguments: > > - Interface is chosen by "iface" (required) > - Number of queue pairs set by "qpairs" (optional, default: 1) > - AF_PACKET MMAP block size set by "blocksz" (optional, default: 4096) > - AF_PACKET MMAP frame size set by "framesz" (optional, default: 2048) > - AF_PACKET MMAP frame count set by "framecnt" (optional, default: 512) > > Signed-off-by: John W. Linville > --- > This PMD is intended to provide a means for using DPDK on a broad > range of hardware without hardware-specific PMDs and (hopefully) > with better performance than what PCAP offers in Linux. This might > be useful as a development platform for DPDK applications when > DPDK-supported hardware is expensive or unavailable. > > New in v3: > > -- Adopt awkward renaming (pmd_packet -> pmd_af_packet) in hopes of > getting something merged... There are some remaining occurences of ETH_PACKET. % git grep -i eth_packet | wc -l 19 % sed -ri 's,ETH_PACKET,ETH_AF_PACKET,' lib/librte_pmd_af_packet/* I fixed it. It seems there is a hope of getting it merged :D > New in v2: > > -- fixup some style issues found by check patch > -- use if_index as part of fanout group ID > -- set default number of queue pairs to 1 When building on Debian, I remembered that it cannot be enabled for all kernels. As a first step, I disabled it in default configuration. I don't know how we could handle it better. Is it sufficient to test availability of flags like PACKET_FANOUT_FLAG_ROLLOVER or PACKET_QDISC_BYPASS? Applied with changes explained above. Is it possible to improve it in coming weeks? Thanks -- Thomas