From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 97C4FC31C for ; Wed, 17 Feb 2016 10:57:42 +0100 (CET) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2O004JCRO5F360@mailout1.w1.samsung.com> for dev@dpdk.org; Wed, 17 Feb 2016 09:57:41 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-8e-56c444145f6f Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id FD.FC.21385.41444C65; Wed, 17 Feb 2016 09:57:40 +0000 (GMT) Received: from fedinw7x64 ([106.109.131.169]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O2O00A6WRO4RV70@eusync2.samsung.com>; Wed, 17 Feb 2016 09:57:40 +0000 (GMT) From: Pavel Fedin To: 'Reshma Pattan' , dev@dpdk.org References: <1455289045-25915-1-git-send-email-reshma.pattan@intel.com> <1455289045-25915-5-git-send-email-reshma.pattan@intel.com> In-reply-to: <1455289045-25915-5-git-send-email-reshma.pattan@intel.com> Date: Wed, 17 Feb 2016 12:57:39 +0300 Message-id: <012101d16969$a38c2b90$eaa482b0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQIv6L0UmHAJ53r3gd8NJkyOKRJNhwGSh53WnmZs7FA= Content-language: ru X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsVy+t/xK7oiLkfCDPb2Glq8+7SdyWL5lxks DkwevxYsZfVYvOclUwBTFJdNSmpOZllqkb5dAlfGga8NzAVzWSsOT97M2MDYxtLFyMkhIWAi cefuS0YIW0ziwr31bF2MXBxCAksZJZa83MAC4XxnlJj4YwozSBWbgLrE6a8fwLpFBKwlluw4 xQxR1MooMXf6BaAEBwengIfEhg11IDXCAvES13esB6tnEVCVaO16xA5i8wpYSjy628sMYQtK /Jh8D6yGWUBLYv3O40wQtrzE5jVvmSGuU5DYcfY1I8h4EQEriU3nfCBKRCSm/bvHPIFRcBaS SbOQTJqFZNIsJC0LGFlWMYqmliYXFCel5xrpFSfmFpfmpesl5+duYoSE8dcdjEuPWR1iFOBg VOLhXZF1OEyINbGsuDL3EKMEB7OSCG+x3pEwId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwzd70P ERJITyxJzU5NLUgtgskycXBKNTBmxSuv19tySkq3a9uKA0IJ10pE22wnLHux+lDtwgK96/t3 XRCdnfeVseDzVPWbIudVg07vM/G9lHN+Rfvmr5/F83/cn5rx46Rv1TP+Scf0F9wTTgz+oq4s z7yj62CJ6uPeS0/igxLvZSuHNjiWuOguyGnii1pZuk6P7WiDzTdhF/FSRqGVTx8rsRRnJBpq MRcVJwIA6afPl18CAAA= Subject: Re: [dpdk-dev] [PATCH v2 4/5] lib/librte_eal: add tcpdump support in primary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2016 09:57:42 -0000 Hello! > +static int > +compare_filter(struct rte_mbuf *pkt) > +{ > + struct ipv4_hdr *pkt_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, > + sizeof(struct ether_hdr)); > + if (pkt_hdr->src_addr != src_ip_filter) > + return -1; > + > + return 0; > +} Some critics to this... What if i want to capture packets coming from more than one host? What if i want to capture all packets? What if it's not IPv4 at all? May be this function should always return 0 if src_ip_filter == 0? This would at least be a quick way to disable filtering. Kind regards, Pavel Fedin Senior Engineer Samsung Electronics Research center Russia