From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0089.outbound.protection.outlook.com [104.47.36.89]) by dpdk.org (Postfix) with ESMTP id 0B39B5585 for ; Thu, 21 Jul 2016 16:02:32 +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=R0hghaSwihackPWVA0K1yGHHDz8EqcKfFumGdd0a2WY=; b=S6oz5cddGgOWs/pBEAc0iik+79qUzuHWOcB4wolwyXq5xZl0jFIT9XHXmTcc5j9y1MJ+i4x04MOAm62Gk5grInxT4PicekLts57bODh41zhhmm41T8x9HSD042ZqUvvbrjH8I2n0ZwyDlyJDyRf+MU4EPXxByyZFpCFnChnjZ9c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.166.90.242) by BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Thu, 21 Jul 2016 14:02:27 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob Date: Thu, 21 Jul 2016 19:31:45 +0530 Message-ID: <1469109707-23213-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1469109707-23213-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1469109707-23213-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.166.90.242] X-ClientProxiedBy: MAXPR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.164.147.28) To BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) X-MS-Office365-Filtering-Correlation-Id: e6826e38-9401-4304-93bd-08d3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fZU+JvYFkwnF0uHBDJoWSr6YjybOG8vgI/R86y5qsvXGlXfXGQ==; 20:io3NlBBKMrEvF8MxXvsYx463XO5SgdaF9YanLGlejIjeff1fc+np6PVa0LJLmSVsQPoI1ekxD95FjE9I87GK3hpGjEFc90H10AZ8It5pHrzWRzobcKkinjT/QzOgpBGeM7TRwWGMZNOSnUZQRlVahc18jxyafaYtkNd8e2Ga9eHMUbkkcmPJoShvc22cLhzm9mb6uT3MKx8BiycNZG/0ujrzH3qpKvxTa/BJ9GrljLOT0+eiIenSA8sxQ5sJUcdkyL/tDgYiCxP6V6XvWbQhw06AWivAbtA0mujcBu5CReaojFy7eKm3zaQ3a5x5/MSCoCYNWiMxOrBMjwcgysq6n/hMAxseDZTohk6O/VceuRda1rfv+SvAmZg2u7Ar1HCm7LQPc/BE2Ql7tIzH4f0k6lK0LFYSQA2LWrTHSDwxWwCKJsJhs/BcriaiNZTfMpttckxQItVzffEIrv/jbnydNaOx6qnFz3PhK1obyCA2Vc0xnRHLFIPA+mI0JNZX4p16Q996lTf/FnI2WPTtFIn4wbFUGAUwfjBTBuOapmttUXCm2kmpEKg8bKc1PLTuHZR8YWiTecqnFNO4RmJzZ4kc22LGJUFrRbwQbE8GxNk8SnI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BLUPR0701MB1715; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 4:kVXKZdRdN7mmkT2VqPQbXAs7vjYycEVsnYlw3Rx0lW2Izt58rPrKQuI1mhYk/qSQJ2CJc2jCmN7vnsLVcXgbScqCajZFacESPWBMnhZkEHt41Hmbw/H7MzIqyjW8+/M0S15JVbHWkoNbapviRMK3qd9gvXYvqIdFPZtUabo75vC4jufp/eK65vg3T3lC5ZQKEmBP9yJhgj/khfWnnuGLm2sQXmxcWFWhciPAwP7tHtqRPaJr7D3x6Mcs4INiDue3xwqxyihHGZ8mdG0aIWij2dMysk9+P7IaqvifYDltJOK2MBvEiXD26/zPOmWDqNYpxsClViHQ+ODgwa+7rW7ZJo5Z/Bag1fdDzX6j+P6jwZqsmwqwntwFvlcvG6i+j+MM X-Forefront-PRVS: 0010D93EFE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(189998001)(110136002)(33646002)(97736004)(5003940100001)(19580405001)(19580395003)(229853001)(50986999)(76176999)(107886002)(101416001)(36756003)(4001430100002)(2351001)(575784001)(586003)(3846002)(4326007)(66066001)(2950100001)(50466002)(8676002)(81166006)(81156014)(47776003)(7736002)(2906002)(7846002)(92566002)(50226002)(42186005)(68736007)(48376002)(77096005)(105586002)(106356001)(6116002)(305945005)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1715; H:localhost.localdomain.localdomain; 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; BLUPR0701MB1715; 23:2BhZ3FqawlkEfGbyiAujstVK4OmlKBRjwomdhXz?= =?us-ascii?Q?BvxTtj5kiFYcyaHWeQmvyQCt3mjux2EyiHVlXbl+Mj+Yf8gYpqlEOjFHvRwM?= =?us-ascii?Q?pz6m6za4p1uIyxgTDTLkd96ICdWdlVTgNNEMCHdqTq2ulN4m74xSEJkH1WMb?= =?us-ascii?Q?lpx5ap6S6GGr15JwW6x8XTKyPFVlthAGTBNm4iMLu0g2KBRoDuutbByLqzV6?= =?us-ascii?Q?9dcZ3XyvozfQdAKZTXwMdRbWBv+RCvq7M7XQU1ycbS++m93jShOr7FucdAkh?= =?us-ascii?Q?U0Gn6qANSMT4fx9vVD8V+WtwGcAjpxfjbbSoce3gzY8apXNhe2H2QP5ljbY5?= =?us-ascii?Q?UgM5dPD5HI/KWwBOuJP76T2YetTU0PgybNqv4G1urE40Dzz5IMplOkDy6AwA?= =?us-ascii?Q?G3C4kG/21bThtcHWhifLnXznJhV6TN4MMCqtqRziPT3cE4oW3aHsxpfJg8V6?= =?us-ascii?Q?U/gQXPaXyvBUBeCvza1br4DJ0sN7MjxtQ6y/ryJi9uu6tlsLf4XEk/tgw3Ws?= =?us-ascii?Q?Zy2rfMx/gcDznelADmR/kFO7ylolJdXo6YRC0I1Ms7pcTzk9pScrqih8HD1+?= =?us-ascii?Q?qUtg+oUUOIK//PkU8iuxojNr2N/RwfuD8Hf/G/HKoBuO8YPnxrJbfXsmsm2F?= =?us-ascii?Q?pLaqHHF08G8HjvzeR2XujlEOrRJIcOUUANaBJ4S6ocltHJLJQfgHeKKVoodJ?= =?us-ascii?Q?vGCgPgZHxgVG0odgvjaFUAZcwx0sfG167cQZt7f+Iqo8VgVoWFgAmAthgzkU?= =?us-ascii?Q?aTdh7jpvcTOxhfFgE15l9Dtwxm02d8jPpCfN11hzglf+nTKKZdRT0hB9e6xm?= =?us-ascii?Q?yF65A+/Ej97cOOriDZXIS+k6qSY6P96qdoxgONv1qiTyuxVj5YxaW322HtqL?= =?us-ascii?Q?3rksczfDTA0QJcwEsKHkR+GDRwYUH1YYswZruqmogIeYomBd5FY+/yLsxJuT?= =?us-ascii?Q?2sfzD17agdt40hlskb2w4BOcSRxXOzJcnOlXXwT+SQtrMapidrk4TXHUt5wl?= =?us-ascii?Q?8rC2gwR03LvzqulBD2c0vuJUgsHr3/e5wlAGl2U6/2Br5+L1thM1w/+Xv6gX?= =?us-ascii?Q?uc7Iwq/2B1+83AA8F7XJGNYusiHGszwlxaP/rWWVdMVCfayLLvOtNtkdNP1M?= =?us-ascii?Q?K6QCnN/4THZN11dGXwgCNogHkGj9oIyYHLsSdEZRAqT0GiCxp26X8TQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 6:B5VLeWCkQn6S1sNo2H68HVl5Z/R6laW698CXKJd3/1sfbXXyT+EozQFOB0gZ/VH+p95OCimUmmmqP4Y8QRhucAeB3qX7M4VchRflIh+ETL6n5NS3PnTOJNaJoVmWLpCpGMH171EBGJW4Y73tZMtbgi9ThL9NjnK9y5ySsh7LRQ5wlJS69uffRmsAhy4Nrab29uYxG9GBS5dDElHpvhrUmT1P2RfRJM8YIWPQh67iIJ/M4A9HqclGxoS8OkuN+uNy6lIPFyVkGZhzOjrXyj9cuvhB9Tz9OoydNjrINc5qarc=; 5:ebQsalQa4h/NLv4J0NoejhLWrp/7MoQmeJ/EsvUKkNAgMQMyiSD4UA8YQplCv5OcaB6cVk5598IJy7fWgxoHNDcnOEi1kP60s0sTWZjVRcuk/3FKNTFExDq6yOimxnMy9MBA8lQzehhLOO63QMXu0A==; 24:cKRTcm4Asbu5VbrXKicYcR2rFsTVcDl6VjQii1/Edy44imu6q8Pc3gupmkyenOHsm72nV1F2JMVmQdpymwq4jQcKvfFpADOTGvJc14SMv2g=; 7:+Iv1zLP+RLem714Wc9lvIUerYlQCSul2J5t5sj4lcNm/BhjqD2YZAUZfpGbUGObNJPT0YQcLoJ7/obKNvxF7olIO4j2WUiGKfChCxrWlVsp6CPOUprlLkSI2Crhq6AS5Wkkd9S3dmpltssSUkEuwjsEOvYbM2RV+5RiSCmAEUgyaLPpwa/tWsu0UueFY81w5hpaxvV8LpObvrTN6DY9RsoOvwLqLBBK0HSYqgnsGc7opKbZpx5jq3Z+TWFgKno/t SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2016 14:02:27.8844 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1715 Subject: [dpdk-dev] [PATCH 1/3] net/thunderx: remove generic passx references from the driver 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: Thu, 21 Jul 2016 14:02:32 -0000 thunderx pmd driver needs to support multiple SoC variants in ThunderX family. Remove generic pass references from driver as each SoC can have same pass number. Signed-off-by: Jerin Jacob --- drivers/net/thunderx/base/nicvf_hw.c | 2 +- drivers/net/thunderx/base/nicvf_hw.h | 12 +++++------- drivers/net/thunderx/nicvf_ethdev.c | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/net/thunderx/base/nicvf_hw.c b/drivers/net/thunderx/base/nicvf_hw.c index 001b0ed..2b12d9c 100644 --- a/drivers/net/thunderx/base/nicvf_hw.c +++ b/drivers/net/thunderx/base/nicvf_hw.c @@ -140,7 +140,7 @@ nicvf_base_init(struct nicvf *nic) if (nic->subsystem_device_id == 0) return NICVF_ERR_BASE_INIT; - if (nicvf_hw_version(nic) == NICVF_PASS2) + if (nicvf_hw_version(nic) == PCI_SUB_DEVICE_ID_CN88XX_PASS2_NICVF) nic->hwcap |= NICVF_CAP_TUNNEL_PARSING; return NICVF_OK; diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h index 9db1d30..602a6ff 100644 --- a/drivers/net/thunderx/base/nicvf_hw.h +++ b/drivers/net/thunderx/base/nicvf_hw.h @@ -37,11 +37,11 @@ #include "nicvf_hw_defs.h" -#define PCI_VENDOR_ID_CAVIUM 0x177D -#define PCI_DEVICE_ID_THUNDERX_PASS1_NICVF 0x0011 -#define PCI_DEVICE_ID_THUNDERX_PASS2_NICVF 0xA034 -#define PCI_SUB_DEVICE_ID_THUNDERX_PASS1_NICVF 0xA11E -#define PCI_SUB_DEVICE_ID_THUNDERX_PASS2_NICVF 0xA134 +#define PCI_VENDOR_ID_CAVIUM 0x177D +#define PCI_DEVICE_ID_THUNDERX_CN88XX_PASS1_NICVF 0x0011 +#define PCI_DEVICE_ID_THUNDERX_NICVF 0xA034 +#define PCI_SUB_DEVICE_ID_CN88XX_PASS1_NICVF 0xA11E +#define PCI_SUB_DEVICE_ID_CN88XX_PASS2_NICVF 0xA134 #define NICVF_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) @@ -50,8 +50,6 @@ #define NICVF_GET_TX_STATS(reg) \ nicvf_reg_read(nic, NIC_VNIC_TX_STAT_0_4 | (reg << 3)) -#define NICVF_PASS1 (PCI_SUB_DEVICE_ID_THUNDERX_PASS1_NICVF) -#define NICVF_PASS2 (PCI_SUB_DEVICE_ID_THUNDERX_PASS2_NICVF) #define NICVF_CAP_TUNNEL_PARSING (1ULL << 0) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 4f875c0..3802d49 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -265,7 +265,7 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) size_t copied; static uint32_t ptypes[32]; struct nicvf *nic = nicvf_pmd_priv(dev); - static const uint32_t ptypes_pass1[] = { + static const uint32_t ptypes_common[] = { RTE_PTYPE_L3_IPV4, RTE_PTYPE_L3_IPV4_EXT, RTE_PTYPE_L3_IPV6, @@ -274,7 +274,7 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_FRAG, }; - static const uint32_t ptypes_pass2[] = { + static const uint32_t ptypes_tunnel[] = { RTE_PTYPE_TUNNEL_GRE, RTE_PTYPE_TUNNEL_GENEVE, RTE_PTYPE_TUNNEL_VXLAN, @@ -282,12 +282,12 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) }; static const uint32_t ptypes_end = RTE_PTYPE_UNKNOWN; - copied = sizeof(ptypes_pass1); - memcpy(ptypes, ptypes_pass1, copied); - if (nicvf_hw_version(nic) == NICVF_PASS2) { - memcpy((char *)ptypes + copied, ptypes_pass2, - sizeof(ptypes_pass2)); - copied += sizeof(ptypes_pass2); + copied = sizeof(ptypes_common); + memcpy(ptypes, ptypes_common, copied); + if (nicvf_hw_cap(nic) & NICVF_CAP_TUNNEL_PARSING) { + memcpy((char *)ptypes + copied, ptypes_tunnel, + sizeof(ptypes_tunnel)); + copied += sizeof(ptypes_tunnel); } memcpy((char *)ptypes + copied, &ptypes_end, sizeof(ptypes_end)); @@ -1741,16 +1741,16 @@ static const struct rte_pci_id pci_id_nicvf_map[] = { { .class_id = RTE_CLASS_ANY_ID, .vendor_id = PCI_VENDOR_ID_CAVIUM, - .device_id = PCI_DEVICE_ID_THUNDERX_PASS1_NICVF, + .device_id = PCI_DEVICE_ID_THUNDERX_CN88XX_PASS1_NICVF, .subsystem_vendor_id = PCI_VENDOR_ID_CAVIUM, - .subsystem_device_id = PCI_SUB_DEVICE_ID_THUNDERX_PASS1_NICVF, + .subsystem_device_id = PCI_SUB_DEVICE_ID_CN88XX_PASS1_NICVF, }, { .class_id = RTE_CLASS_ANY_ID, .vendor_id = PCI_VENDOR_ID_CAVIUM, - .device_id = PCI_DEVICE_ID_THUNDERX_PASS2_NICVF, + .device_id = PCI_DEVICE_ID_THUNDERX_NICVF, .subsystem_vendor_id = PCI_VENDOR_ID_CAVIUM, - .subsystem_device_id = PCI_SUB_DEVICE_ID_THUNDERX_PASS2_NICVF, + .subsystem_device_id = PCI_SUB_DEVICE_ID_CN88XX_PASS2_NICVF, }, { .vendor_id = 0, -- 2.5.5