From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by dpdk.org (Postfix) with ESMTP id B7AAC137D for ; Wed, 24 Sep 2014 05:30:51 +0200 (CEST) Received: by mail-la0-f46.google.com with SMTP id q1so9305866lam.19 for ; Tue, 23 Sep 2014 20:37:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Dl9X9Q3KHNMLg6PF4BSsK9v5YHOqjwyjHe5NtoqDKiw=; b=SjTrjNep1il4vVdPN5pu/8josrVGSCcx5SQ9wqlvokGM6pAXzdNSxNOghnZ1dur+jC M5TRgvHkFmU2M76OqKeLb62m20i4HvKTxPhC0ofwPw963PLAqTzAxkHR+V9Osuu0bVCo lvaebGKPPefSOb7o7T0KBQKjERm2aR8kz1u3mSimKydK5NzYFkReqMe5J9Kv9vi26VJz 4n/gedGUQAklHtGTp9yQqalXk152WsS1JGwizi/XNkEssZlUdebPoszMUBudW7R1n27x ObgAWcf9N3+ViVlFaich29UvdYy3dhy08pQin8qCNWQrekNciaFwl3UINElgfo0VL8NA 4DfA== X-Gm-Message-State: ALoCoQkMMSTM46ZK67KankPpa5iQmFYKRlFq9B4JXsTrbII3lr+lhUpv4spje7iKBq/HW5fQh4c0 MIME-Version: 1.0 X-Received: by 10.152.28.38 with SMTP id y6mr3534775lag.90.1411529822496; Tue, 23 Sep 2014 20:37:02 -0700 (PDT) Received: by 10.25.44.74 with HTTP; Tue, 23 Sep 2014 20:37:02 -0700 (PDT) In-Reply-To: <1409911836-17294-1-git-send-email-susami@igel.co.jp> References: <1409911836-17294-1-git-send-email-susami@igel.co.jp> Date: Wed, 24 Sep 2014 12:37:02 +0900 Message-ID: From: Saori USAMI To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] pcap: set in_port value in packet mbuf data when each packet is received 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, 24 Sep 2014 03:30:52 -0000 Hi, How about the following patch for the next DPDK release? Thanks, Saori 2014-09-05 19:10 GMT+09:00 Saori USAMI : > The pkt.in_port parameter in mbuf should be set with an input port id > because DPDK apps may use it to know where each packet came from. > > Signed-off-by: Saori USAMI > --- > lib/librte_pmd_pcap/rte_eth_pcap.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c > b/lib/librte_pmd_pcap/rte_eth_pcap.c > index eebe768..cfd3de4 100644 > --- a/lib/librte_pmd_pcap/rte_eth_pcap.c > +++ b/lib/librte_pmd_pcap/rte_eth_pcap.c > @@ -63,6 +63,7 @@ static uint64_t hz; > > struct pcap_rx_queue { > pcap_t *pcap; > + uint8_t in_port; > struct rte_mempool *mb_pool; > volatile unsigned long rx_pkts; > volatile unsigned long err_pkts; > @@ -154,6 +155,7 @@ eth_pcap_rx(void *queue, > rte_memcpy(mbuf->pkt.data, packet, header.len); > mbuf->pkt.data_len = (uint16_t)header.len; > mbuf->pkt.pkt_len = mbuf->pkt.data_len; > + mbuf->pkt.in_port = pcap_q->in_port; > bufs[num_rx] = mbuf; > num_rx++; > } else { > @@ -373,6 +375,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, > struct pcap_rx_queue *pcap_q = &internals->rx_queue[rx_queue_id]; > pcap_q->mb_pool = mb_pool; > dev->data->rx_queues[rx_queue_id] = pcap_q; > + pcap_q->in_port = dev->data->port_id; > return 0; > } > > -- > 1.9.1 > >