From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0048.outbound.protection.outlook.com [104.47.41.48]) by dpdk.org (Postfix) with ESMTP id 0A8CF1B1A1 for ; Sat, 7 Oct 2017 08:31:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2jHrXqeyntvKOgcS3Q+CDv5F3/Lc0ttIPR9EzzRzlA4=; b=YkzX7OCvGeL1Ne7QswsBXv5nQpv2uHEkEsu3lmXF6uNDk90niij7Ex665TJOoPU05GBCs224admIoNQYSHtA89s0a7Z/FgT2SE83HfqPJmsK1u4LjvmX9tWjgGTPSkn1lQxr9DdqMBBxtLHfc9BBC4k14ry+VU+/ES7qeNHcZDw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Rasesh.Mody@cavium.com; Received: from cavium.com (198.186.0.2) by MWHPR0701MB3833.namprd07.prod.outlook.com (2603:10b6:301:7f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 7 Oct 2017 06:31:47 +0000 From: Rasesh Mody To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Rasesh Mody , Dept-EngDPDKDev@cavium.com Date: Fri, 6 Oct 2017 23:31:07 -0700 Message-Id: <1507357872-26475-13-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1507357872-26475-1-git-send-email-rasesh.mody@cavium.com> References: <1507357872-26475-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [198.186.0.2] X-ClientProxiedBy: SN4PR0501CA0012.namprd05.prod.outlook.com (2603:10b6:803:40::25) To MWHPR0701MB3833.namprd07.prod.outlook.com (2603:10b6:301:7f::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca7f46c4-c8bd-4663-2c14-08d50d4d1629 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR0701MB3833; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3833; 3:6gqVM/hh4lcPPTTZk0XlqRwPIk472jjlh7Ssfr8TsElpxl4/BisP/2rdyeutzqlpqGmhENJ0aYC2iyB+1b1UG/8kWVJAZEc6/IoUkjlZ/G9zc0KahvS2/mH6jaZxS8h5w4Ulbpp0CQpiMWggtYl1QO5rROeas8bylNdZa8acCAfQSPlbF1BHDo6d0+twVX3tqI9a8NXrBQr1NJqDp/+g9C9Wmt208ZJtiN1Sf2O9bKlv/WO7+1p7XfNzAwCNv/hN; 25:66O15B1EDM9UAPXSZgozhpeKmgfLjgPYQdWZLhpS7FZlBz5Lx+Zhzt/Ngnk3db3IrkWVl3BZ9eVI7TF+xZBGQ0CvASciUYfTYBM08hvhMC79T2y8RSOtj/EsFYqsLKYtdlevwtzmRTqT9iZ1W939ICEoewQWWMSK89Yc5DP9OWB4kfkRspkMX6vgTEyIo3BAzl1T2yEFMsGmuMwelWwwgxzT7JOcfgjE5vbsXJLrREW1KLMlRrLlvhcbEJPPh2UqVfpIusX2WBJCVn1aDwFFZX2hv+QwVJp6xJePhZMNPazklSzJmme5nHCtMq4ZSz9WRkRTAYoq3av2qOXT5KvLCg==; 31:hZpeg+rJnPWZ93grdrbqPcwVaBO46Vh8opkLTNW9/7l7/zvyYlgSl89DsUwi2rxwfDkcw+5lm/WE09WX3O1s/9qlX3IJxlCuiS+5i4J3uebN+JnBcGYoSq1O7hXe3/MnnwnNLidYY5N5l7kKS3GcFjBQhi1zAyvpBLuzlc51P9v9D11dgC8ULqKW1ff4Sbjeos7/nSSwuhz9o0K9W6lv7rgaeWiYTDSRM246YTTfIJE= X-MS-TrafficTypeDiagnostic: MWHPR0701MB3833: X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3833; 20:NpsTnwYG5EV9Qn8wnAamiUZ1JCO+w9yyT4NCLcC+g2RiMWbYJ0femt7vmR09XdaYKJPa0a+xRs8VH4k3DPjSo45VgTRpCfb4D1pEt5vfmAt+9ogmEZ0WyjWC9eJkj3waYfZR3Bn9g40sywXn9cjG5kToSGmGK0WVi9wI6bxhSeV6rFE1V4dirTLUqG2ZsxAfAfnQDHmPF1MaD+ewHNC6ARhvgjLV7RD/wyhyHWdSuVGgkOJavfgpSWvm4eob0deE+CQ1ZIaP7p/VQEC1v/ppGNKUn/JxoLiONz9VT2W/ADogrpsJW5kDq1J+eeiAWLpREnYGGn3z7SIjL4jiqpvVY2SQRWtdtVcm17UELI2QF0hFamCrC0oVk/jaC12rP4tpLNErZuprqmilRolDFWdVhVZR0yVAl2DsF5SM5CEXAIvlY6kwW03UA+lP6X4oKX2c1s6+7QVACpCFdIy/uU8gKo6oFxw/HPzRlEmu9qD/X+w62Bo3xegs2UhoAoYQ5TkG; 4:i6r4nWmDQ4sEbTnhll72o+YhIfU53oNKDZIoUmB1WaWKcKkZ20wCOWauCIUDguDAi56Oh8wmhC11zghapGMpKQ9+OdQ2bDRCQizTRPBvFuJahcqwSMX2rc83dXU2PZUSgNp0dJJufWHkhY3LkIsj+0cxLxTVEBaqjFF+guAuAt41wDTWVmF6LOW6yLjO0M8FsmoSsVPeU85EPxc+GrgN3s7tuWUpn4zjq4LRNuClyGGixdTdaZNx/pVRzIti1rwv X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR0701MB3833; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR0701MB3833; X-Forefront-PRVS: 045315E1EE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(189002)(2906002)(6116002)(8936002)(3846002)(48376002)(68736007)(478600001)(101416001)(105586002)(50226002)(106356001)(72206003)(5660300001)(50466002)(33646002)(25786009)(4720700003)(21086003)(2950100002)(6666003)(69596002)(36756003)(76176999)(50986999)(81156014)(53936002)(107886003)(4326008)(55016002)(47776003)(66066001)(5003940100001)(81166006)(189998001)(8676002)(305945005)(97736004)(16586007)(316002)(7736002)(16526018)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0701MB3833; H:cavium.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR0701MB3833; 23:7o/kF8qqKDT5UtUxOzMlhZ9nUtRLjv6o5fzpkBm?= =?us-ascii?Q?EwBPAt2Se/b1d55PDvdI7sRC3RLm69FzG81KnM8ybCu1nMlTuY1+17ECd0A6?= =?us-ascii?Q?Krmnqo6t8GAiNfaC968dyavEj43N8YOKMXGRopDAWlpRw/g5rW5+sJQFcAKE?= =?us-ascii?Q?HeF3O38aP9bu8ITuSIGkSchrhvZuYolqotzga9WTcc4Ta7xMNo5xWIH54Kfv?= =?us-ascii?Q?/oz3j3zKTVKLU5E5pYeDage1evUB7cq2C9MUBlAto+aJGAQ6SBkxMPssUbez?= =?us-ascii?Q?iAsKj78nW/1MUoHi4NBKCbBXuWDARMN2Am2OmX9FxC6SxM/Jp4bhpTesG9Hx?= =?us-ascii?Q?VDXgShJBIvU0l67sEosaqk+/00BIBoG467QWMhJGULXLvplP0ONeO7F98DEV?= =?us-ascii?Q?3+D0dRgjvqDr0IP/7kQFpq8R98fw3ZqzgQYVPZlDCywcVqFNiWg95IWIhitg?= =?us-ascii?Q?+PSS7O0HdXTEoWgJtzc8au5JpskUjduSq2Yn+emd4lVcgaScKfE3wBgqQgnB?= =?us-ascii?Q?dGe+uu4TaHmwujYqorS6X2sMaK+jSSgdS6zruvR+43xoj3eTj5ktvrUY47tj?= =?us-ascii?Q?xMx3VX645UKUFyB5LxytyLbvdD6HiTnOnkI/TViP+e8Xum+OxHJxtho/DVL9?= =?us-ascii?Q?9/x+96+gtMZvoC7e9kzONV9KNeRNJ5VCINQ3SkZQyDeCsO+8RFBHvILLUFN9?= =?us-ascii?Q?sRvT5Fc7pe35iSqsmmOePkg2hczRSXfbQ6lRDFKSqs4e09uDS3YhqiIiEag0?= =?us-ascii?Q?DgD2uoCaxaNIwO9L2RUPSvm/U6YpV99w9eDcmSeu1jNzrwvY/kE3UknnhWLX?= =?us-ascii?Q?9G9ODiWcY/mXxNdCj6BIQXlHV8K6D2JLl2EOsTxmhWFPjiydjD0iMXtXhssw?= =?us-ascii?Q?QoeSj5UYMBqPnOL/Hw45GvPFtF765r29AyOxaxC/7Zi4XuFM0RBlLkeSX1Ze?= =?us-ascii?Q?OVQD7/XXIXnrnssfK5zaiUiAM5WXGI+Bu/Fl2gMj2tUiZptgca6byRxY5L80?= =?us-ascii?Q?RYUvN6XpfdpSC7FU2cx7qcHjeW3cXx53qNIXuXCMeDD1A9vuoDrKxHoaEliI?= =?us-ascii?Q?/FNldJpOwbL9oiMFn8FDTZmRRCVW9yuoywQr98fMxFj5UCCXlaziTungSusU?= =?us-ascii?Q?/UuxQ/qUAR8c=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3833; 6:+YiPV0H7hiXkozKb3P60Rx7SqMFI/G8RYGbh31IaSEaWllsUBGS3j9tX2Th3DS5xHmpPJ+xVVgjWynUu0sjRBmSuir6ucttVINx+5gRZMaCBLJeS9657FvqcRlIuQtRGzdE0WnLQMDH+fzxp/GoUxAdn9nXoGtgPDulJ7XVlaT/h07uTWAD3Y7AYsT3WQdDbocxr4eQ4Z2/SkIb6uFdSrZsye7yzcezNwmGyQ7+mIWNHsJWg5/R+g+BuzyJ8RaqdtbzBXZbSLUC2GCHIp/MUssnTtneyUM18XKvKIJ4r1weXwxaQmnG9rsVF/g6foQi3xo0DySq5XVABUcwaSejjCw==; 5:McKQ8XGvT+Mu7HCT8G6/zkexAHemkCE4GBAzFKEJL0yr0fTJH1+45cC4ByRQRyrX1J8PEpZ5eKsSjPTKfCPYUUsFGZS4S3D3++6nolbaVuL3K01lXpyjdZ+gkCUbjW5JuvHDkRJamnN1XW5mewb+iA==; 24:ddPQyhfe3DQXHM1XRvOlXtMwFgcklf8DZWtGIYq04z83o4n0c4y4UVdVxK98l5s0WZRSrSWo5O1M5sM3ibobFYqg0j3bcExK2FRxUxi7AmA=; 7:VR/FTC6n+ueWOrjcfLAWeHHADUfKU6/7ewda9vrYzki5Gw5p/3W2QPPGV3bEu4JYzYi2yfQm5CwnV9x6l2/CJ6K/fQyCl602T4QNBFcNOckaKhvF4BddNu6kzU3hdXgNDZXSS32BwW14tW+Mt6+WRp5gvzp+VET0gLhtfC21+uViQMIh2UrOuUo1ByGNJemDiFyFm/gKlqDP/s6RYEk2QGziqueNwdAOL8JmZQDvZ+w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2017 06:31:47.2920 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3833 Subject: [dpdk-dev] [PATCH 12/17] net/qede/base: check device personality for feature setting 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: Sat, 07 Oct 2017 06:31:49 -0000 - Add non-L2 personality macros and add a personality check before setting the HW features Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore.h | 14 +++++++++----- drivers/net/qede/base/ecore_dev.c | 15 +++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h index 5eff6aa..eaf2604 100644 --- a/drivers/net/qede/base/ecore.h +++ b/drivers/net/qede/base/ecore.h @@ -361,19 +361,23 @@ enum ecore_db_rec_exec { struct ecore_hw_info { /* PCI personality */ enum ecore_pci_personality personality; -#define ECORE_IS_RDMA_PERSONALITY(dev) \ - ((dev)->hw_info.personality == ECORE_PCI_ETH_ROCE || \ +#define ECORE_IS_RDMA_PERSONALITY(dev) \ + ((dev)->hw_info.personality == ECORE_PCI_ETH_ROCE || \ (dev)->hw_info.personality == ECORE_PCI_ETH_IWARP || \ (dev)->hw_info.personality == ECORE_PCI_ETH_RDMA) -#define ECORE_IS_ROCE_PERSONALITY(dev) \ +#define ECORE_IS_ROCE_PERSONALITY(dev) \ ((dev)->hw_info.personality == ECORE_PCI_ETH_ROCE || \ (dev)->hw_info.personality == ECORE_PCI_ETH_RDMA) -#define ECORE_IS_IWARP_PERSONALITY(dev) \ +#define ECORE_IS_IWARP_PERSONALITY(dev) \ ((dev)->hw_info.personality == ECORE_PCI_ETH_IWARP || \ (dev)->hw_info.personality == ECORE_PCI_ETH_RDMA) -#define ECORE_IS_L2_PERSONALITY(dev) \ +#define ECORE_IS_L2_PERSONALITY(dev) \ ((dev)->hw_info.personality == ECORE_PCI_ETH || \ ECORE_IS_RDMA_PERSONALITY(dev)) +#define ECORE_IS_FCOE_PERSONALITY(dev) \ + ((dev)->hw_info.personality == ECORE_PCI_FCOE) +#define ECORE_IS_ISCSI_PERSONALITY(dev) \ + ((dev)->hw_info.personality == ECORE_PCI_ISCSI) /* Resource Allocation scheme results */ u32 resc_start[ECORE_MAX_RESC]; diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c index 75fcfae..5d9bc28 100644 --- a/drivers/net/qede/base/ecore_dev.c +++ b/drivers/net/qede/base/ecore_dev.c @@ -2869,12 +2869,15 @@ static void ecore_hw_set_feat(struct ecore_hwfn *p_hwfn) FEAT_NUM(p_hwfn, ECORE_VF_L2_QUE)); } - feat_num[ECORE_FCOE_CQ] = OSAL_MIN_T(u32, sb_cnt.cnt, - RESC_NUM(p_hwfn, - ECORE_CMDQS_CQS)); - feat_num[ECORE_ISCSI_CQ] = OSAL_MIN_T(u32, sb_cnt.cnt, - RESC_NUM(p_hwfn, - ECORE_CMDQS_CQS)); + if (ECORE_IS_FCOE_PERSONALITY(p_hwfn)) + feat_num[ECORE_FCOE_CQ] = + OSAL_MIN_T(u32, sb_cnt.cnt, RESC_NUM(p_hwfn, + ECORE_CMDQS_CQS)); + + if (ECORE_IS_ISCSI_PERSONALITY(p_hwfn)) + feat_num[ECORE_ISCSI_CQ] = + OSAL_MIN_T(u32, sb_cnt.cnt, RESC_NUM(p_hwfn, + ECORE_CMDQS_CQS)); DP_VERBOSE(p_hwfn, ECORE_MSG_PROBE, "#PF_L2_QUEUE=%d VF_L2_QUEUES=%d #ROCE_CNQ=%d #FCOE_CQ=%d #ISCSI_CQ=%d #SB=%d\n", -- 1.7.10.3