From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rere.qmqm.pl (rere.qmqm.pl [84.10.57.10]) by dpdk.org (Postfix) with ESMTP id 2F6B8106A for ; Tue, 13 Dec 2016 02:08:17 +0100 (CET) Received: by rere.qmqm.pl (Postfix, from userid 1000) id CB7EC6113; Tue, 13 Dec 2016 02:08:16 +0100 (CET) Message-Id: In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: dev@dpdk.org Date: Tue, 13 Dec 2016 02:08:16 +0100 (CET) Subject: [dpdk-dev] [PATCH 06/13] null: fake PMD capabilities X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 01:08:17 -0000 From: Paweł Małachowski Thanks to that change we can use Null PMD for testing purposes. Signed-off-by: Michał Mirosław --- drivers/net/null/rte_eth_null.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 836d982..f32ba2a 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -284,6 +284,9 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, return 0; } +static void +eth_dev_void_ok(struct rte_eth_dev *dev __rte_unused) { return; } + static void eth_dev_info(struct rte_eth_dev *dev, @@ -304,6 +307,9 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->pci_dev = NULL; dev_info->reta_size = internals->reta_size; dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; + /* We hereby declare we can RX-offload VLAN-s out of thin air and update checksums and VLANs before sinking packets in /dev/null */ + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; + dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_IPV4_CKSUM; } static void @@ -477,7 +483,12 @@ static const struct eth_dev_ops ops = { .reta_update = eth_rss_reta_update, .reta_query = eth_rss_reta_query, .rss_hash_update = eth_rss_hash_update, - .rss_hash_conf_get = eth_rss_hash_conf_get + .rss_hash_conf_get = eth_rss_hash_conf_get, + /* Fake our capabilities */ + .promiscuous_enable = eth_dev_void_ok, + .promiscuous_disable = eth_dev_void_ok, + .allmulticast_enable = eth_dev_void_ok, + .allmulticast_disable = eth_dev_void_ok }; int -- 2.10.2