From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5259612A8 for ; Fri, 27 May 2016 14:26:50 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 27 May 2016 05:26:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,374,1459839600"; d="scan'208";a="963551205" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 27 May 2016 05:26:48 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u4RCQlK6016556; Fri, 27 May 2016 13:26:47 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u4RCQlXa004365; Fri, 27 May 2016 13:26:47 +0100 Received: (from jmcnam2@localhost) by sivswdev02.ir.intel.com with id u4RCQkFw004361; Fri, 27 May 2016 13:26:46 +0100 From: Sean Harte To: mukawa@igel.co.jp Cc: dev@dpdk.org, Sean Harte Date: Fri, 27 May 2016 13:26:35 +0100 Message-Id: <1464351995-4095-1-git-send-email-sean.harte@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH v1] null: set port_id in mbufs received from null PMD 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: Fri, 27 May 2016 12:26:50 -0000 Ensure that the port field is set in mbufs received from the null PMD. Signed-off-by: Sean Harte --- drivers/net/null/rte_eth_null.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 5e8e203..ab440f3 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -69,6 +69,7 @@ struct null_queue { struct pmd_internals { unsigned packet_size; unsigned packet_copy; + uint8_t port_id; struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT]; struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT]; @@ -114,6 +115,7 @@ eth_null_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) bufs[i]->pkt_len = packet_size; bufs[i]->nb_segs = 1; bufs[i]->next = NULL; + bufs[i]->port = h->internals->port_id; } rte_atomic64_add(&(h->rx_pkts), i); @@ -142,6 +144,7 @@ eth_null_copy_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) bufs[i]->pkt_len = packet_size; bufs[i]->nb_segs = 1; bufs[i]->next = NULL; + bufs[i]->port = h->internals->port_id; } rte_atomic64_add(&(h->rx_pkts), i); @@ -529,6 +532,7 @@ eth_dev_null_create(const char *name, internals->packet_size = packet_size; internals->packet_copy = packet_copy; + internals->port_id = eth_dev->data->port_id; internals->flow_type_rss_offloads = ETH_RSS_PROTO_MASK; internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_RETA_GROUP_SIZE; -- 2.5.0