From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 6BCA7C6B8 for ; Fri, 29 Jan 2016 15:08:47 +0100 (CET) Received: by mail-wm0-f49.google.com with SMTP id p63so69729418wmp.1 for ; Fri, 29 Jan 2016 06:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fCshs8LQIEAh6Tl2RDBkms/Rj6xItoUVMLOyeJ+bOf8=; b=W32YkFuhl2A2veM61U5JFUhd8UVKwoMMsLXYsUcR4qUroZVKcoVwkcTdet79FpHC06 OzyqOYPXeZjUAyc64ylxDPmIaTJjlJnZpgL6YcA4jjrQupEw2lrqzMqeje29srOq4pbI RTUj1Hryrr1SKbeTzLQAAOUUddL2ZD4Jpw9TfRQCxSwBJ4XmGTIhLoHsa6pEV8WLtKeL YBwnQ32wMgo6XdN2rG8Y8+0nN4zigC4vyBFj4BIkHYRGkCNuL5ZUYSDjpBAN7IuFq0Fm oM29brMzdvuhElEy0++Z2aJmHMz/+p4UBsTFztCXdhU1iSjcpUazKKXEzKjGe+b66aPE Zq8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fCshs8LQIEAh6Tl2RDBkms/Rj6xItoUVMLOyeJ+bOf8=; b=gxGMIc/DACF3UucEH0jI8pd7VLrlQl214LMsmVBrO/YyvRaIeqkXI4MPhjPHVLC2yn a9nxo52/JTLja1ViDSTnrNWgwjIjUEX0v2TTlK77PoqxM5ud8ldPsQY/o6nzBtiD+zx4 ak+pfTB1s+esCrFdMMM1ERfK7ppLIrPQh+DAkoapRoAokAdC5vA1gKYVmOWRwCdbkq98 JzB6/5Jd2Hno3I1Wx48Ur6xjfUjJV8REpjqhhfQhbnDDXJmvD7mlJdir/fDf8Hvb80Tg cyM1TF/XzxaawH9a7x2FKH77S3dA2gtuXbAtz9vye7wwEJxDUfjcXEV3UwJ4AkwWMG22 8OUw== X-Gm-Message-State: AG10YORqjkd/bCz7CVNHV0gLbUKC66CokFcL9XLwkwBK7FhUw0gMkTDbD4f5OHFD7Io3+NFI X-Received: by 10.194.134.105 with SMTP id pj9mr10101149wjb.10.1454076527294; Fri, 29 Jan 2016 06:08:47 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id 67sm7669944wmp.20.2016.01.29.06.08.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 06:08:46 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 29 Jan 2016 15:08:32 +0100 Message-Id: <1454076516-21591-6-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> Cc: viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH 5/9] eal: get rid of pmd type 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: Fri, 29 Jan 2016 14:08:47 -0000 Now that we only have vdev drivers, there is no need for a pmd type in rte_driver. rte_driver is now purely a vdev thing, and could be renamed later (then .init would become .probe, .uninit would become .remove). Signed-off-by: David Marchand --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 2 ++ drivers/net/af_packet/rte_eth_af_packet.c | 2 ++ drivers/net/bonding/rte_eth_bond_pmd.c | 2 ++ drivers/net/mpipe/mpipe_tilegx.c | 4 ++++ drivers/net/null/rte_eth_null.c | 2 ++ drivers/net/pcap/rte_eth_pcap.c | 2 ++ drivers/net/ring/rte_eth_ring.c | 2 ++ drivers/net/szedata2/rte_eth_szedata2.c | 2 ++ drivers/net/xenvirt/rte_eth_xenvirt.c | 2 ++ lib/librte_cryptodev/rte_cryptodev.c | 14 ++++++++++++++ lib/librte_cryptodev/rte_cryptodev.h | 2 ++ lib/librte_cryptodev/rte_cryptodev_pmd.h | 4 ++++ lib/librte_eal/common/eal_common_dev.c | 11 ++++++++--- lib/librte_eal/common/include/rte_dev.h | 4 ++++ 14 files changed, 52 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index d8ccf05..94752de 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -661,7 +661,9 @@ cryptodev_aesni_mb_uninit(const char *name) static struct rte_driver cryptodev_aesni_mb_pmd_drv = { .name = CRYPTODEV_NAME_AESNI_MB_PMD, +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = cryptodev_aesni_mb_init, .uninit = cryptodev_aesni_mb_uninit }; diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 767f36b..6603462 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -838,7 +838,9 @@ exit: static struct rte_driver pmd_af_packet_drv = { .name = "eth_af_packet", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_af_packet_devinit, }; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index b1373c6..d19d745 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2493,7 +2493,9 @@ bond_ethdev_configure(struct rte_eth_dev *dev) static struct rte_driver bond_drv = { .name = "eth_bond", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = bond_init, .uninit = bond_uninit, }; diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c index 35134ba..3eaf0db 100644 --- a/drivers/net/mpipe/mpipe_tilegx.c +++ b/drivers/net/mpipe/mpipe_tilegx.c @@ -1608,13 +1608,17 @@ rte_pmd_mpipe_devinit(const char *ifname, static struct rte_driver pmd_mpipe_xgbe_drv = { .name = "xgbe", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_mpipe_devinit, }; static struct rte_driver pmd_mpipe_gbe_drv = { .name = "gbe", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_mpipe_devinit, }; diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 77fc988..f5700bb 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -695,7 +695,9 @@ rte_pmd_null_devuninit(const char *name) static struct rte_driver pmd_null_drv = { .name = "eth_null", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_null_devinit, .uninit = rte_pmd_null_devuninit, }; diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index f9230eb..9ab22be 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -1092,7 +1092,9 @@ rte_pmd_pcap_devuninit(const char *name) static struct rte_driver pmd_pcap_drv = { .name = "eth_pcap", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_pcap_devinit, .uninit = rte_pmd_pcap_devuninit, }; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index d92b088..9941a1c 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -596,7 +596,9 @@ rte_pmd_ring_devuninit(const char *name) static struct rte_driver pmd_ring_drv = { .name = "eth_ring", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_ring_devinit, .uninit = rte_pmd_ring_devuninit, }; diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 9f86c99..6bbb6b0 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1616,7 +1616,9 @@ rte_pmd_szedata2_devuninit(const char *name) static struct rte_driver pmd_szedata2_drv = { .name = "eth_szedata2", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_szedata2_devinit, .uninit = rte_pmd_szedata2_devuninit, }; diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c index 3f31806..d5f3bbb 100644 --- a/drivers/net/xenvirt/rte_eth_xenvirt.c +++ b/drivers/net/xenvirt/rte_eth_xenvirt.c @@ -769,7 +769,9 @@ rte_pmd_xenvirt_devuninit(const char *name) static struct rte_driver pmd_xenvirt_drv = { .name = "eth_xenvirt", +#ifndef RTE_NEXT_ABI .type = PMD_VDEV, +#endif .init = rte_pmd_xenvirt_devinit, .uninit = rte_pmd_xenvirt_devuninit, }; diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 1950020..f499bc6 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -202,7 +202,11 @@ rte_cryptodev_find_free_device_index(void) } struct rte_cryptodev * +#ifndef RTE_NEXT_ABI rte_cryptodev_pmd_allocate(const char *name, enum pmd_type type, int socket_id) +#else +rte_cryptodev_pmd_allocate(const char *name, int socket_id) +#endif { struct rte_cryptodev *cryptodev; uint8_t dev_id; @@ -241,7 +245,9 @@ rte_cryptodev_pmd_allocate(const char *name, enum pmd_type type, int socket_id) cryptodev->data->dev_started = 0; cryptodev->attached = RTE_CRYPTODEV_ATTACHED; +#ifndef RTE_NEXT_ABI cryptodev->pmd_type = type; +#endif cryptodev_globals.nb_devs++; } @@ -290,7 +296,11 @@ rte_cryptodev_pmd_virtual_dev_init(const char *name, size_t dev_private_size, struct rte_cryptodev *cryptodev; /* allocate device structure */ +#ifndef RTE_NEXT_ABI cryptodev = rte_cryptodev_pmd_allocate(name, PMD_VDEV, socket_id); +#else + cryptodev = rte_cryptodev_pmd_allocate(name, socket_id); +#endif if (cryptodev == NULL) return NULL; @@ -332,8 +342,12 @@ rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv, rte_cryptodev_create_unique_device_name(cryptodev_name, sizeof(cryptodev_name), pci_dev); +#ifndef RTE_NEXT_ABI cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, PMD_PDEV, rte_socket_id()); +#else + cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); +#endif if (cryptodev == NULL) return -ENOMEM; diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index 892375d..4813ec1 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -471,9 +471,11 @@ struct rte_cryptodev { /**< PCI info. supplied by probing */ enum rte_cryptodev_type dev_type; +#ifndef RTE_NEXT_ABI /**< Crypto device type */ enum pmd_type pmd_type; /**< PMD type - PDEV / VDEV */ +#endif struct rte_cryptodev_cb_list link_intr_cbs; /**< User application callback for interrupts if present */ diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index 1c5ee14..4a84757 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -466,7 +466,11 @@ struct rte_cryptodev_ops { * - Slot in the rte_dev_devices array for a new device; */ struct rte_cryptodev * +#ifndef RTE_NEXT_ABI rte_cryptodev_pmd_allocate(const char *name, enum pmd_type type, int socket_id); +#else +rte_cryptodev_pmd_allocate(const char *name, int socket_id); +#endif /** * Creates a new virtual crypto device and returns the pointer diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index a8a4146..5137172 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -72,9 +72,10 @@ rte_eal_vdev_init(const char *name, const char *args) return -EINVAL; TAILQ_FOREACH(driver, &dev_driver_list, next) { +#ifndef RTE_NEXT_ABI if (driver->type != PMD_VDEV) continue; - +#endif /* * search a driver prefix in virtual device name. * For example, if the driver is pcap PMD, driver->name @@ -93,7 +94,9 @@ int rte_eal_dev_init(void) { struct rte_devargs *devargs; +#ifndef RTE_NEXT_ABI struct rte_driver *driver; +#endif /* * Note that the dev_driver_list is populated here @@ -114,7 +117,7 @@ rte_eal_dev_init(void) return -1; } } - +#ifndef RTE_NEXT_ABI /* Once the vdevs are initalized, start calling all the pdev drivers */ TAILQ_FOREACH(driver, &dev_driver_list, next) { if (driver->type != PMD_PDEV) @@ -122,6 +125,7 @@ rte_eal_dev_init(void) /* PDEV drivers don't get passed any parameters */ driver->init(NULL, NULL); } +#endif return 0; } @@ -134,9 +138,10 @@ rte_eal_vdev_uninit(const char *name) return -EINVAL; TAILQ_FOREACH(driver, &dev_driver_list, next) { +#ifndef RTE_NEXT_ABI if (driver->type != PMD_VDEV) continue; - +#endif /* * search a driver prefix in virtual device name. * For example, if the driver is pcap PMD, driver->name diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index f1b5507..88c1a19 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -114,6 +114,7 @@ typedef int (rte_dev_init_t)(const char *name, const char *args); */ typedef int (rte_dev_uninit_t)(const char *name); +#ifndef RTE_NEXT_ABI /** * Driver type enumeration */ @@ -121,13 +122,16 @@ enum pmd_type { PMD_VDEV = 0, PMD_PDEV = 1, }; +#endif /** * A structure describing a device driver. */ struct rte_driver { TAILQ_ENTRY(rte_driver) next; /**< Next in list. */ +#ifndef RTE_NEXT_ABI enum pmd_type type; /**< PMD Driver type */ +#endif const char *name; /**< Driver name. */ rte_dev_init_t *init; /**< Device init. function. */ rte_dev_uninit_t *uninit; /**< Device uninit. function. */ -- 1.9.1