From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 1C9011DBE for ; Fri, 1 Mar 2019 21:41:06 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2019 12:41:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,429,1544515200"; d="scan'208";a="137383203" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 01 Mar 2019 12:41:05 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 1 Mar 2019 12:41:05 -0800 Received: from fmsmsx120.amr.corp.intel.com ([169.254.15.225]) by FMSMSX102.amr.corp.intel.com ([169.254.10.213]) with mapi id 14.03.0415.000; Fri, 1 Mar 2019 12:41:04 -0800 From: "Stillwell Jr, Paul M" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Yang, Qiming" Thread-Topic: [dpdk-dev] [PATCH 2/2] net/ice: disable advanced features in safe mode Thread-Index: AQHUz+4cVc+6D4xj8UqwxJ5RyxPau6X3PhaA Date: Fri, 1 Mar 2019 20:41:04 +0000 Message-ID: References: <20190301124613.66527-1-qiming.yang@intel.com> <20190301124613.66527-2-qiming.yang@intel.com> In-Reply-To: <20190301124613.66527-2-qiming.yang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmZjYzdhMDUtYjJjOS00NzI5LTg5YjItYTAwMmFhMjRmODY5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYWFQOVQ1TVdNOXVtamlUMGNEWUllSm4wTDNncDArWEpCRzk0eWNaM2lcL1I0dm92T3kxMWZpY1hnODhJRjVFalEifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] net/ice: disable advanced features in safe mode 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: Fri, 01 Mar 2019 20:41:07 -0000 Hi Qiming, For some reason I am not seeing patch 1/2 in this series. Can you make sure= you sent it or re-send it? Paul -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang Sent: Friday, March 1, 2019 4:46 AM To: dev@dpdk.org Cc: Yang, Qiming Subject: [dpdk-dev] [PATCH 2/2] net/ice: disable advanced features in safe = mode As some advanced features are not supported in safe mode, this patch disabl= ed them when safe mode flags is set. Signed-off-by: Qiming Yang --- 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 in= dex 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, cons= t char *pkg_path) =20 err_go_to_safe_mode: ad->is_safe_mode =3D 1; + PMD_INIT_LOG(WARNING, "Initialize in safe mode," + "some features are disabled.\n"); =20 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 =3D 0; + bool is_safe_mode =3D pf->adapter->is_safe_mode; =20 rss_conf =3D &dev->data->dev_conf.rx_adv_conf.rss_conf; nb_q =3D dev->data->nb_rx_queues; vsi->rss_key_size =3D ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE; vsi->rss_lut_size =3D hw->func_caps.common_cap.rss_table_size; =20 + 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 =3D 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 =3D ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct ice_vsi *vsi =3D pf->main_vsi; struct rte_pci_device *pci_dev =3D RTE_DEV_TO_PCI(dev->device); + bool is_safe_mode =3D pf->adapter->is_safe_mode; =20 dev_info->min_rx_bufsize =3D ICE_BUF_SIZE_MIN; dev_info->max_rx_pktlen =3D ICE_FRAME_SIZE_MAX; @@ -2048,6 +2057,21 @@ ic= e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->default_txportconf.nb_queues =3D 1; dev_info->default_rxportconf.ring_size =3D ICE_BUF_SIZE_MIN; dev_info->default_txportconf.ring_size =3D ICE_BUF_SIZE_MIN; + + if (is_safe_mode) { + dev_info->rx_offload_capa =3D + 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 =3D + 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 =3D 0; + } } =20 static inline int @@ -2413,6 +2437,7 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mas= k) struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct ice_vsi *vsi =3D pf->main_vsi; struct rte_eth_rxmode *rxmode; + bool is_safe_mode =3D pf->adapter->is_safe_mode; =20 rxmode =3D &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 ma= sk) ice_vsi_config_vlan_stripping(vsi, FALSE); } =20 + 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