DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qiming Yang <qiming.yang@intel.com>
To: dev@dpdk.org
Cc: Qiming Yang <qiming.yang@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] net/ice: disable advanced features in safe mode
Date: Fri,  1 Mar 2019 20:46:13 +0800	[thread overview]
Message-ID: <20190301124613.66527-2-qiming.yang@intel.com> (raw)
In-Reply-To: <20190301124613.66527-1-qiming.yang@intel.com>

As some advanced features are not supported in safe mode,
this patch disabled them when safe mode flags is set.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index c097259..4e2b65e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1379,6 +1379,8 @@ static int ice_load_pkg(struct rte_eth_dev *dev, const char *pkg_path)
 
 err_go_to_safe_mode:
 	ad->is_safe_mode = 1;
+	PMD_INIT_LOG(WARNING, "Initialize in safe mode,"
+		"some features are disabled.\n");
 
 	return err;
 }
@@ -1646,12 +1648,18 @@ static int ice_init_rss(struct ice_pf *pf)
 	struct ice_aqc_get_set_rss_keys key;
 	uint16_t i, nb_q;
 	int ret = 0;
+	bool is_safe_mode = pf->adapter->is_safe_mode;
 
 	rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
 	nb_q = dev->data->nb_rx_queues;
 	vsi->rss_key_size = ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE;
 	vsi->rss_lut_size = hw->func_caps.common_cap.rss_table_size;
 
+	if (is_safe_mode) {
+		PMD_DRV_LOG(WARNING, "RSS is not supported in safe mode\n");
+		return 0;
+	}
+
 	if (!vsi->rss_key)
 		vsi->rss_key = rte_zmalloc(NULL,
 					   vsi->rss_key_size, 0);
@@ -1955,6 +1963,7 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
 	struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev->device);
+	bool is_safe_mode = pf->adapter->is_safe_mode;
 
 	dev_info->min_rx_bufsize = ICE_BUF_SIZE_MIN;
 	dev_info->max_rx_pktlen = ICE_FRAME_SIZE_MAX;
@@ -2048,6 +2057,21 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->default_txportconf.nb_queues = 1;
 	dev_info->default_rxportconf.ring_size = ICE_BUF_SIZE_MIN;
 	dev_info->default_txportconf.ring_size = ICE_BUF_SIZE_MIN;
+
+	if (is_safe_mode) {
+		dev_info->rx_offload_capa =
+			DEV_RX_OFFLOAD_VLAN_STRIP |
+			DEV_RX_OFFLOAD_JUMBO_FRAME |
+			DEV_RX_OFFLOAD_KEEP_CRC |
+			DEV_RX_OFFLOAD_SCATTER |
+			DEV_RX_OFFLOAD_VLAN_FILTER;
+		dev_info->tx_offload_capa =
+			DEV_TX_OFFLOAD_VLAN_INSERT |
+			DEV_TX_OFFLOAD_TCP_TSO |
+			DEV_TX_OFFLOAD_MULTI_SEGS |
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		dev_info->flow_type_rss_offloads = 0;
+	}
 }
 
 static inline int
@@ -2413,6 +2437,7 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
 	struct rte_eth_rxmode *rxmode;
+	bool is_safe_mode = pf->adapter->is_safe_mode;
 
 	rxmode = &dev->data->dev_conf.rxmode;
 	if (mask & ETH_VLAN_FILTER_MASK) {
@@ -2429,6 +2454,11 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 			ice_vsi_config_vlan_stripping(vsi, FALSE);
 	}
 
+	if (is_safe_mode) {
+		PMD_DRV_LOG(WARNING, "QinQ is not supported in safe mode\n");
+		return 0;
+	}
+
 	if (mask & ETH_VLAN_EXTEND_MASK) {
 		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)
 			ice_vsi_config_double_vlan(vsi, TRUE);
-- 
2.9.5

  reply	other threads:[~2019-03-01  5:17 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 12:46 [dpdk-dev] [PATCH 1/2] net/ice: suppport package download Qiming Yang
2019-03-01 12:46 ` Qiming Yang [this message]
2019-03-01 18:38   ` [dpdk-dev] [PATCH 2/2] net/ice: disable advanced features in safe mode Stephen Hemminger
2019-03-01 20:41   ` Stillwell Jr, Paul M
2019-03-01 13:40 ` [dpdk-dev] [PATCH 1/2] net/ice: suppport package download Thomas Monjalon
2019-03-06  2:36   ` Yang, Qiming
2019-03-01 18:39 ` Stephen Hemminger
2019-03-01 18:40 ` Stephen Hemminger
2019-03-04 17:54 ` Stillwell Jr, Paul M
2019-03-20 15:50 ` [dpdk-dev] [PATCH v2 0/4] enable package download in ice driver Qiming Yang
2019-03-20 15:50   ` Qiming Yang
2019-03-20 15:50   ` [dpdk-dev] [PATCH v2 1/4] net/ice: load OS default package Qiming Yang
2019-03-20 15:50     ` Qiming Yang
2019-03-20 15:50   ` [dpdk-dev] [PATCH v2 2/4] net/ice: add safe mode Qiming Yang
2019-03-20 15:50     ` Qiming Yang
2019-03-20 15:50   ` [dpdk-dev] [PATCH v2 3/4] net/ice: enable RSS when device init Qiming Yang
2019-03-20 15:50     ` Qiming Yang
2019-03-20 15:50   ` [dpdk-dev] [PATCH v2 4/4] doc: add document update for package download Qiming Yang
2019-03-20 15:50     ` Qiming Yang
2019-03-20 17:59   ` [dpdk-dev] [PATCH v3 0/3] enable package download in ice driver Qiming Yang
2019-03-20 17:59     ` Qiming Yang
2019-03-20 17:59     ` [dpdk-dev] [PATCH v3 1/3] net/ice: load OS default package Qiming Yang
2019-03-20 17:59       ` Qiming Yang
2019-03-20 17:59     ` [dpdk-dev] [PATCH v3 2/3] net/ice: add safe mode Qiming Yang
2019-03-20 17:59       ` Qiming Yang
2019-03-20 17:59     ` [dpdk-dev] [PATCH v3 3/3] net/ice: enable RSS when device init Qiming Yang
2019-03-20 17:59       ` Qiming Yang
2019-03-21 15:02     ` [dpdk-dev] [PATCH v4 0/3] enable package download in ice driver Qiming Yang
2019-03-21 15:02       ` Qiming Yang
2019-03-21 15:02       ` [dpdk-dev] [PATCH v4 1/3] net/ice: load OS default package Qiming Yang
2019-03-21 15:02         ` Qiming Yang
2019-03-25  2:29         ` [dpdk-dev] [PATCH v5 0/3] enable package download in ice driver Qiming Yang
2019-03-25  2:29           ` Qiming Yang
2019-03-25  2:29           ` [dpdk-dev] [PATCH v5 1/3] net/ice: load OS default package Qiming Yang
2019-03-25  2:29             ` Qiming Yang
2019-03-25  2:29           ` [dpdk-dev] [PATCH v5 2/3] net/ice: add safe mode Qiming Yang
2019-03-25  2:29             ` Qiming Yang
2019-03-25  2:29           ` [dpdk-dev] [PATCH v5 3/3] net/ice: enable RSS when device init Qiming Yang
2019-03-25  2:29             ` Qiming Yang
2019-03-25  4:25           ` [dpdk-dev] [PATCH v5 0/3] enable package download in ice driver Stillwell Jr, Paul M
2019-03-25  4:25             ` Stillwell Jr, Paul M
2019-03-25  9:00         ` [dpdk-dev] [PATCH v6 " Qiming Yang
2019-03-25  9:00           ` Qiming Yang
2019-03-25  9:01           ` [dpdk-dev] [PATCH v6 1/3] net/ice: load OS default package Qiming Yang
2019-03-25  9:01             ` Qiming Yang
2019-03-25 13:56             ` Zhang, Qi Z
2019-03-25 13:56               ` Zhang, Qi Z
2019-03-25  9:01           ` [dpdk-dev] [PATCH v6 2/3] net/ice: add safe mode Qiming Yang
2019-03-25  9:01             ` Qiming Yang
2019-03-25  9:01           ` [dpdk-dev] [PATCH v6 3/3] net/ice: enable RSS when device init Qiming Yang
2019-03-25  9:01             ` Qiming Yang
2019-03-25 14:00           ` [dpdk-dev] [PATCH v6 0/3] enable package download in ice driver Zhang, Qi Z
2019-03-25 14:00             ` Zhang, Qi Z
2019-03-21 15:02       ` [dpdk-dev] [PATCH v4 2/3] net/ice: add safe mode Qiming Yang
2019-03-21 15:02         ` Qiming Yang
2019-03-21 15:02       ` [dpdk-dev] [PATCH v4 3/3] net/ice: enable RSS when device init Qiming Yang
2019-03-21 15:02         ` Qiming Yang
2019-03-21 15:02       ` [dpdk-dev] [PATCH v4 0/3] enable package download in ice driver Qiming Yang
2019-03-21 15:02         ` Qiming Yang
2019-03-21 15:02       ` [dpdk-dev] [PATCH v4 1/3] net/ice: load OS default package Qiming Yang
2019-03-21 15:02         ` Qiming Yang
2019-03-21 15:02       ` [dpdk-dev] [PATCH v4 2/3] net/ice: add safe mode Qiming Yang
2019-03-21 15:02         ` Qiming Yang
2019-03-21 15:02       ` [dpdk-dev] [PATCH v4 3/3] net/ice: enable RSS when device init Qiming Yang
2019-03-21 15:02         ` Qiming Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190301124613.66527-2-qiming.yang@intel.com \
    --to=qiming.yang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).