Dynamic RSS Configuration for Bonding
Subsystems (2)
cover Dynamic RSS Configuration for Bonding
OVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.
Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
Tomasz Kulasek (8):
bond: dynamic rss configuration
ring: dynamic rss configuration
test: dynamic rss configuration
bond: queue stats mapping
ring: queue stats mapping set dummy implementation
examples: dynamic rss configuration for bonding
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
app/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 40 +- drivers/net/bonding/rte_eth_bond_api.c | 22 + drivers/net/bonding/rte_eth_bond_pmd.c | 222 ++++- drivers/net/bonding/rte_eth_bond_private.h | 11 + drivers/net/ring/rte_eth_ring.c | 133 ++- examples/bond_rss/Makefile | 59 ++ examples/bond_rss/bondrss.c | 293 +++++++ examples/bond_rss/bondrss.h | 163 ++++ examples/bond_rss/config.c | 251 ++++++ examples/bond_rss/ui.c | 915 ++++++++++++++++++++ 12 files changed, 2759 insertions(+), 25 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c
Signature · 1 line
1.7.9.5
PATCH 1/8 bond: dynamic rss configuration
Bonding device implements independent management of RSS settings. It stores its own copies of settings i.e. RETA, RSS hash function and RSS key. It’s required to ensure consistency.
1) RSS hash function set for bonding device is maximal set of RSS hash functions supported by all bonded devices. That mean, to have RSS support for bonding, all slaves should be RSS-capable.
2) RSS key is propagated over the slaves "as is", and is always 40 bytes long.
3) RETA for bonding is an internal table managed by bonding API, and is used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so it can be easily used as a pattern providing expected behavior, even if slaves RETA sizes are different.
--- drivers/net/bonding/rte_eth_bond_api.c | 22 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 192 ++++++++++++++++++++++++++-- drivers/net/bonding/rte_eth_bond_private.h | 11 ++ 3 files changed, 211 insertions(+), 14 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +22 -0
@@ -301,6 +301,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->active_slave_count =0 ; internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =0 ;memset (internals->active_slaves,0 ,sizeof (internals->active_slaves));memset (internals->slaves,0 ,sizeof (internals->slaves));
@@ -366,6 +367,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)memset (&dev_info,0 ,sizeof (dev_info));rte_eth_dev_info_get (slave_port_id, &dev_info); +/* We need to store slaves reta_size to be able to synchronize RETA for all +* slave devices even if its sizes are different. +*/ + internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; +if (internals->slave_count <1 ) {/* if MAC is not user defined then use MAC of first slave add to * bonded device */
@@ -379,9 +385,16 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)/* Make primary slave */ internals->primary_port = slave_port_id; +/* Inherit queues settings from first slave */ + internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + + internals->reta_size = dev_info.reta_size; +/* Take the first dev's offload capabilities */ internals->rx_offload_capa = dev_info.rx_offload_capa; internals->tx_offload_capa = dev_info.tx_offload_capa; + internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; }else {/* Check slave link properties are supported if props are set,
@@ -400,6 +413,13 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; + internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; + +/* RETA size is GCD of all slaves RETA sizes, +* so, if all sizes will be the power of 2, the lower one is GCD */ +if (internals->reta_size > dev_info.reta_size) + internals->reta_size = dev_info.reta_size; + } internals->slave_count++;
@@ -528,6 +548,8 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)if (internals->slave_count ==0 ) { internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =0 ; + internals->reta_size =0 ; }return 0 ; }
drivers/net/bonding/rte_eth_bond_pmd.c +178 -14
223 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +11 -0
@@ -103,6 +103,8 @@ struct bond_slave_details {uint8_t last_link_status;/**< Port Id of slave eth_dev */ struct ether_addr persisted_mac_addr; + +uint16_t reta_size; };
@@ -155,6 +157,15 @@ struct bond_dev_private {uint32_t rx_offload_capa;/** Rx offload capability */ uint32_t tx_offload_capa;/** Tx offload capability */ +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[512 /RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ +uint8_t rss_key_len;/**< hash key length in bytes. */ +struct rte_kvargs *kvlist;uint8_t slave_update_idx; };
Signature · 1 line
1.7.9.5
PATCH 2/8 ring: dynamic rss configuration
In reply to Tomasz KulasekThis implementation allows to set and read RSS configuration for ring device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
It have no impact on packet processing by ring device.
--- drivers/net/ring/rte_eth_ring.c | 122 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 118 insertions(+), 4 deletions(-)
drivers/net/ring/rte_eth_ring.c +118 -4
@@ -39,6 +39,7 @@#include <rte_string_fns.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_spinlock.h> #define ETH_RING_NUMA_NODE_ACTION_ARG "nodeaction"#define ETH_RING_ACTION_CREATE "CREATE"
@@ -66,6 +67,17 @@ struct pmd_internals {struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS ];struct ether_addr address; + +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +rte_spinlock_t rss_lock; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ };
@@ -173,6 +185,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; + dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; + dev_info->reta_size =ETH_RSS_RETA_SIZE_128 ; } static void
@@ -234,6 +248,93 @@ static int eth_link_update(struct rte_eth_dev *dev __rte_unused, int wait_to_complete __rte_unused) { return 0; } +static int +eth_rss_reta_update (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf, +uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { + internal->reta_conf[i].mask = reta_conf[i].mask; +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + internal->reta_conf[i].reta[j] = reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_reta_query (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf, +uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size)return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + reta_conf[i].reta[j] = internal->reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_update (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key !=NULL ) +memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key !=NULL ) +memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -250,6 +351,10 @@ static const struct eth_dev_ops ops = { .stats_reset = eth_stats_reset, .mac_addr_remove = eth_mac_addr_remove, .mac_addr_add = eth_mac_addr_add, + .reta_update = eth_rss_reta_update, + .reta_query = eth_rss_reta_query, + .rss_hash_update = eth_rss_hash_update, + .rss_hash_conf_get = eth_rss_hash_conf_get };int
@@ -268,6 +373,13 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],unsigned i; +static const uint8_t default_rss_key[40 ] = { +0x6D ,0x5A ,0x56 ,0xDA ,0x25 ,0x5B ,0x0E ,0xC2 ,0x41 ,0x67 ,0x25 ,0x3D , +0x43 ,0xA3 ,0x8F ,0xB0 ,0xD0 ,0xCA ,0x2B ,0xCB ,0xAE ,0x7B ,0x30 ,0xB4 , +0x77 ,0xCB ,0x2D ,0xA3 ,0x80 ,0x30 ,0xF2 ,0x0C ,0x6A ,0x42 ,0xB7 ,0x3B , +0xBE ,0xAC ,0x01 ,0xFA + }; +/* do some parameter checking */ if (rx_queues ==NULL && nb_rx_queues >0 ) goto error;
@@ -316,12 +428,14 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], internals->nb_rx_queues = nb_rx_queues; internals->nb_tx_queues = nb_tx_queues; -for (i =0 ; i < nb_rx_queues; i++) { +for (i =0 ; i < nb_rx_queues; i++) internals->rx_ring_queues[i].rng = rx_queues[i]; - } -for (i =0 ; i < nb_tx_queues; i++) { +for (i =0 ; i < nb_tx_queues; i++) internals->tx_ring_queues[i].rng = tx_queues[i]; - } + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =ETH_RSS_RETA_SIZE_128 ; + +memcpy (internals->rss_key, default_rss_key,40 ); eth_drv->pci_drv.name = ring_ethdev_driver_name; eth_drv->pci_drv.id_table = id_table;
Signature · 1 line
1.7.9.5
PATCH 3/8 test: dynamic rss configuration
In reply to Tomasz KulasekThis test module uses ring device to check right RSS configuration propagation.
1) Propagation test
a) Set RSS hash function for bonding, fetch RSS hash function from bonded slave, check if same. Do it for all slaves.
b) Repeat above for RSS key and RETA.
2)Dynamic adding slave to the bonding
a) Remove slave from bonding.
b) Change its configuration to other than bonding.
c) Add slave to the started bonding device.
d) Check if slaves configuration changed.
3) Repeat point 1) and 2) with RSS multi-queue mode enabled/disabled for bonding port.
--- app/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++++++++++++++++++++++ 2 files changed, 675 insertions(+) create mode 100644 app/test/test_link_bonding_rssconf.c
app/test/Makefile +1 -0
@@ -134,6 +134,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c endif SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
app/test/test_link_bonding_rssconf.c new file +674 -0
674 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 4/8 bond: queue stats mapping
In reply to Tomasz KulasekQueue stats mapping is used in example application. This patch adds propagation of mapping over the slaves, and fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +29 -1
@@ -1766,7 +1766,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)struct bond_dev_private *internals = dev->data->dev_private;struct rte_eth_stats slave_stats; -int i; +int i, j;/* clear bonded stats before populating from slaves */ memset (stats,0 ,sizeof (*stats));
@@ -1788,6 +1788,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + +for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_ipackets[j]; + stats->q_ibytes[j] += slave_stats.q_ipackets[j]; + stats->q_obytes[j] += slave_stats.q_ipackets[j]; + stats->q_errors[j] += slave_stats.q_ipackets[j]; + } + } }
@@ -2090,6 +2099,24 @@ bond_ethdev_rss_hash_conf_get(struct rte_eth_dev *dev,return 0 ; } +static int +bond_ethdev_queue_stats_mapping_set (struct rte_eth_dev *dev, +uint16_t queue_id,uint8_t stat_idx,uint8_t is_rx) +{ +int i; +struct bond_dev_private *internals = dev->data->dev_private; + +for (i =0 ; i < internals->slave_count; i++) +if (is_rx) +rte_eth_dev_set_rx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); +else +rte_eth_dev_set_tx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); + +return 0 ; +} +struct eth_dev_ops default_dev_ops = { .dev_start = bond_ethdev_start, .dev_stop = bond_ethdev_stop,
@@ -2103,6 +2130,7 @@ struct eth_dev_ops default_dev_ops = { .link_update = bond_ethdev_link_update, .stats_get = bond_ethdev_stats_get, .stats_reset = bond_ethdev_stats_reset, + .queue_stats_mapping_set = bond_ethdev_queue_stats_mapping_set, .promiscuous_enable = bond_ethdev_promiscuous_enable, .promiscuous_disable = bond_ethdev_promiscuous_disable, .reta_update = bond_ethdev_rss_reta_update,
Signature · 1 line
1.7.9.5
PATCH 5/8 ring: queue stats mapping set dummy implementation
In reply to Tomasz KulasekPer queue statistics are already implemented for ring device, but with static mapping (stat_idx == queue_id).
This fix is required, if you want to use ring device in test application and is used only to point that per queue statistics are provided for this device.
--- drivers/net/ring/rte_eth_ring.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ring/rte_eth_ring.c +11 -0
@@ -335,6 +335,16 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev,return 0 ; } +static int +eth_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, + __rte_unused uint8_t stat_idx, + __rte_unused uint8_t is_rx) +{ +/* Do nothing, just return ok */ +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -347,6 +357,7 @@ static const struct eth_dev_ops ops = { .rx_queue_release = eth_queue_release, .tx_queue_release = eth_queue_release, .link_update = eth_link_update, + .queue_stats_mapping_set = eth_queue_stats_mapping_set, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, .mac_addr_remove = eth_mac_addr_remove,
Signature · 1 line
1.7.9.5
PATCH 6/8 examples: dynamic rss configuration for bonding
In reply to Tomasz KulasekThis application allows you to test RSS configuration for bonded devices changing configuration dynamically, during receiving packets on slaves and observe the changes in its distribution over queues.
After initialization process, all accessible ports are attached to one bonding as slaves.
Monitor screen is divided into five main parts:
- Port selection (on the very top)
- RSS Configuration for selected port including hash function, key and RETA
- Incoming packets statistics
- Incoming packets list for selected port
- Status bar with contextual information about selected part
--- examples/bond_rss/Makefile | 59 +++ examples/bond_rss/bondrss.c | 293 ++++++++++++++ examples/bond_rss/bondrss.h | 163 ++++++++ examples/bond_rss/config.c | 251 ++++++++++++ examples/bond_rss/ui.c | 915 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1681 insertions(+) create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c
examples/bond_rss/Makefile new file +59 -0
@@ -0,0 +1,59 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ifeq ($(RTE_SDK),) +$(error "Please define RTE_SDK environment variable") +endif + +# Default target, can be overridden by command line or environment +RTE_TARGET ?= x86_64-native-linuxapp-gcc + +include $(RTE_SDK)/mk/rte.vars.mk + +# binary name +APP = bondrss + +# all source are stored in SRCS-y +SRCS-y := bondrss.c +SRCS-y += ui.c +SRCS-y += config.c + +CFLAGS += $(WERROR_FLAGS) + +# workaround for a gcc bug with noreturn attribute +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +CFLAGS_main.o += -Wno-return-type +endif + +LDLIBS += -lncurses + +include $(RTE_SDK)/mk/rte.extapp.mk
examples/bond_rss/bondrss.c new file +293 -0
293 lines not on this page · raw message
examples/bond_rss/bondrss.h new file +163 -0
163 lines not on this page · raw message
examples/bond_rss/config.c new file +251 -0
251 lines not on this page · raw message
examples/bond_rss/ui.c new file +915 -0
915 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 7/8 doc: fixed spellings and typos
In reply to Tomasz Kulasek--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +4 -4
@@ -188,7 +188,7 @@ conditions are not met. If a user wishes to monitor individual slaves then they must register callbacks with that slave directly. The link bonding library also supports devices which do not implement link -status change interrupts, this is achieve by polling the devices link status at +status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` API, the default polling interval is 10ms. When a device is added as a slave to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
@@ -286,7 +286,7 @@ and UDP protocols for load balancing. Using Link Bonding Devices -------------------------- -The librte_pmd_bond library support two modes of device creation, the libraries +The librte_pmd_bond library supports two modes of device creation, the libraries export full C API or using the EAL command line to statically configure link bonding devices at application startup. Using the EAL option it is possible to use link bonding functionality transparently without specific knowledge of the
@@ -299,7 +299,7 @@ Using the Poll Mode Driver from an Application Using the librte_pmd_bond libraries API it is possible to dynamically create and manage link bonding device from within any application. Link bonding -device are created using the ``rte_eth_bond_create`` API which requires a +devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the link bonding mode to initial the device in and finally the socket Id which to allocate the devices resources onto. After successful creation of a bonding device it must be configured using the generic Ethernet
@@ -362,7 +362,7 @@ The different options are: mode=2 * slave: Defines the PMD device which will be added as slave to the bonded - device. This option can be selected multiple time, for each device to be + device. This option can be selected multiple times, for each device to be added as a slave. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function
Signature · 1 line
1.7.9.5
PATCH 8/8 doc: dynamic rss configuration for bonding
In reply to Tomasz KulasekDocumentation update about implementation details and requirements for Dynamic RSS Configuration for Bonding.
--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 32 ++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +30 -2
@@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,27 @@ After a slave device is added to a bonded device slave is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding -device. +device. If RSS is enabled for bonding device, this mode is also enabled on new +slave and configured as well. + +Setting up multi-queue mode for bonding device to RSS, makes it fully +RSS-capable, so all slaves are synchronized with its configuration. This mode is +intended to provide RSS configuration on slaves transparent for client +application implementation. + +Bonding device stores its own version of RSS settings i.e. RETA, RSS hash +function and RSS key, used to set up its slaves. That let to define the meaning +of RSS configuration of bonding device as desired configuration of whole bonding +(as one unit), without pointing any of slave inside. It is required to ensure +consistency and made it more errorproof. + +RSS hash function set for bonding device, is a maximal set of RSS hash functions +supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if slave +RETAs' sizes are different. RSS key is always 40 bytes long. + +All settings are managed through the bonding port API and always are propagated +in one direction (from bonding to slaves). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +227,14 @@ these parameters. A bonding device must have a minimum of one slave before the bonding device itself can be started. +To use a bonding device dynamic RSS configuration feature effectively, it is +also required, that all slaves should be RSS-capable and support, at least one +common hash function available for each of them. + +To prevent inconsistency on how slaves process packets, once a device is added +to a bonding device, RSS configuration should be managed through the bonding +device API, and not directly on the slave. + Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object.
Signature · 1 line
1.7.9.5
- Tested Commit: 1a1109404e702d3ad1ccc1033df55c59bec1f89a + PATCH
- OS: Linux dpdk-fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb]
- NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:1583]
- Default x86_64-native-linuxapp-gcc configuration
- Total 4 cases, 2 passed, 2 failed. Niantic NIC case all passed, but Fortville NIC case all failed.
First case:
This is a unit test case, not need NIC
1. build dpdk driver and insmod driver
2. set 1024*2M hugepage
3. compile test app in app/test
4. run test
./test -c f -n 4
5. exec dynamic rss confif unit test
link_bonding_rssconf_autotest
6. print "test ok"
7. this case passed
Second case:
This is a function test case, used Fortville NIC(8086:1583)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i --txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 --txq=4
5. exec testpmd cmd
a) create bonded device 0 0
b) add bonding slave 0 3
c) add bonding slave 1 3
d) port start 3
port can start, and link stats is down, so this case failed.
Thirdly case:
This is a function test case, used Fortville NIC(8086:1583)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i --txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 --txq=4
5. exec testpmd cmd
a) create bonded device 0 0
b) add bonding slave 0 3
c) add bonding slave 1 3
d) port config all rss ip
e) show port 3 rss-hash
printf:
RSS functions:
ipv4-frag ipv4-other ipv6-frag ipv6-other
f) show port 0 rss-hash
printf:
RSS disabled
Slave rss not enable, so this case failed
Fourthly case:
This is a function test case, used Niantic NIC(8086:10fb)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i --txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 --txq=4
5. exec testpmd cmd
a) create bonded device 0 0
b) add bonding slave 0 3
c) add bonding slave 1 3
d) port start 3
e) port stop all
f) set verbose 8
g) set fwd rxonly
h) set stat_qmap 3 0 0
i) set stat_qmap 3 1 1
j) set stat_qmap 3 1 1
k) set stat_qmap 3 1 1
l) port config all rss ip
m) port start all
n)start
6. send 50 ip packages to salve 0 by ixia, the package config as below
a) dst mac: bond device (port 3) mac address.
b) src mac: 00:00:00:12:34:56
c) package type:0800
e) dst ip: 192.168.1.1
f) src ip: from 192.168.1.2 to 192.168.1.51, one package, this ip add 1
7. stop
Port 3 queue 0 received 9 packages
Port 3 queue 1 received 9 packages
Port 3 queue 2 received 16 packages
Port 3 queue 3 received 16 packages
8. send 50 ip packages to slave 1 by ixia, the package config as same
9. stop and check port 3 received packages again
Form slave 0 and slave 1 the rss are some, the test passed
Quoted 63 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Kulasek
Sent: Wednesday, June 03, 2015 6:59 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH 0/8] Dynamic RSS Configuration for BondingOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding
device fully RSS-capable, so all slaves are synchronized with its configuration.
This mode is intended to provide RSS configuration as known from "dynamic RSS
configuration for one port" and made slaves transparent for client application
implementation.2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not
synchronized. That provides an ability to configure them manually. This mode may
be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is
used to do it.Tomasz Kulasek (8):
bond: dynamic rss configuration
ring: dynamic rss configuration
test: dynamic rss configuration
bond: queue stats mapping
ring: queue stats mapping set dummy implementation
examples: dynamic rss configuration for bonding
doc: fixed spellings and typos
doc: dynamic rss configuration for bondingapp/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 40 +- drivers/net/bonding/rte_eth_bond_api.c | 22 + drivers/net/bonding/rte_eth_bond_pmd.c | 222 ++++- drivers/net/bonding/rte_eth_bond_private.h | 11 + drivers/net/ring/rte_eth_ring.c | 133 ++- examples/bond_rss/Makefile | 59 ++ examples/bond_rss/bondrss.c | 293 +++++++ examples/bond_rss/bondrss.h | 163 ++++ examples/bond_rss/config.c | 251 ++++++ examples/bond_rss/ui.c | 915 ++++++++++++++++++++ 12 files changed, 2759 insertions(+), 25 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c--
1.7.9.5
Kulasek, TomaszX
Tested-by huilong xuThere's a bug in bonding itself, which prevents the bonding, made of Fortville NICs, start and is not related to Dynamic RSS Configuration.
This problem solves separate patch "bond: fix check initial link status of slave".
-----Original Message-----
From: Xu, HuilongX
Sent: Friday, June 12, 2015 07:36
To: Kulasek, TomaszX; [email protected]
Subject: RE: [dpdk-dev] [PATCH 0/8] Dynamic RSS Configuration for Bonding
- Tested Commit: 1a1109404e702d3ad1ccc1033df55c59bec1f89a + PATCH
- OS: Linux dpdk-fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb]
- NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:1583]
- Default x86_64-native-linuxapp-gcc configuration
- Total 4 cases, 2 passed, 2 failed. Niantic NIC case all passed, but Fortville NIC case all failed.
First case:
This is a unit test case, not need NIC
1. build dpdk driver and insmod driver
2. set 1024*2M hugepage
3. compile test app in app/test
4. run test
./test -c f -n 4
5. exec dynamic rss confif unit test
link_bonding_rssconf_autotest
6. print "test ok"
7. this case passed
Second case:
This is a function test case, used Fortville NIC(8086:1583)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i --txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 --txq=4
5. exec testpmd cmd
a) create bonded device 0 0
b) add bonding slave 0 3
c) add bonding slave 1 3
d) port start 3
port can start, and link stats is down, so this case failed.
Thirdly case:
This is a function test case, used Fortville NIC(8086:1583)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i --txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 --txq=4
5. exec testpmd cmd
a) create bonded device 0 0
b) add bonding slave 0 3
c) add bonding slave 1 3
d) port config all rss ip
e) show port 3 rss-hash
printf:
RSS functions:
ipv4-frag ipv4-other ipv6-frag ipv6-other
f) show port 0 rss-hash
printf:
RSS disabled
Slave rss not enable, so this case failed
Fourthly case:
This is a function test case, used Niantic NIC(8086:10fb)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i --txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 --txq=4
5. exec testpmd cmd
a) create bonded device 0 0
b) add bonding slave 0 3
c) add bonding slave 1 3
d) port start 3
e) port stop all
f) set verbose 8
g) set fwd rxonly
h) set stat_qmap 3 0 0
i) set stat_qmap 3 1 1
j) set stat_qmap 3 1 1
k) set stat_qmap 3 1 1
l) port config all rss ip
m) port start all
n)start
6. send 50 ip packages to salve 0 by ixia, the package config as below
a) dst mac: bond device (port 3) mac address.
b) src mac: 00:00:00:12:34:56
c) package type:0800
e) dst ip: 192.168.1.1
f) src ip: from 192.168.1.2 to 192.168.1.51, one package, this ip add 1
7. stop
Port 3 queue 0 received 9 packages
Port 3 queue 1 received 9 packages
Port 3 queue 2 received 16 packages
Port 3 queue 3 received 16 packages
8. send 50 ip packages to slave 1 by ixia, the package config as same
9. stop and check port 3 received packages again
Form slave 0 and slave 1 the rss are some, the test passed
Quoted 57 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Kulasek
Sent: Wednesday, June 03, 2015 6:59 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH 0/8] Dynamic RSS Configuration for BondingOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding device fully RSS-capable, so all slaves are synchronized with its configuration.
This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
Tomasz Kulasek (8):
bond: dynamic rss configuration
ring: dynamic rss configuration
test: dynamic rss configuration
bond: queue stats mapping
ring: queue stats mapping set dummy implementation
examples: dynamic rss configuration for bonding
doc: fixed spellings and typos
doc: dynamic rss configuration for bondingapp/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 40 +- drivers/net/bonding/rte_eth_bond_api.c | 22 + drivers/net/bonding/rte_eth_bond_pmd.c | 222 ++++- drivers/net/bonding/rte_eth_bond_private.h | 11 + drivers/net/ring/rte_eth_ring.c | 133 ++- examples/bond_rss/Makefile | 59 ++ examples/bond_rss/bondrss.c | 293 +++++++ examples/bond_rss/bondrss.h | 163 ++++ examples/bond_rss/config.c | 251 ++++++ examples/bond_rss/ui.c | 915 ++++++++++++++++++++ 12 files changed, 2759 insertions(+), 25 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 examples/bond_rss/Makefile create mode 100644
examples/bond_rss/bondrss.ccreate mode 100644examples/bond_rss/bondrss.hcreate mode 100644examples/bond_rss/config.ccreate mode 100644examples/bond_rss/ui.c--
1.7.9.5
v2 cover Dynamic RSS Configuration for Bonding
In reply to Tomasz KulasekOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.
Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v2 changes:
- added support for keys other than 40 bytes long,
- now, if RSS key is not set for bonding, it is not set also for slaves,
- fix - full initial RSS configuration before any slave is added was not possible due to the initially zeroed flow_type_rss_offloads for bonding,
- fix - changed error to warning when slave is synchronizing due to the bonding's initial configuration (to allow use slaves' drivers not supporting dynamic RSS configuration in bonding),
- some code cleanups,
- updated documentation,
Tomasz Kulasek (8):
bond: rss dynamic configuration
ring: dynamic rss configuration
test: dynamic rss configuration
bond: queue stats mapping
ring: queue stats mapping set dummy implementation
examples: dynamic rss configuration for bonding
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
app/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 27 + drivers/net/bonding/rte_eth_bond_pmd.c | 239 ++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/ring/rte_eth_ring.c | 133 ++- examples/bond_rss/Makefile | 59 ++ examples/bond_rss/bondrss.c | 293 +++++++ examples/bond_rss/bondrss.h | 163 ++++ examples/bond_rss/config.c | 251 ++++++ examples/bond_rss/ui.c | 920 ++++++++++++++++++++ 12 files changed, 2789 insertions(+), 25 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c
Signature · 1 line
1.7.9.5
PATCH v2 1/8 bond: rss dynamic configuration
Bonding device implements independent management of RSS settings. It stores its own copies of settings i.e. RETA, RSS hash function and RSS key. It’s required to ensure consistency.
1) RSS hash function set for bonding device is maximal set of RSS hash functions supported by all bonded devices. That mean, to have RSS support for bonding, all slaves should be RSS-capable.
2) RSS key is propagated over the slaves "as is".
3) RETA for bonding is an internal table managed by bonding API, and is used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so it can be easily used as a pattern providing expected behavior, even if slaves RETA sizes are different.
--- drivers/net/bonding/rte_eth_bond_api.c | 27 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 209 ++++++++++++++++++++++++++-- drivers/net/bonding/rte_eth_bond_private.h | 12 ++ 3 files changed, 234 insertions(+), 14 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +27 -0
@@ -302,6 +302,9 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; +/* Initially allow to choose any offload type */ + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; +memset (internals->active_slaves,0 ,sizeof (internals->active_slaves));memset (internals->slaves,0 ,sizeof (internals->slaves));
@@ -365,6 +368,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)rte_eth_dev_info_get (slave_port_id, &dev_info); +/* We need to store slaves reta_size to be able to synchronize RETA for all +* slave devices even if its sizes are different. +*/ + internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; +if (internals->slave_count <1 ) {/* if MAC is not user defined then use MAC of first slave add to * bonded device */
@@ -378,9 +386,16 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)/* Make primary slave */ internals->primary_port = slave_port_id; +/* Inherit queues settings from first slave */ + internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + + internals->reta_size = dev_info.reta_size; +/* Take the first dev's offload capabilities */ internals->rx_offload_capa = dev_info.rx_offload_capa; internals->tx_offload_capa = dev_info.tx_offload_capa; + internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; }else {/* Check slave link properties are supported if props are set,
@@ -399,8 +414,18 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; + internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; + +/* RETA size is GCD of all slaves RETA sizes, +* so, if all sizes will be the power of 2, the lower one is GCD */ +if (internals->reta_size > dev_info.reta_size) + internals->reta_size = dev_info.reta_size; + } + bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= + internals->flow_type_rss_offloads; + internals->slave_count++;/* Update all slave devices MACs*/
@@ -527,6 +552,8 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)if (internals->slave_count ==0 ) { internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =0 ; }return 0 ; }
drivers/net/bonding/rte_eth_bond_pmd.c +195 -14
240 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +12 -0
@@ -103,6 +103,8 @@ struct bond_slave_details {uint8_t last_link_status;/**< Port Id of slave eth_dev */ struct ether_addr persisted_mac_addr; + +uint16_t reta_size; };
@@ -155,6 +157,16 @@ struct bond_dev_private {uint32_t rx_offload_capa;/** Rx offload capability */ uint32_t tx_offload_capa;/** Tx offload capability */ +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_512 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[52 ];/**< 52-byte hash key buffer. */ +uint8_t rss_key_len;/**< hash key length in bytes. */ +struct rte_kvargs *kvlist;uint8_t slave_update_idx; };
Signature · 1 line
1.7.9.5
PATCH v2 2/8 ring: dynamic rss configuration
In reply to Tomasz KulasekThis implementation allows to set and read RSS configuration for ring device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
It have no impact on packet processing by ring device.
--- drivers/net/ring/rte_eth_ring.c | 122 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 118 insertions(+), 4 deletions(-)
drivers/net/ring/rte_eth_ring.c +118 -4
@@ -39,6 +39,7 @@#include <rte_string_fns.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_spinlock.h> #define ETH_RING_NUMA_NODE_ACTION_ARG "nodeaction"#define ETH_RING_ACTION_CREATE "CREATE"
@@ -66,6 +67,17 @@ struct pmd_internals {struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS ];struct ether_addr address; + +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +rte_spinlock_t rss_lock; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ };
@@ -173,6 +185,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; + dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; + dev_info->reta_size = internals->reta_size; } static void
@@ -234,6 +248,93 @@ static int eth_link_update(struct rte_eth_dev *dev __rte_unused, int wait_to_complete __rte_unused) { return 0; } +static int +eth_rss_reta_update (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf, +uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { + internal->reta_conf[i].mask = reta_conf[i].mask; +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + internal->reta_conf[i].reta[j] = reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_reta_query (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf, +uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size)return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + reta_conf[i].reta[j] = internal->reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_update (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key !=NULL ) +memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key !=NULL ) +memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -250,6 +351,10 @@ static const struct eth_dev_ops ops = { .stats_reset = eth_stats_reset, .mac_addr_remove = eth_mac_addr_remove, .mac_addr_add = eth_mac_addr_add, + .reta_update = eth_rss_reta_update, + .reta_query = eth_rss_reta_query, + .rss_hash_update = eth_rss_hash_update, + .rss_hash_conf_get = eth_rss_hash_conf_get };int
@@ -268,6 +373,13 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],unsigned i; +static const uint8_t default_rss_key[40 ] = { +0x6D ,0x5A ,0x56 ,0xDA ,0x25 ,0x5B ,0x0E ,0xC2 ,0x41 ,0x67 ,0x25 ,0x3D , +0x43 ,0xA3 ,0x8F ,0xB0 ,0xD0 ,0xCA ,0x2B ,0xCB ,0xAE ,0x7B ,0x30 ,0xB4 , +0x77 ,0xCB ,0x2D ,0xA3 ,0x80 ,0x30 ,0xF2 ,0x0C ,0x6A ,0x42 ,0xB7 ,0x3B , +0xBE ,0xAC ,0x01 ,0xFA + }; +/* do some parameter checking */ if (rx_queues ==NULL && nb_rx_queues >0 ) goto error;
@@ -316,12 +428,14 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], internals->nb_rx_queues = nb_rx_queues; internals->nb_tx_queues = nb_tx_queues; -for (i =0 ; i < nb_rx_queues; i++) { +for (i =0 ; i < nb_rx_queues; i++) internals->rx_ring_queues[i].rng = rx_queues[i]; - } -for (i =0 ; i < nb_tx_queues; i++) { +for (i =0 ; i < nb_tx_queues; i++) internals->tx_ring_queues[i].rng = tx_queues[i]; - } + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ; + +memcpy (internals->rss_key, default_rss_key,40 ); eth_drv->pci_drv.name = ring_ethdev_driver_name; eth_drv->pci_drv.id_table = id_table;
Signature · 1 line
1.7.9.5
PATCH v2 3/8 test: dynamic rss configuration
In reply to Tomasz KulasekThis test module uses ring device to check right RSS configuration propagation.
1) Propagation test
a) Set RSS hash function for bonding, fetch RSS hash function from bonded slave, check if same. Do it for all slaves.
b) Repeat above for RSS key and RETA.
2)Dynamic adding slave to the bonding
a) Remove slave from bonding.
b) Change its configuration to other than bonding.
c) Add slave to the started bonding device.
d) Check if slaves configuration changed.
3) Repeat point 1) and 2) with RSS multi-queue mode enabled/disabled for bonding port.
--- app/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++++++++++++++++++++++ 2 files changed, 675 insertions(+) create mode 100644 app/test/test_link_bonding_rssconf.c
app/test/Makefile +1 -0
@@ -135,6 +135,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c endif SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
app/test/test_link_bonding_rssconf.c new file +674 -0
674 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 4/8 bond: queue stats mapping
In reply to Tomasz KulasekQueue stats mapping is used in example application. This patch adds propagation of mapping over the slaves, and fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +29 -1
@@ -1774,7 +1774,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) {struct bond_dev_private *internals = dev->data->dev_private;struct rte_eth_stats slave_stats; -int i; +int i, j;for (i =0 ; i < internals->slave_count; i++) {rte_eth_stats_get (internals->slaves[i].port_id, &slave_stats);
@@ -1793,6 +1793,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + +for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_ipackets[j]; + stats->q_ibytes[j] += slave_stats.q_ipackets[j]; + stats->q_obytes[j] += slave_stats.q_ipackets[j]; + stats->q_errors[j] += slave_stats.q_ipackets[j]; + } + } }
@@ -2103,6 +2112,24 @@ bond_ethdev_rss_hash_conf_get(struct rte_eth_dev *dev,return 0 ; } +static int +bond_ethdev_queue_stats_mapping_set (struct rte_eth_dev *dev, +uint16_t queue_id,uint8_t stat_idx,uint8_t is_rx) +{ +int i; +struct bond_dev_private *internals = dev->data->dev_private; + +for (i =0 ; i < internals->slave_count; i++) +if (is_rx) +rte_eth_dev_set_rx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); +else +rte_eth_dev_set_tx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); + +return 0 ; +} +struct eth_dev_ops default_dev_ops = { .dev_start = bond_ethdev_start, .dev_stop = bond_ethdev_stop,
@@ -2116,6 +2143,7 @@ struct eth_dev_ops default_dev_ops = { .link_update = bond_ethdev_link_update, .stats_get = bond_ethdev_stats_get, .stats_reset = bond_ethdev_stats_reset, + .queue_stats_mapping_set = bond_ethdev_queue_stats_mapping_set, .promiscuous_enable = bond_ethdev_promiscuous_enable, .promiscuous_disable = bond_ethdev_promiscuous_disable, .reta_update = bond_ethdev_rss_reta_update,
Signature · 1 line
1.7.9.5
PATCH v2 5/8 ring: queue stats mapping set dummy implementation
In reply to Tomasz KulasekPer queue statistics are already implemented for ring device, but with static mapping (stat_idx == queue_id).
This fix is required, if you want to use ring device in test application and is used only to point that per queue statistics are provided for this device.
--- drivers/net/ring/rte_eth_ring.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ring/rte_eth_ring.c +11 -0
@@ -335,6 +335,16 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev,return 0 ; } +static int +eth_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, + __rte_unused uint8_t stat_idx, + __rte_unused uint8_t is_rx) +{ +/* Do nothing, just return ok */ +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -347,6 +357,7 @@ static const struct eth_dev_ops ops = { .rx_queue_release = eth_queue_release, .tx_queue_release = eth_queue_release, .link_update = eth_link_update, + .queue_stats_mapping_set = eth_queue_stats_mapping_set, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, .mac_addr_remove = eth_mac_addr_remove,
Signature · 1 line
1.7.9.5
PATCH v2 6/8 examples: dynamic rss configuration for bonding
In reply to Tomasz KulasekThis application allows you to test RSS configuration for bonded devices changing configuration dynamically, during receiving packets on slaves and observe the changes in its distribution over queues.
After initialization process, all accessible ports are attached to one bonding as slaves.
Monitor screen is divided into five main parts:
- Port selection (on the very top)
- RSS Configuration for selected port including hash function, key and RETA
- Incoming packets statistics
- Incoming packets list for selected port
- Status bar with contextual information about selected part
--- examples/bond_rss/Makefile | 59 +++ examples/bond_rss/bondrss.c | 293 ++++++++++++++ examples/bond_rss/bondrss.h | 163 ++++++++ examples/bond_rss/config.c | 251 ++++++++++++ examples/bond_rss/ui.c | 920 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1686 insertions(+) create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c
examples/bond_rss/Makefile new file +59 -0
@@ -0,0 +1,59 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ifeq ($(RTE_SDK),) +$(error "Please define RTE_SDK environment variable") +endif + +# Default target, can be overridden by command line or environment +RTE_TARGET ?= x86_64-native-linuxapp-gcc + +include $(RTE_SDK)/mk/rte.vars.mk + +# binary name +APP = bondrss + +# all source are stored in SRCS-y +SRCS-y := bondrss.c +SRCS-y += ui.c +SRCS-y += config.c + +CFLAGS += $(WERROR_FLAGS) + +# workaround for a gcc bug with noreturn attribute +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +CFLAGS_main.o += -Wno-return-type +endif + +LDLIBS += -lncurses + +include $(RTE_SDK)/mk/rte.extapp.mk
examples/bond_rss/bondrss.c new file +293 -0
293 lines not on this page · raw message
examples/bond_rss/bondrss.h new file +163 -0
163 lines not on this page · raw message
examples/bond_rss/config.c new file +251 -0
251 lines not on this page · raw message
examples/bond_rss/ui.c new file +920 -0
920 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 7/8 doc: fixed spellings and typos
In reply to Tomasz Kulasek--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +4 -4
@@ -188,7 +188,7 @@ conditions are not met. If a user wishes to monitor individual slaves then they must register callbacks with that slave directly. The link bonding library also supports devices which do not implement link -status change interrupts, this is achieve by polling the devices link status at +status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` API, the default polling interval is 10ms. When a device is added as a slave to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
@@ -286,7 +286,7 @@ and UDP protocols for load balancing. Using Link Bonding Devices -------------------------- -The librte_pmd_bond library support two modes of device creation, the libraries +The librte_pmd_bond library supports two modes of device creation, the libraries export full C API or using the EAL command line to statically configure link bonding devices at application startup. Using the EAL option it is possible to use link bonding functionality transparently without specific knowledge of the
@@ -299,7 +299,7 @@ Using the Poll Mode Driver from an Application Using the librte_pmd_bond libraries API it is possible to dynamically create and manage link bonding device from within any application. Link bonding -device are created using the ``rte_eth_bond_create`` API which requires a +devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the link bonding mode to initial the device in and finally the socket Id which to allocate the devices resources onto. After successful creation of a bonding device it must be configured using the generic Ethernet
@@ -362,7 +362,7 @@ The different options are: mode=2 * slave: Defines the PMD device which will be added as slave to the bonded - device. This option can be selected multiple time, for each device to be + device. This option can be selected multiple times, for each device to be added as a slave. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function
Signature · 1 line
1.7.9.5
PATCH v2 8/8 doc: dynamic rss configuration for bonding
In reply to Tomasz KulasekDocumentation update about implementation details and requirements for Dynamic RSS Configuration for Bonding.
--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +32 -2
@@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,28 @@ After a slave device is added to a bonded device slave is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding -device. +device. If RSS is enabled for bonding device, this mode is also enabled on new +slave and configured as well. + +Setting up multi-queue mode for bonding device to RSS, makes it fully +RSS-capable, so all slaves are synchronized with its configuration. This mode is +intended to provide RSS configuration on slaves transparent for client +application implementation. + +Bonding device stores its own version of RSS settings i.e. RETA, RSS hash +function and RSS key, used to set up its slaves. That let to define the meaning +of RSS configuration of bonding device as desired configuration of whole bonding +(as one unit), without pointing any of slave inside. It is required to ensure +consistency and made it more errorproof. + +RSS hash function set for bonding device, is a maximal set of RSS hash functions +supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if slave +RETAs' sizes are different. If RSS Key is not set for bonded device, it's not +changed on the slaves and default key for device is used. + +All settings are managed through the bonding port API and always are propagated +in one direction (from bonding to slaves). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +228,15 @@ these parameters. A bonding device must have a minimum of one slave before the bonding device itself can be started. +To use a bonding device dynamic RSS configuration feature effectively, it is +also required, that all slaves should be RSS-capable and support, at least one +common hash function available for each of them. Changing RSS key is only +possible, when all slave devices support the same key size. + +To prevent inconsistency on how slaves process packets, once a device is added +to a bonding device, RSS configuration should be managed through the bonding +device API, and not directly on the slave. + Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object.
Signature · 1 line
1.7.9.5
Quoted 65 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Kulasek
Sent: Friday, June 19, 2015 7:13 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 0/8] Dynamic RSS Configuration for BondingOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding
device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v2 changes:
- added support for keys other than 40 bytes long,
- now, if RSS key is not set for bonding, it is not set also for slaves,
- fix - full initial RSS configuration before any slave is added was not possible due to the initially zeroedflow_type_rss_offloadsfor bonding,
- fix - changed error to warning when slave is synchronizing due to the bonding's initial configuration (to allow use slaves' drivers not supporting dynamic RSS configuration in bonding),
- some code cleanups,
- updated documentation,Tomasz Kulasek (8):
bond: rss dynamic configuration
ring: dynamic rss configuration
test: dynamic rss configuration
bond: queue stats mapping
ring: queue stats mapping set dummy implementation
examples: dynamic rss configuration for bonding
doc: fixed spellings and typos
doc: dynamic rss configuration for bondingapp/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 27 + drivers/net/bonding/rte_eth_bond_pmd.c | 239 ++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/ring/rte_eth_ring.c | 133 ++- examples/bond_rss/Makefile | 59 ++ examples/bond_rss/bondrss.c | 293 +++++++ examples/bond_rss/bondrss.h | 163 ++++ examples/bond_rss/config.c | 251 ++++++ examples/bond_rss/ui.c | 920 ++++++++++++++++++++ 12 files changed, 2789 insertions(+), 25 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c
Quoted 2 lines
--
1.7.9.5
2015-06-26 07:33, Doherty, Declan:
Quoted 3 lines
From: dev [mailto:[email protected]] On Behalf Of Tomasz Kulasek
Acked-by Declan Doherty <[email protected]>
Please use checkpatch to fix formatting.
v3 cover Dynamic RSS Configuration for Bonding
In reply to Tomasz KulasekOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.
Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v3 changes:
- checkpatch cleanups
v2 changes:
- added support for keys other than 40 bytes long,
- now, if RSS key is not set for bonding, it is not set also for slaves,
- fix - full initial RSS configuration before any slave is added was not possible due to the initially zeroed flow_type_rss_offloads for bonding,
- fix - changed error to warning when slave is synchronizing due to the bonding's initial configuration (to allow use slaves' drivers not supporting dynamic RSS configuration in bonding),
- some code cleanups,
- updated documentation,
Tomasz Kulasek (8):
bonding: rss dynamic configuration
ring: dynamic rss configuration
test: dynamic rss configuration
bonding: queue stats mapping
ring: queue stats mapping set dummy implementation
examples: dynamic rss configuration for bonding
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
app/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 28 + drivers/net/bonding/rte_eth_bond_pmd.c | 235 ++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/ring/rte_eth_ring.c | 130 ++- examples/bond_rss/Makefile | 59 ++ examples/bond_rss/bondrss.c | 293 ++++++ examples/bond_rss/bondrss.h | 163 ++++ examples/bond_rss/config.c | 251 ++++++ examples/bond_rss/ui.c | 945 ++++++++++++++++++++ 12 files changed, 2808 insertions(+), 25 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c
Signature · 1 line
1.7.9.5
PATCH v3 1/8 bonding: rss dynamic configuration
Bonding device implements independent management of RSS settings. It stores its own copies of settings i.e. RETA, RSS hash function and RSS key. It’s required to ensure consistency.
1) RSS hash function set for bonding device is maximal set of RSS hash functions supported by all bonded devices. That mean, to have RSS support for bonding, all slaves should be RSS-capable.
2) RSS key is propagated over the slaves "as is".
3) RETA for bonding is an internal table managed by bonding API, and is used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so it can be easily used as a pattern providing expected behavior, even if slaves RETA sizes are different.
--- drivers/net/bonding/rte_eth_bond_api.c | 28 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 205 ++++++++++++++++++++++++++-- drivers/net/bonding/rte_eth_bond_private.h | 12 ++ 3 files changed, 231 insertions(+), 14 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +28 -0
@@ -303,6 +303,9 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; +/* Initially allow to choose any offload type */ + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; +memset (internals->active_slaves,0 ,sizeof (internals->active_slaves));memset (internals->slaves,0 ,sizeof (internals->slaves));
@@ -366,6 +369,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)rte_eth_dev_info_get (slave_port_id, &dev_info); +/* We need to store slaves reta_size to be able to synchronize RETA for all +* slave devices even if its sizes are different. +*/ + internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; +if (internals->slave_count <1 ) {/* if MAC is not user defined then use MAC of first slave add to * bonded device */
@@ -379,9 +387,16 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)/* Make primary slave */ internals->primary_port = slave_port_id; +/* Inherit queues settings from first slave */ + internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + + internals->reta_size = dev_info.reta_size; +/* Take the first dev's offload capabilities */ internals->rx_offload_capa = dev_info.rx_offload_capa; internals->tx_offload_capa = dev_info.tx_offload_capa; + internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; }else {/* Check slave link properties are supported if props are set,
@@ -400,8 +415,19 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; + internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; + +/* RETA size is GCD of all slaves RETA sizes, so, if all sizes will be +* the power of 2, the lower one is GCD +*/ +if (internals->reta_size > dev_info.reta_size) + internals->reta_size = dev_info.reta_size; + } + bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= + internals->flow_type_rss_offloads; + internals->slave_count++;/* Update all slave devices MACs*/
@@ -528,6 +554,8 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)if (internals->slave_count ==0 ) { internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =0 ; }return 0 ; }
drivers/net/bonding/rte_eth_bond_pmd.c +191 -14
236 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +12 -0
@@ -103,6 +103,8 @@ struct bond_slave_details {uint8_t last_link_status;/**< Port Id of slave eth_dev */ struct ether_addr persisted_mac_addr; + +uint16_t reta_size; };
@@ -155,6 +157,16 @@ struct bond_dev_private {uint32_t rx_offload_capa;/** Rx offload capability */ uint32_t tx_offload_capa;/** Tx offload capability */ +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_512 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[52 ];/**< 52-byte hash key buffer. */ +uint8_t rss_key_len;/**< hash key length in bytes. */ +struct rte_kvargs *kvlist;uint8_t slave_update_idx; };
Signature · 1 line
1.7.9.5
PATCH v3 2/8 ring: dynamic rss configuration
In reply to Tomasz KulasekThis implementation allows to set and read RSS configuration for ring device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
It have no impact on packet processing by ring device.
--- drivers/net/ring/rte_eth_ring.c | 120 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 4 deletions(-)
drivers/net/ring/rte_eth_ring.c +116 -4
@@ -39,6 +39,7 @@#include <rte_string_fns.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_spinlock.h> #define ETH_RING_NUMA_NODE_ACTION_ARG "nodeaction"#define ETH_RING_ACTION_CREATE "CREATE"
@@ -66,6 +67,17 @@ struct pmd_internals {struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS ];struct ether_addr address; + +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +rte_spinlock_t rss_lock; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ };
@@ -173,6 +185,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; + dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; + dev_info->reta_size = internals->reta_size; } static void
@@ -234,6 +248,91 @@ static int eth_link_update(struct rte_eth_dev *dev __rte_unused, int wait_to_complete __rte_unused) { return 0; } +static int +eth_rss_reta_update (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { + internal->reta_conf[i].mask = reta_conf[i].mask; +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + internal->reta_conf[i].reta[j] = reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_reta_query (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + reta_conf[i].reta[j] = internal->reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_update (struct rte_eth_dev *dev,struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key) +memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key) +memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -250,6 +349,10 @@ static const struct eth_dev_ops ops = { .stats_reset = eth_stats_reset, .mac_addr_remove = eth_mac_addr_remove, .mac_addr_add = eth_mac_addr_add, + .reta_update = eth_rss_reta_update, + .reta_query = eth_rss_reta_query, + .rss_hash_update = eth_rss_hash_update, + .rss_hash_conf_get = eth_rss_hash_conf_get };int
@@ -268,6 +371,13 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],unsigned i; +static const uint8_t default_rss_key[40 ] = { +0x6D ,0x5A ,0x56 ,0xDA ,0x25 ,0x5B ,0x0E ,0xC2 ,0x41 ,0x67 ,0x25 ,0x3D , +0x43 ,0xA3 ,0x8F ,0xB0 ,0xD0 ,0xCA ,0x2B ,0xCB ,0xAE ,0x7B ,0x30 ,0xB4 , +0x77 ,0xCB ,0x2D ,0xA3 ,0x80 ,0x30 ,0xF2 ,0x0C ,0x6A ,0x42 ,0xB7 ,0x3B , +0xBE ,0xAC ,0x01 ,0xFA + }; +/* do some parameter checking */ if (rx_queues ==NULL && nb_rx_queues >0 ) goto error;
@@ -316,12 +426,14 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], internals->nb_rx_queues = nb_rx_queues; internals->nb_tx_queues = nb_tx_queues; -for (i =0 ; i < nb_rx_queues; i++) { +for (i =0 ; i < nb_rx_queues; i++) internals->rx_ring_queues[i].rng = rx_queues[i]; - } -for (i =0 ; i < nb_tx_queues; i++) { +for (i =0 ; i < nb_tx_queues; i++) internals->tx_ring_queues[i].rng = tx_queues[i]; - } + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ; + +memcpy (internals->rss_key, default_rss_key,40 ); eth_drv->pci_drv.name = ring_ethdev_driver_name; eth_drv->pci_drv.id_table = id_table;
Signature · 1 line
1.7.9.5
Re: [PATCH v3 2/8] ring: dynamic rss configuration
2015-06-29 16:50, Tomasz Kulasek:
Quoted 5 lines
This implementation allows to set and read RSS configuration for ring device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
It have no impact on packet processing by ring device.
Adding some fake RSS to the ring PMD (in order to test bonding) is weird. The ring PMD is not a driver for testing. Maybe that the null PMD would be more appropriate.
By the way the current RSS implementation is really bound to Intel devices. Before applying it to more drivers, we have to make sure it is generic enough. Maybe the RETA needs more abstraction.
Re: [PATCH v3 2/8] ring: dynamic rss configuration
Quoted 14 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Monday, July 13, 2015 14:36
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 2/8] ring: dynamic rss configuration2015-06-29 16:50, Tomasz Kulasek:
Quoted 5 lines
This implementation allows to set and read RSS configuration for ring device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
It have no impact on packet processing by ring device.
Quoted 7 lines
Adding some fake RSS to the ring PMD (in order to test bonding) is weird. The ring PMD is not a driver for testing. Maybe that the null PMD would be more appropriate.
By the way the current RSS implementation is really bound to Intel devices.
Before applying it to more drivers, we have to make sure it is generic enough. Maybe the RETA needs more abstraction.
This is not RSS implementation, but implementation of Dynamic RSS Configuration, already existing, and well defined in official documentation for single port. I don't know where you see bounding to Intel device. It's an implementation of official API.
Anyway I will appreciate for any comment and opinion on that and clarification what means more RETA abstraction in context of official API.
I will check the possibility of moving it to the null pmd driver and will prepare new version for easier reviewing. Meantime I'm waiting for more opinions.
Re: [PATCH v3 2/8] ring: dynamic rss configuration
2015-07-13 14:43, Kulasek, TomaszX:
Quoted 16 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 7 lines
2015-06-29 16:50, Tomasz Kulasek:
Quoted 5 lines
This implementation allows to set and read RSS configuration for ring device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
It have no impact on packet processing by ring device.
Quoted 7 lines
Adding some fake RSS to the ring PMD (in order to test bonding) is weird. The ring PMD is not a driver for testing. Maybe that the null PMD would be more appropriate.
By the way the current RSS implementation is really bound to Intel devices.
Before applying it to more drivers, we have to make sure it is generic enough. Maybe the RETA needs more abstraction.
Quoted 5 lines
This is not RSS implementation, but implementation of Dynamic RSS Configuration, already existing, and well defined in official documentation for single port.
I don't know where you see bounding to Intel device.
It's an implementation of official API.
What do you mean by "official"?
My concern is that the RSS API in ethdev comes from a time where DPDK was Intel DPDK. I may be wrong but I think that other devices could need something more generic and better defined.
Quoted 6 lines
Anyway I will appreciate for any comment and opinion on that and clarification what means more RETA abstraction in context of official API.
I will check the possibility of moving it to the null pmd driver and will prepare new version for easier reviewing. Meantime I'm waiting for more opinions.
Exact, we need more opinions on this topic.
Re: [PATCH v3 2/8] ring: dynamic rss configuration
Quoted 38 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Monday, July 13, 2015 17:11
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 2/8] ring: dynamic rss configuration2015-07-13 14:43, Kulasek, TomaszX:
Quoted 9 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 8 lines
2015-06-29 16:50, Tomasz Kulasek:
Quoted 5 lines
This implementation allows to set and read RSS configuration for ring device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
It have no impact on packet processing by ring device.
Adding some fake RSS to the ring PMD (in order to test bonding) is
weird.
Quoted 7 lines
Quoted 6 lines
The ring PMD is not a driver for testing. Maybe that the null PMD would be more appropriate.
By the way the current RSS implementation is really bound to Intel devices.
Before applying it to more drivers, we have to make sure it is generic enough. Maybe the RETA needs more abstraction.Quoted 5 lines
This is not RSS implementation, but implementation of Dynamic RSS Configuration, already existing, and well defined in official documentation for single port.
I don't know where you see bounding to Intel device. It's an implementation of official API.What do you mean by "official"?
My concern is that the RSS API in ethdev comes from a time where DPDK was Intel DPDK. I may be wrong but I think that other devices could need something more generic and better defined.Quoted 2 lines
Anyway I will appreciate for any comment and opinion on that and clarification what means more RETA abstraction in context of official
Quoted 7 lines
API.
Quoted 4 lines
I will check the possibility of moving it to the null pmd driver and will prepare new version for easier reviewing. Meantime I'm waiting for more opinions.
Exact, we need more opinions on this topic.
Hi Thomas,
I have fixed the error with wrong copy/paste. Also I changed usage of ring pmd with null pmd like you suggested. You are right, it is better place. Thanks.
I sent a v4 patch-set.
This implementation is using an existing ethdev API for RSS and introduces generic enhancements for configuration of bonding slaves. If other devices need a more generic ethdev API then this should be treated separately and they can submit separate patches for this in a future release.
PATCH v3 3/8 test: dynamic rss configuration
In reply to Tomasz KulasekThis test module uses ring device to check right RSS configuration propagation.
1) Propagation test
a) Set RSS hash function for bonding, fetch RSS hash function from bonded slave, check if same. Do it for all slaves.
b) Repeat above for RSS key and RETA.
2)Dynamic adding slave to the bonding
a) Remove slave from bonding.
b) Change its configuration to other than bonding.
c) Add slave to the started bonding device.
d) Check if slaves configuration changed.
3) Repeat point 1) and 2) with RSS multi-queue mode enabled/disabled for bonding port.
--- app/test/Makefile | 1 + app/test/test_link_bonding_rssconf.c | 674 ++++++++++++++++++++++++++++++++++ 2 files changed, 675 insertions(+) create mode 100644 app/test/test_link_bonding_rssconf.c
app/test/Makefile +1 -0
@@ -136,6 +136,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c endif SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
app/test/test_link_bonding_rssconf.c new file +674 -0
674 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v3 4/8 bonding: queue stats mapping
In reply to Tomasz KulasekQueue stats mapping is used in example application. This patch adds propagation of mapping over the slaves, and fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +29 -1
@@ -1783,7 +1783,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) {struct bond_dev_private *internals = dev->data->dev_private;struct rte_eth_stats slave_stats; -int i; +int i, j;for (i =0 ; i < internals->slave_count; i++) {rte_eth_stats_get (internals->slaves[i].port_id, &slave_stats);
@@ -1802,6 +1802,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + +for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_ipackets[j]; + stats->q_ibytes[j] += slave_stats.q_ipackets[j]; + stats->q_obytes[j] += slave_stats.q_ipackets[j]; + stats->q_errors[j] += slave_stats.q_ipackets[j]; + } + } }
@@ -2110,6 +2119,24 @@ bond_ethdev_rss_hash_conf_get(struct rte_eth_dev *dev,return 0 ; } +static int +bond_ethdev_queue_stats_mapping_set (struct rte_eth_dev *dev,uint16_t queue_id, +uint8_t stat_idx,uint8_t is_rx) +{ +int i; +struct bond_dev_private *internals = dev->data->dev_private; + +for (i =0 ; i < internals->slave_count; i++) +if (is_rx) +rte_eth_dev_set_rx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); +else +rte_eth_dev_set_tx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); + +return 0 ; +} +struct eth_dev_ops default_dev_ops = { .dev_start = bond_ethdev_start, .dev_stop = bond_ethdev_stop,
@@ -2123,6 +2150,7 @@ struct eth_dev_ops default_dev_ops = { .link_update = bond_ethdev_link_update, .stats_get = bond_ethdev_stats_get, .stats_reset = bond_ethdev_stats_reset, + .queue_stats_mapping_set = bond_ethdev_queue_stats_mapping_set, .promiscuous_enable = bond_ethdev_promiscuous_enable, .promiscuous_disable = bond_ethdev_promiscuous_disable, .reta_update = bond_ethdev_rss_reta_update,
Signature · 1 line
1.7.9.5
Re: [PATCH v3 4/8] bonding: queue stats mapping
2015-06-29 16:50, Tomasz Kulasek:
drivers/net/bonding/rte_eth_bond_pmd.c bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) · line 1811
Quoted 6 lines
drivers/net/bonding/rte_eth_bond_pmd.c +6
-0+for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_ipackets[j]; + stats->q_ibytes[j] += slave_stats.q_ipackets[j]; + stats->q_obytes[j] += slave_stats.q_ipackets[j]; + stats->q_errors[j] += slave_stats.q_ipackets[j];
Wrong copy/paste.
Re: [PATCH v3 4/8] bonding: queue stats mapping
Quoted 9 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Monday, July 13, 2015 13:18
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 4/8] bonding: queue stats mapping2015-06-29 16:50, Tomasz Kulasek:
Quoted 8 lines
drivers/net/bonding/rte_eth_bond_pmd.c bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) · line 1811
Quoted 6 lines
drivers/net/bonding/rte_eth_bond_pmd.c +6
-0+for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_ipackets[j]; + stats->q_ibytes[j] += slave_stats.q_ipackets[j]; + stats->q_obytes[j] += slave_stats.q_ipackets[j]; + stats->q_errors[j] += slave_stats.q_ipackets[j];Wrong copy/paste.
Ok, my fault, sorry. I'll fix it.
PATCH v3 5/8 ring: queue stats mapping set dummy implementation
In reply to Tomasz KulasekPer queue statistics are already implemented for ring device, but with static mapping (stat_idx == queue_id).
This fix is required, if you want to use ring device in test application and is used only to point that per queue statistics are provided for this device.
--- drivers/net/ring/rte_eth_ring.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ring/rte_eth_ring.c +10 -0
@@ -333,6 +333,15 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev,return 0 ; } +static int +eth_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, __rte_unused uint8_t stat_idx, + __rte_unused uint8_t is_rx) +{ +/* Do nothing, just return ok */ +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -345,6 +354,7 @@ static const struct eth_dev_ops ops = { .rx_queue_release = eth_queue_release, .tx_queue_release = eth_queue_release, .link_update = eth_link_update, + .queue_stats_mapping_set = eth_queue_stats_mapping_set, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, .mac_addr_remove = eth_mac_addr_remove,
Signature · 1 line
1.7.9.5
Re: [PATCH v3 5/8] ring: queue stats mapping set dummy implementation
2015-06-29 16:50, Tomasz Kulasek:
Quoted 8 lines
Per queue statistics are already implemented for ring device, but with static mapping (
stat_idx==queue_id).This fix is required, if you want to use ring device in test application and is used only to point that per queue statistics are provided for this device.
Signed-off-by Tomasz Kulasek <[email protected]>
[...]
drivers/net/ring/rte_eth_ring.c eth_rss_hash_conf_get(struct rte_eth_dev *dev, · line 343
Quoted 8 lines
drivers/net/ring/rte_eth_ring.c +8
-0+static int +eth_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, __rte_unused uint8_t stat_idx, + __rte_unused uint8_t is_rx) +{ +/* Do nothing, just return ok */ +return 0 ; +}
I've just realized how this is broken.
Some Intel devices use a mapping to select hardware queues which will have some stats. But we may have stats per queues without requiring such mapping.
I may miss something but I suggest these 3 actions:
- remove this patch
- replace checks on stats_mapping by an ethdev flag
- remove device-specific stats_mapping from ethdev
Re: [PATCH v3 5/8] ring: queue stats mapping set dummy implementation
Quoted 31 lines
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, July 9, 2015 03:58
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 5/8] ring: queue stats mapping set dummy implementation2015-06-29 16:50, Tomasz Kulasek:
Quoted 8 lines
Per queue statistics are already implemented for ring device, but with static mapping (
stat_idx==queue_id).This fix is required, if you want to use ring device in test application and is used only to point that per queue statistics are provided for this device.
Signed-off-by Tomasz Kulasek <[email protected]>[...]
drivers/net/ring/rte_eth_ring.c eth_rss_hash_conf_get(struct rte_eth_dev *dev, · line 343
Quoted 8 lines
drivers/net/ring/rte_eth_ring.c +8
-0+static int +eth_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, __rte_unused uint8_t stat_idx, + __rte_unused uint8_t is_rx) +{ +/* Do nothing, just return ok */ +return 0 ; +}I've just realized how this is broken.
Some Intel devices use a mapping to select hardware queues which will have some stats. But we may have stats per queues without requiring such mapping.
Quoted 4 lines
I may miss something but I suggest these 3 actions:
- remove this patch
- replace checks onstats_mappingby an ethdev flag
- remove device-specificstats_mappingfrom ethdev
For Niantic NICs all queues stats for port are mapped to stats_idx=0 by default, and stats mapping is required to have per-queue statistics (even in testpmd).
Anyway, this patch, for ring pmd, was intended more as a cleanup than feature and was inspired by implementation in virtio driver:
virtio_ethdev.c:
/*
* It enables testpmd to collect per queue stats.
*/
static int
virtio_dev_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *eth_dev,
__rte_unused uint16_t queue_id, __rte_unused uint8_t stat_idx,
__rte_unused uint8_t is_rx)
{
return 0;
}This patch can be safely removed, if you think such a cleanup is not required, or lack of this implementation should be common behavior for this case. That will cause only few more warning messages, if you want to use ring pmd as a slave in example application.
Do you need v4?
Re: [PATCH v3 5/8] ring: queue stats mapping set dummy implementation
2015-07-09 09:55, Kulasek, TomaszX:
Quoted 39 lines
Quoted 31 lines
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, July 9, 2015 03:58
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 5/8] ring: queue stats mapping set dummy implementation2015-06-29 16:50, Tomasz Kulasek:
Quoted 8 lines
Per queue statistics are already implemented for ring device, but with static mapping (
stat_idx==queue_id).This fix is required, if you want to use ring device in test application and is used only to point that per queue statistics are provided for this device.
Signed-off-by Tomasz Kulasek <[email protected]>[...]
drivers/net/ring/rte_eth_ring.c eth_rss_hash_conf_get(struct rte_eth_dev *dev, · line 343
Quoted 8 lines
drivers/net/ring/rte_eth_ring.c +8
-0+static int +eth_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, __rte_unused uint8_t stat_idx, + __rte_unused uint8_t is_rx) +{ +/* Do nothing, just return ok */ +return 0 ; +}I've just realized how this is broken.
Some Intel devices use a mapping to select hardware queues which will have some stats. But we may have stats per queues without requiring such mapping.Quoted 4 lines
I may miss something but I suggest these 3 actions:
- remove this patch
- replace checks onstats_mappingby an ethdev flag
- remove device-specificstats_mappingfrom ethdevFor Niantic NICs all queues stats for port are mapped to stats_idx=0 by default, and stats mapping is required to have per-queue statistics (even in testpmd).
Quoted 7 lines
Anyway, this patch, for ring pmd, was intended more as a cleanup than feature and was inspired by implementation in virtio driver:
virtio_ethdev.c:/* * It enables testpmd to collect per queue stats. */
It should be removed in virtio.
Quoted 10 lines
static int virtio_dev_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *eth_dev, __rte_unused uint16_t queue_id, __rte_unused uint8_t stat_idx, __rte_unused uint8_t is_rx) { return 0; }This patch can be safely removed, if you think such a cleanup is not required,
OK
Quoted 5 lines
or lack of this implementation should be common behavior for this case. That will cause only few more warning messages, if you want to use ring pmd as a slave in example application.
Do you need v4?
No, thank you
PATCH v3 6/8 examples: dynamic rss configuration for bonding
In reply to Tomasz KulasekThis application allows you to test RSS configuration for bonded devices changing configuration dynamically, during receiving packets on slaves and observe the changes in its distribution over queues.
After initialization process, all accessible ports are attached to one bonding as slaves.
Monitor screen is divided into five main parts:
- Port selection (on the very top)
- RSS Configuration for selected port including hash function, key and RETA
- Incoming packets statistics
- Incoming packets list for selected port
- Status bar with contextual information about selected part
--- examples/bond_rss/Makefile | 59 +++ examples/bond_rss/bondrss.c | 293 ++++++++++++++ examples/bond_rss/bondrss.h | 163 ++++++++ examples/bond_rss/config.c | 251 ++++++++++++ examples/bond_rss/ui.c | 945 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1711 insertions(+) create mode 100644 examples/bond_rss/Makefile create mode 100644 examples/bond_rss/bondrss.c create mode 100644 examples/bond_rss/bondrss.h create mode 100644 examples/bond_rss/config.c create mode 100644 examples/bond_rss/ui.c
examples/bond_rss/Makefile new file +59 -0
@@ -0,0 +1,59 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ifeq ($(RTE_SDK),) +$(error "Please define RTE_SDK environment variable") +endif + +# Default target, can be overridden by command line or environment +RTE_TARGET ?= x86_64-native-linuxapp-gcc + +include $(RTE_SDK)/mk/rte.vars.mk + +# binary name +APP = bondrss + +# all source are stored in SRCS-y +SRCS-y := bondrss.c +SRCS-y += ui.c +SRCS-y += config.c + +CFLAGS += $(WERROR_FLAGS) + +# workaround for a gcc bug with noreturn attribute +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) +CFLAGS_main.o += -Wno-return-type +endif + +LDLIBS += -lncurses + +include $(RTE_SDK)/mk/rte.extapp.mk
examples/bond_rss/bondrss.c new file +293 -0
293 lines not on this page · raw message
examples/bond_rss/bondrss.h new file +163 -0
163 lines not on this page · raw message
examples/bond_rss/config.c new file +251 -0
251 lines not on this page · raw message
examples/bond_rss/ui.c new file +945 -0
945 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Re: [PATCH v3 6/8] examples: dynamic rss configuration for bonding
2015-06-29 16:50, Tomasz Kulasek:
Quoted 15 lines
This application allows you to test RSS configuration for bonded devices changing configuration dynamically, during receiving packets on slaves and observe the changes in its distribution over queues.
After initialization process, all accessible ports are attached to one bonding as slaves.
Monitor screen is divided into five main parts:
- Port selection (on the very top)
- RSS Configuration for selected port including hash function, key and RETA
- Incoming packets statistics
- Incoming packets list for selected port
- Status bar with contextual information about selected part
Quoted 8 lines
Signed-off-by Tomasz Kulasek <[email protected]>--- examples/bond_rss/Makefile | 59 +++ examples/bond_rss/bondrss.c | 293 ++++++++++++++ examples/bond_rss/bondrss.h | 163 ++++++++ examples/bond_rss/config.c | 251 ++++++++++++ examples/bond_rss/ui.c | 945 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1711 insertions(+)
This new example is not added in examples/Makefile. It introduces a new dependency (ncurses).
Examples are useful to show how to use some features. Maybe you can show bonding RSS in the existing bonding example without adding bells and whistles. The example directory must be kept reasonnably maintainable.
REJECTED
PATCH v3 7/8 doc: fixed spellings and typos
In reply to Tomasz Kulasek--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +4 -4
@@ -188,7 +188,7 @@ conditions are not met. If a user wishes to monitor individual slaves then they must register callbacks with that slave directly. The link bonding library also supports devices which do not implement link -status change interrupts, this is achieve by polling the devices link status at +status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` API, the default polling interval is 10ms. When a device is added as a slave to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
@@ -286,7 +286,7 @@ and UDP protocols for load balancing. Using Link Bonding Devices -------------------------- -The librte_pmd_bond library support two modes of device creation, the libraries +The librte_pmd_bond library supports two modes of device creation, the libraries export full C API or using the EAL command line to statically configure link bonding devices at application startup. Using the EAL option it is possible to use link bonding functionality transparently without specific knowledge of the
@@ -299,7 +299,7 @@ Using the Poll Mode Driver from an Application Using the librte_pmd_bond libraries API it is possible to dynamically create and manage link bonding device from within any application. Link bonding -device are created using the ``rte_eth_bond_create`` API which requires a +devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the link bonding mode to initial the device in and finally the socket Id which to allocate the devices resources onto. After successful creation of a bonding device it must be configured using the generic Ethernet
@@ -362,7 +362,7 @@ The different options are: mode=2 * slave: Defines the PMD device which will be added as slave to the bonded - device. This option can be selected multiple time, for each device to be + device. This option can be selected multiple times, for each device to be added as a slave. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function
Signature · 1 line
1.7.9.5
PATCH v3 8/8 doc: dynamic rss configuration for bonding
In reply to Tomasz KulasekDocumentation update about implementation details and requirements for Dynamic RSS Configuration for Bonding.
--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +32 -2
@@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,28 @@ After a slave device is added to a bonded device slave is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding -device. +device. If RSS is enabled for bonding device, this mode is also enabled on new +slave and configured as well. + +Setting up multi-queue mode for bonding device to RSS, makes it fully +RSS-capable, so all slaves are synchronized with its configuration. This mode is +intended to provide RSS configuration on slaves transparent for client +application implementation. + +Bonding device stores its own version of RSS settings i.e. RETA, RSS hash +function and RSS key, used to set up its slaves. That let to define the meaning +of RSS configuration of bonding device as desired configuration of whole bonding +(as one unit), without pointing any of slave inside. It is required to ensure +consistency and made it more errorproof. + +RSS hash function set for bonding device, is a maximal set of RSS hash functions +supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if slave +RETAs' sizes are different. If RSS Key is not set for bonded device, it's not +changed on the slaves and default key for device is used. + +All settings are managed through the bonding port API and always are propagated +in one direction (from bonding to slaves). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +228,15 @@ these parameters. A bonding device must have a minimum of one slave before the bonding device itself can be started. +To use a bonding device dynamic RSS configuration feature effectively, it is +also required, that all slaves should be RSS-capable and support, at least one +common hash function available for each of them. Changing RSS key is only +possible, when all slave devices support the same key size. + +To prevent inconsistency on how slaves process packets, once a device is added +to a bonding device, RSS configuration should be managed through the bonding +device API, and not directly on the slave. + Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object.
Signature · 1 line
1.7.9.5
Quoted 19 lines · Tomasz Kulasek
OVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v3 changes:
- checkpatch cleanups
...
Quoted 1 line
2015-07-01 11:05, Declan Doherty:
Quoted 18 lines · Tomasz Kulasek
Quoted 17 lines
OVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
Quoted 5 lines
Quoted 2 lines
v3 changes:
- checkpatch cleanups...
Acked-by Declan Doherty <[email protected]>
Applied without patches 5 and 6:
- As discussed earlier, patch 5 workaround a missing flag to announce stats per queue availability.
- Patch 6 introduce a new dependency (ncurses) to build a new bond_rss example. Examples are useful to show how to use some features. Maybe you can show bonding RSS in the existing bonding example without adding bells and whistles. The example directory must be kept reasonnably maintainable.
2015-07-13 13:03, Thomas Monjalon:
Quoted 19 lines
2015-07-01 11:05, Declan Doherty:
Quoted 18 lines · Tomasz Kulasek
Quoted 17 lines
OVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
v3 changes:
- checkpatch cleanups...
Acked-by Declan Doherty <[email protected]>Applied without patches 5 and 6:
Sorry, after more review, this series won't be pushed at all. There is an obvious error in patch 4, and patch 2/3 must be discussed.
Quoted 7 lines
- As discussed earlier, patch 5 workaround a missing flag to announce stats per queue availability.
- Patch 6 introduce a new dependency (ncurses) to build a new
bond_rssexample. Examples are useful to show how to use some features. Maybe you can show bonding RSS in the existing bonding example without adding bells and whistles. The example directory must be kept reasonnably maintainable.
Quoted 33 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Monday, July 13, 2015 13:18
To: Kulasek, TomaszX
Cc: [email protected]; Doherty, Declan
Subject: Re: [dpdk-dev] [PATCH v3 0/8] Dynamic RSS Configuration for Bonding2015-07-13 13:03, Thomas Monjalon:
Quoted 6 lines
2015-07-01 11:05, Declan Doherty:
Quoted 5 lines · Tomasz Kulasek
Quoted 4 lines
OVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding device fully RSS-capable, so all slaves aresynchronized with its configuration.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSSconfiguration for slaves isn't required.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Turning on/off RSS mode for slaves when bonding is started is not
possible.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v3 changes:
- checkpatch cleanups
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
...
Acked-by Declan Doherty <[email protected]>Applied without patches 5 and 6:
Sorry, after more review, this series won't be pushed at all. There is an obvious error in patch 4, and patch 2/3 must be discussed.
What's wrong with patches 2/3? Some details?
Quoted 11 lines
Quoted 5 lines
- As discussed earlier, patch 5 workaround a missing flag to announce stats per queue availability.
- Patch 6 introduce a new dependency (ncurses) to build a new
bond_rssexample.
Quoted 2 lines
Examples are useful to show how to use some features. Maybe you can show bonding RSS in the existing bonding example without adding bells
and whistles.
Quoted 1 line
The example directory must be kept reasonnably maintainable.
Ok. I understand that. This application was created to help me in development process and using ncurses made it a lot easier. The intention wasn't "adding bells and whistles" but made it usable in dynamic environment.
v4 cover Dynamic RSS Configuration for Bonding
In reply to Tomasz KulasekOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.
Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v4 changes:
- fixed copy-paste error,
- removed example application as too complex and introducing a new dependency,
- addapted null pmd to be used as testing device for dynamic RSS configuration,
- addapted test units to use null pmd instead of ring pmd,
- ring pmd is not used and changed in this patchset,
Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault when null_pmd added to bonding
null: extend number of virtual queues
null: virtual dynamic rss configuration
null: export eth_dev_null_create
test: dynamic rss configuration
bonding: queue stats mapping
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
app/test/Makefile | 8 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 28 + drivers/net/bonding/rte_eth_bond_pmd.c | 239 ++++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 142 +++- drivers/net/null/rte_eth_null.h | 40 ++ drivers/net/null/rte_pmd_null_version.map | 7 + 10 files changed, 1170 insertions(+), 29 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 drivers/net/null/rte_eth_null.h
Signature · 1 line
1.7.9.5
PATCH v4 1/9 bonding: rss dynamic configuration
Bonding device implements independent management of RSS settings. It stores its own copies of settings i.e. RETA, RSS hash function and RSS key. It’s required to ensure consistency.
1) RSS hash function set for bonding device is maximal set of RSS hash functions supported by all bonded devices. That mean, to have RSS support for bonding, all slaves should be RSS-capable.
2) RSS key is propagated over the slaves "as is".
3) RETA for bonding is an internal table managed by bonding API, and is used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so it can be easily used as a pattern providing expected behavior, even if slaves RETA sizes are different.
--- drivers/net/bonding/rte_eth_bond_api.c | 28 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 205 ++++++++++++++++++++++++++-- drivers/net/bonding/rte_eth_bond_private.h | 12 ++ 3 files changed, 231 insertions(+), 14 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +28 -0
@@ -303,6 +303,9 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; +/* Initially allow to choose any offload type */ + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; +memset (internals->active_slaves,0 ,sizeof (internals->active_slaves));memset (internals->slaves,0 ,sizeof (internals->slaves));
@@ -366,6 +369,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)rte_eth_dev_info_get (slave_port_id, &dev_info); +/* We need to store slaves reta_size to be able to synchronize RETA for all +* slave devices even if its sizes are different. +*/ + internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; +if (internals->slave_count <1 ) {/* if MAC is not user defined then use MAC of first slave add to * bonded device */
@@ -379,9 +387,16 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)/* Make primary slave */ internals->primary_port = slave_port_id; +/* Inherit queues settings from first slave */ + internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + + internals->reta_size = dev_info.reta_size; +/* Take the first dev's offload capabilities */ internals->rx_offload_capa = dev_info.rx_offload_capa; internals->tx_offload_capa = dev_info.tx_offload_capa; + internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; }else {/* Check slave link properties are supported if props are set,
@@ -400,8 +415,19 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; + internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; + +/* RETA size is GCD of all slaves RETA sizes, so, if all sizes will be +* the power of 2, the lower one is GCD +*/ +if (internals->reta_size > dev_info.reta_size) + internals->reta_size = dev_info.reta_size; + } + bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= + internals->flow_type_rss_offloads; + internals->slave_count++;/* Update all slave devices MACs*/
@@ -528,6 +554,8 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)if (internals->slave_count ==0 ) { internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =0 ; }return 0 ; }
drivers/net/bonding/rte_eth_bond_pmd.c +191 -14
236 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +12 -0
@@ -103,6 +103,8 @@ struct bond_slave_details {uint8_t last_link_status;/**< Port Id of slave eth_dev */ struct ether_addr persisted_mac_addr; + +uint16_t reta_size; };
@@ -155,6 +157,16 @@ struct bond_dev_private {uint32_t rx_offload_capa;/** Rx offload capability */ uint32_t tx_offload_capa;/** Tx offload capability */ +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_512 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[52 ];/**< 52-byte hash key buffer. */ +uint8_t rss_key_len;/**< hash key length in bytes. */ +struct rte_kvargs *kvlist;uint8_t slave_update_idx; };
Signature · 1 line
1.7.9.5
PATCH v4 2/9 null: fix segfault when null_pmd added to bonding
In reply to Tomasz KulasekWhen device is added to the bonding, the link status callback is added to the slave's eth_dev->link_intr_cbs list. This list is not initialized for null pmd and adding it to the bonding segfaults application.
This patch allocates and sets up required structures.
--- drivers/net/null/rte_eth_null.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/null/rte_eth_null.c +11 -0
@@ -386,6 +386,7 @@ eth_dev_null_create(const char *name,const unsigned nb_rx_queues =1 ;const unsigned nb_tx_queues =1 ;struct rte_eth_dev_data *data =NULL ; +struct eth_driver *eth_drv =NULL ;struct rte_pci_device *pci_dev =NULL ;struct pmd_internals *internals =NULL ;struct rte_eth_dev *eth_dev =NULL ;
@@ -416,6 +417,10 @@ eth_dev_null_create(const char *name,if (eth_dev ==NULL ) goto error; + eth_drv =rte_zmalloc_socket (name,sizeof (*eth_drv),0 , numa_node); +if (!eth_drv) + goto error; +/* now put it all together * - store queue data in internals, * - store numa_node info in pci_driver
@@ -431,7 +436,10 @@ eth_dev_null_create(const char *name, internals->packet_copy = packet_copy; internals->numa_node = numa_node; + eth_drv->pci_drv.name = drivername; + pci_dev->numa_node = numa_node; + pci_dev->driver = ð_drv->pci_drv; data->dev_private = internals; data->port_id = eth_dev->data->port_id;
@@ -445,6 +453,7 @@ eth_dev_null_create(const char *name, eth_dev->dev_ops = &ops; eth_dev->pci_dev = pci_dev; eth_dev->driver = &rte_null_pmd; +TAILQ_INIT (ð_dev->link_intr_cbs);/* finally assign rx and tx ops */ if (packet_copy) {
@@ -461,6 +470,8 @@ error:rte_free (data);rte_free (pci_dev);rte_free (internals); +rte_free (eth_dev); +rte_free (eth_drv);return -1 ; }
Signature · 1 line
1.7.9.5
Re: [PATCHv4 2/9] null: fix segfault when null_pmd added to bonding
Quoted 16 lines · Tomasz Kulasek
When device is added to the bonding, the link status callback is added to the slave's
eth_dev->link_intr_cbslist. This list is not initialized for null pmd and adding it to the bonding segfaults application.This patch allocates and sets up required structures.
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/net/null/rte_eth_null.c +0
-0
drivers/net/null/rte_eth_null.c eth_dev_null_create(const char *name, · line 389
Quoted 4 lines
drivers/net/null/rte_eth_null.c +1
-0@@ -386,6 +386,7 @@ eth_dev_null_create(const char *name,const unsigned nb_rx_queues =1 ;const unsigned nb_tx_queues =1 ;struct rte_eth_dev_data *data =NULL ; +struct eth_driver *eth_drv =NULL ;
Hi Tomasz,
Thanks for extending null pmd features.
Is it possible to use rte_null_pmd here?
Could you please check ring pmd? It may also uses rte_ring_pmd for link status callback.
Tetsuya
Re: [PATCHv4 2/9] null: fix segfault when null_pmd added to bonding
Hi Tetsuya,
Quoted 6 lines
Thanks for extending null pmd features.
Is it possible to userte_null_pmdhere?
Could you please check ring pmd? It may also usesrte_ring_pmdfor link status callback.Tetsuya
My first attempt was to use ring pmd, and there's no such an issue with it. It works pretty well in bonding.
Tomasz.
Re: [PATCHv4 2/9] null: fix segfault when null_pmd added to bonding
Quoted 11 lines · TomaszX
Hi Tetsuya,
Quoted 6 lines
Thanks for extending null pmd features.
Is it possible to userte_null_pmdhere?
Could you please check ring pmd? It may also usesrte_ring_pmdfor link status callback.Tetsuya
My first attempt was to use ring pmd, and there's no such an issue with it. It works pretty well in bonding.
Tomasz.
HI Tomasz,
Sorry, my English is wrong.
'rte_null_pmd' is defined like below.
static struct eth_driver rte_null_pmd = {
.pci_drv = {
.name = "rte_null_pmd",
.drv_flags = RTE_PCI_DRV_DETACHABLE,
},
};I guess you may be able to use 'rte_null_pmd' instead of allocating one more eth_driver structure like below.
struct eth_driver *eth_drv = NULL;
eth_drv = rte_zmalloc_socket(name, sizeof(*eth_drv), 0, numa_node);Is it possible to use 'rte_null_pmd'?
Tetsuya
Re: [PATCHv4 2/9] null: fix segfault when null_pmd added to bonding
Quoted 38 lines
-----Original Message-----
From: Tetsuya Mukawa [mailto:[email protected]]
Sent: Tuesday, September 29, 2015 12:33
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCHv4 2/9] null: fix segfault whennull_pmdadded to bondingQuoted 9 lines · TomaszX
Hi Tetsuya,
Quoted 6 lines
Thanks for extending null pmd features.
Is it possible to userte_null_pmdhere?
Could you please check ring pmd? It may also usesrte_ring_pmdfor link status callback.Tetsuya
My first attempt was to use ring pmd, and there's no such an issue
with it. It works pretty well in bonding.
Quoted 2 lines
Tomasz.
HI Tomasz,
Sorry, my English is wrong.
'rte_null_pmd' is defined like below.static struct eth_driver rte_null_pmd = { .pci_drv = { .name = "rte_null_pmd", .drv_flags = RTE_PCI_DRV_DETACHABLE, }, };I guess you may be able to use '
rte_null_pmd' instead of allocating one moreeth_driverstructure like below.
Quoted 6 lines
struct eth_driver *eth_drv = NULL; eth_drv = rte_zmalloc_socket(name, sizeof(*eth_drv), 0, numa_node);Is it possible to use '
rte_null_pmd'?Tetsuya
Yes, you're right. This malloc can be removed.
Tomasz
Re: [PATCHv4 2/9] null: fix segfault when null_pmd added to bonding
In reply to Tetsuya MukawaHi Tetsuya,
Changes from patch below, solves the problem. I've removed malloc.
Tomasz.
---
Quoted 1 line
From
e03e77a7dc0e47ac9d750545a834624f88f61966Mon Sep 17 00:00:00 2001
From: Tomasz Kulasek <[email protected]>
Date: Tue, 29 Sep 2015 16:48:31 +0200
Subject: [PATCH 1/4] null: fix segfault when null_pmd added to bonding
--- drivers/net/null/rte_eth_null.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/null/rte_eth_null.c +3 -0
@@ -432,6 +432,7 @@ eth_dev_null_create(const char *name, internals->numa_node = numa_node; pci_dev->numa_node = numa_node; + pci_dev->driver = &rte_null_pmd.pci_drv; data->dev_private = internals; data->port_id = eth_dev->data->port_id;
@@ -445,6 +446,7 @@ eth_dev_null_create(const char *name, eth_dev->dev_ops = &ops; eth_dev->pci_dev = pci_dev; eth_dev->driver = &rte_null_pmd; +TAILQ_INIT (ð_dev->link_intr_cbs);/* finally assign rx and tx ops */ if (packet_copy) {
@@ -461,6 +463,7 @@ error:rte_free (data);rte_free (pci_dev);rte_free (internals); +rte_free (eth_dev);return -1 ; }
--
Re: [PATCHv4 2/9] null: fix segfault when null_pmd added to bonding
Quoted 37 lines · TomaszX
Hi Tetsuya,
Changes from patch below, solves the problem. I've removed malloc.
Tomasz.
---
Frome03e77a7dc0e47ac9d750545a834624f88f61966Mon Sep 17 00:00:00 2001
From: Tomasz Kulasek <[email protected]>
Date: Tue, 29 Sep 2015 16:48:31 +0200
Subject: [PATCH 1/4] null: fix segfault whennull_pmdadded to bonding--- drivers/net/null/rte_eth_null.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/null/rte_eth_null.c +2
-0@@ -432,6 +432,7 @@ eth_dev_null_create(const char *name, internals->numa_node = numa_node; pci_dev->numa_node = numa_node; + pci_dev->driver = &rte_null_pmd.pci_drv; data->dev_private = internals; data->port_id = eth_dev->data->port_id;@@ -445,6 +446,7 @@ eth_dev_null_create(const char *name, eth_dev->dev_ops = &ops; eth_dev->pci_dev = pci_dev; eth_dev->driver = &rte_null_pmd; +TAILQ_INIT (ð_dev->link_intr_cbs);/* finally assign rx and tx ops */ if (packet_copy) {
drivers/net/null/rte_eth_null.c error: · line 466
Quoted 4 lines
drivers/net/null/rte_eth_null.c +1
-0@@ -461,6 +463,7 @@ error:rte_free (data);rte_free (pci_dev);rte_free (internals); +rte_free (eth_dev);
Hi Tomasz,
We can remove rte_free(eth_dev), because if eth_dev is allocated correctly, we cannot reach here.
I don't see any issues except for it.
Thanks,
Tetsuya
PATCH v4 3/9 null: extend number of virtual queues
In reply to Tomasz KulasekThis patch adds a possibility to configure more than one queue on null device.
--- drivers/net/null/rte_eth_null.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/null/rte_eth_null.c +6 -6
@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };
@@ -213,7 +213,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) +if (rx_queue_id >= dev->data->nb_rx_queues)return -ENODEV ; internals = dev->data->dev_private;
@@ -246,7 +246,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) +if (tx_queue_id >= dev->data->nb_tx_queues)return -ENODEV ; internals = dev->data->dev_private;
@@ -279,8 +279,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }
Signature · 1 line
1.7.9.5
Re: [PATCHv4 3/9] null: extend number of virtual queues
Quoted 42 lines · Tomasz Kulasek
This patch adds a possibility to configure more than one queue on null device.
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/net/null/rte_eth_null.c +4
-4@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };@@ -213,7 +213,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) +if (rx_queue_id >= dev->data->nb_rx_queues)return -ENODEV ; internals = dev->data->dev_private;@@ -246,7 +246,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) +if (tx_queue_id >= dev->data->nb_tx_queues)return -ENODEV ; internals = dev->data->dev_private;
drivers/net/null/rte_eth_null.c eth_dev_info(struct rte_eth_dev *dev, · line 286
Quoted 10 lines
drivers/net/null/rte_eth_null.c +2
-2@@ -279,8 +279,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }
Hi Thomasz,
To do like above, should we change below variables also?
static int
eth_dev_null_create(const char *name,
const unsigned numa_node,
unsigned packet_size,
unsigned packet_copy)
{
const unsigned nb_rx_queues = 1;
const unsigned nb_tx_queues = 1;
(snip)}
Tetsuya
Re: [PATCHv4 3/9] null: extend number of virtual queues
Quoted 78 lines
-----Original Message-----
From: Tetsuya Mukawa [mailto:[email protected]]
Sent: Tuesday, September 29, 2015 04:25
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCHv4 3/9] null: extend number of virtual queuesdrivers/net/null/rte_eth_null.c eth_rx_queue_setup(struct rte_eth_dev *dev,
Quoted 24 lines · Tomasz Kulasek
This patch adds a possibility to configure more than one queue on null device.
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/net/null/rte_eth_null.cindex a8b3191..39ffcde 100644drivers/net/null/rte_eth_null.c +2
-2@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };@@ -213,7 +213,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev,
uint16_trx_queue_id,drivers/net/null/rte_eth_null.c eth_tx_queue_setup(struct rte_eth_dev *dev,
Quoted 9 lines
drivers/net/null/rte_eth_null.c +1
-1if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) +if (rx_queue_id >= dev->data->nb_rx_queues)return -ENODEV ; internals = dev->data->dev_private;@@ -246,7 +246,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev,
uint16_ttx_queue_id,Quoted 9 lines
drivers/net/null/rte_eth_null.c +1
-1if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) +if (tx_queue_id >= dev->data->nb_tx_queues)return -ENODEV ; internals = dev->data->dev_private;drivers/net/null/rte_eth_null.c eth_dev_info(struct rte_eth_dev *dev, · line 286
Quoted 10 lines
drivers/net/null/rte_eth_null.c +2
-2@@ -279,8 +279,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }Hi Thomasz,
To do like above, should we change below variables also?
static int
eth_dev_null_create(const char *name,
const unsignednuma_node, unsignedpacket_size, unsignedpacket_copy){ const unsigned nb_rx_queues = 1; const unsigned nb_tx_queues = 1; (snip)
Quoted 3 lines
}
Tetsuya
Hi Tetsuya,
The number of requested queues are configured later, through the rte eth_dev_configure API. Here these values mean the default number of queues after null pmd creation.
Tomasz.
Re: [PATCHv4 3/9] null: extend number of virtual queues
Quoted 77 lines · TomaszX
Quoted 77 lines
-----Original Message-----
From: Tetsuya Mukawa [mailto:[email protected]]
Sent: Tuesday, September 29, 2015 04:25
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCHv4 3/9] null: extend number of virtual queuesdrivers/net/null/rte_eth_null.c eth_rx_queue_setup(struct rte_eth_dev *dev,
Quoted 24 lines · Tomasz Kulasek
This patch adds a possibility to configure more than one queue on null device.
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/net/null/rte_eth_null.cindex a8b3191..39ffcde 100644drivers/net/null/rte_eth_null.c +2
-2@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };@@ -213,7 +213,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev,
uint16_trx_queue_id,drivers/net/null/rte_eth_null.c eth_tx_queue_setup(struct rte_eth_dev *dev,
Quoted 9 lines
drivers/net/null/rte_eth_null.c +1
-1if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) +if (rx_queue_id >= dev->data->nb_rx_queues)return -ENODEV ; internals = dev->data->dev_private;@@ -246,7 +246,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev,
uint16_ttx_queue_id,Quoted 9 lines
drivers/net/null/rte_eth_null.c +1
-1if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) +if (tx_queue_id >= dev->data->nb_tx_queues)return -ENODEV ; internals = dev->data->dev_private;drivers/net/null/rte_eth_null.c eth_dev_info(struct rte_eth_dev *dev, · line 286
Quoted 10 lines
drivers/net/null/rte_eth_null.c +2
-2@@ -279,8 +279,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }Hi Thomasz,
To do like above, should we change below variables also?
static int
eth_dev_null_create(const char *name,
const unsignednuma_node, unsignedpacket_size, unsignedpacket_copy){ const unsigned nb_rx_queues = 1; const unsigned nb_tx_queues = 1; (snip)
Quoted 9 lines
Quoted 3 lines
}
Tetsuya
Hi Tetsuya,
The number of requested queues are configured later, through the rte
eth_dev_configureAPI. Here these values mean the default number of queues after null pmd creation.Tomasz.
Hi Tomasz,
I guess we may need to change below variables when a queue is configured.
- internals->nb_rx_queues;
- internals->nb_tx_queues;
Without changing, 'num_stats' in eth_stats_get() might be wrong value.
Tetsuya
Re: [PATCHv4 3/9] null: extend number of virtual queues
Quoted 10 lines
Hi Tomasz,
I guess we may need to change below variables when a queue is configured.
-internals->nb_rx_queues;
-internals->nb_tx_queues;
Without changing, 'num_stats' ineth_stats_get()might be wrong value.Tetsuya
Hi Tetsuya,
I see it now. I was too focused on one case and I missed it. I'll modify it. Thanks for your help, by the way.
Tomasz
Re: [PATCHv4 3/9] null: extend number of virtual queues
Hi Tetsuya,
Can you check patch below?
Thanks,
Tomasz.
---
From d50b0594fa34a576602c457b51cac80e7d462eed Mon Sep 17 00:00:00 2001
From: Tomasz Kulasek <[email protected]>
Date: Tue, 29 Sep 2015 16:52:12 +0200
Subject: [PATCH 2/4] null: extend number of virtual queues
--- drivers/net/null/rte_eth_null.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/net/null/rte_eth_null.c +19 -9
@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };
@@ -178,7 +178,15 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) }static int -eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; } +eth_dev_configure (struct rte_eth_dev *dev) { +struct pmd_internals *internals; + + internals = dev->data->dev_private; + internals->nb_rx_queues = dev->data->nb_rx_queues; + internals->nb_tx_queues = dev->data->nb_tx_queues; + +return 0 ; +}static int eth_dev_start (struct rte_eth_dev *dev)
@@ -213,10 +221,11 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (rx_queue_id >= internals->nb_rx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;
@@ -246,10 +255,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (tx_queue_id >= internals->nb_tx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; dev->data->tx_queues[tx_queue_id] =
@@ -279,8 +289,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }
--
Tetsuya Mukawa
Acked-byRe: [PATCHv4 3/9] null: extend number of virtual queues
Quoted 80 lines · TomaszX
Hi Tetsuya,
Can you check patch below?
Thanks,
Tomasz.
---From
d50b0594fa34a576602c457b51cac80e7d462eedMon Sep 17 00:00:00 2001
From: Tomasz Kulasek <[email protected]>
Date: Tue, 29 Sep 2015 16:52:12 +0200
Subject: [PATCH 2/4] null: extend number of virtual queues--- drivers/net/null/rte_eth_null.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)drivers/net/null/rte_eth_null.c +17
-7@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };@@ -178,7 +178,15 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) }static int -eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; } +eth_dev_configure (struct rte_eth_dev *dev) { +struct pmd_internals *internals; + + internals = dev->data->dev_private; + internals->nb_rx_queues = dev->data->nb_rx_queues; + internals->nb_tx_queues = dev->data->nb_tx_queues; + +return 0 ; +}static int eth_dev_start (struct rte_eth_dev *dev)@@ -213,10 +221,11 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (rx_queue_id >= internals->nb_rx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;@@ -246,10 +255,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (tx_queue_id >= internals->nb_tx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; dev->data->tx_queues[tx_queue_id] =@@ -279,8 +289,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername;
drivers/net/null/rte_eth_null.c eth_dev_info(struct rte_eth_dev *dev,
Quoted 10 lines
drivers/net/null/rte_eth_null.c +2
-3dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; } --
PATCH v4 4/9 null: virtual dynamic rss configuration
In reply to Tomasz KulasekThis implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
--- drivers/net/null/rte_eth_null.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)
drivers/net/null/rte_eth_null.c +116 -0
@@ -37,6 +37,8 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_eth_null.h> +#include <rte_spinlock.h> #define ETH_NULL_PACKET_SIZE_ARG "size"#define ETH_NULL_PACKET_COPY_ARG "copy"
@@ -73,6 +75,17 @@ struct pmd_internals {struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ];struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; + +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +rte_spinlock_t rss_lock; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ };
@@ -283,6 +296,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; + dev_info->reta_size = internals->reta_size; + dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; } static void
@@ -363,6 +378,91 @@ static int eth_link_update(struct rte_eth_dev *dev __rte_unused, int wait_to_complete __rte_unused) { return 0; } +static int +eth_rss_reta_update (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { + internal->reta_conf[i].mask = reta_conf[i].mask; +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + internal->reta_conf[i].reta[j] = reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_reta_query (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + reta_conf[i].reta[j] = internal->reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_update (struct rte_eth_dev *dev,struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key) +memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key) +memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -375,6 +475,10 @@ static const struct eth_dev_ops ops = { .link_update = eth_link_update, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, + .reta_update = eth_rss_reta_update, + .reta_query = eth_rss_reta_query, + .rss_hash_update = eth_rss_hash_update, + .rss_hash_conf_get = eth_rss_hash_conf_get }; static int
@@ -391,6 +495,13 @@ eth_dev_null_create(const char *name,struct pmd_internals *internals =NULL ;struct rte_eth_dev *eth_dev =NULL ; +static const uint8_t default_rss_key[40 ] = { +0x6D ,0x5A ,0x56 ,0xDA ,0x25 ,0x5B ,0x0E ,0xC2 ,0x41 ,0x67 ,0x25 ,0x3D , +0x43 ,0xA3 ,0x8F ,0xB0 ,0xD0 ,0xCA ,0x2B ,0xCB ,0xAE ,0x7B ,0x30 ,0xB4 , +0x77 ,0xCB ,0x2D ,0xA3 ,0x80 ,0x30 ,0xF2 ,0x0C ,0x6A ,0x42 ,0xB7 ,0x3B , +0xBE ,0xAC ,0x01 ,0xFA + }; +if (name ==NULL )return -EINVAL ;
@@ -436,6 +547,11 @@ eth_dev_null_create(const char *name, internals->packet_copy = packet_copy; internals->numa_node = numa_node; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ; + +memcpy (internals->rss_key, default_rss_key,40 ); + eth_drv->pci_drv.name = drivername; pci_dev->numa_node = numa_node;
Signature · 1 line
1.7.9.5
Re: [PATCHv4 4/9] null: virtual dynamic rss configuration
Quoted 54 lines · Tomasz Kulasek
This implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)drivers/net/null/rte_eth_null.c +36
-0+static int +eth_rss_hash_update (struct rte_eth_dev *dev,struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key) +memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key) +memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,@@ -436,6 +547,11 @@ eth_dev_null_create(const char *name, internals->packet_copy = packet_copy;
drivers/net/null/rte_eth_null.c eth_dev_null_create(const char *name, · line 557
Quoted 10 lines
drivers/net/null/rte_eth_null.c +5
-0internals->numa_node = numa_node; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ; + +memcpy (internals->rss_key, default_rss_key,40 ); + eth_drv->pci_drv.name = drivername; pci_dev->numa_node = numa_node;
Hi Thomasz,
I am just curious. Is it possible to use rte_memcpy instead of memcpy? if we can, rte_memcpy may be faster.
Tetsuya
Re: [PATCHv4 4/9] null: virtual dynamic rss configuration
Quoted 6 lines
Hi Thomasz,
I am just curious. Is it possible to use
rte_memcpyinstead of memcpy? if we can,rte_memcpymay be faster.Tetsuya
Hi Tetsuya,
I've just tested it and seems to work, so there's no objections to use rte_memcpy.
Tomasz.
Re: [PATCHv4 4/9] null: virtual dynamic rss configuration
In reply to Tetsuya MukawaQuoted 75 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tetsuya Mukawa
Sent: Tuesday, September 29, 2015 4:25 AM
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCHv4 4/9] null: virtual dynamic rss configurationQuoted 7 lines · Tomasz Kulasek
This implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 116+++++++++++++++++++++++++++++++++++++++
drivers/net/null/rte_eth_null.c
Quoted 8 lines
1 file changed, 116 insertions(+)drivers/net/null/rte_eth_null.c +2
-0+static int +eth_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf
*rss_conf)Quoted 40 lines
drivers/net/null/rte_eth_null.c +8
-0+{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal-
flow_type_rss_offloads;drivers/net/null/rte_eth_null.c +18
-0+ +if (rss_conf->rss_key) +memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data-dev_conf.rx_adv_conf.rss_conf.rss_hf;
drivers/net/null/rte_eth_null.c +8
-0+if (rss_conf->rss_key) +memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,drivers/net/null/rte_eth_null.c eth_dev_null_create(const char *name, · line 551
Quoted 5 lines
drivers/net/null/rte_eth_null.c +2
-0@@ -436,6 +547,11 @@ eth_dev_null_create(const char *name, internals->packet_copy = packet_copy; internals->numa_node = numa_node; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size = RTE_DIM(internals->reta_conf) *
RTE_RETA_GROUP_SIZE;Quoted 5 lines
drivers/net/null/rte_eth_null.c +3
-0+ +memcpy (internals->rss_key, default_rss_key,40 ); + eth_drv->pci_drv.name = drivername;
Quoted 8 lines
drivers/net/null/rte_eth_null.c eth_dev_null_create(const char *name, · line 557
Quoted 1 line
drivers/net/null/rte_eth_null.c +0
-0pci_dev->numa_node = numa_node;Hi Thomasz,
I am just curious. Is it possible to use
rte_memcpyinstead of memcpy? if we can,rte_memcpymay be faster.Tetsuya
Hi Tetsuya,
Could You please review v5 that Tomasz sent and if You agree with this implementation could You also ACK this patch-set?
PATCH v4 5/9 null: export eth_dev_null_create
In reply to Tomasz KulasekTo use eth_dev_null_create in application this method needs to be exported.
--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 3 ++- drivers/net/null/rte_eth_null.h | 40 +++++++++++++++++++++++++++++ drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.h
drivers/net/null/Makefile +1 -1
@@ -51,7 +51,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += rte_eth_null.c # # Export include files # -SYMLINK-y-include += +SYMLINK-y-include += rte_eth_null.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf
drivers/net/null/rte_eth_null.c +2 -1
@@ -2,6 +2,7 @@* BSD LICENSE * * Copyright (C) IGEL Co.,Ltd. +* Copyright (c) 2015 Intel Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -481,7 +482,7 @@ static const struct eth_dev_ops ops = { .rss_hash_conf_get = eth_rss_hash_conf_get }; -static int +int eth_dev_null_create(const char *name, const unsigned numa_node, unsigned packet_size,
drivers/net/null/rte_eth_null.h new file +40 -0
@@ -0,0 +1,40 @@ +/*- +* BSD LICENSE +* +* Copyright(c) 2015 Intel Corporation. All rights reserved. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of Intel Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef RTE_ETH_NULL_H_ +#define RTE_ETH_NULL_H_ + +int eth_dev_null_create (const char *name,const unsigned numa_node, +unsigned packet_size,unsigned packet_copy); + +#endif /* RTE_ETH_NULL_H_ */
drivers/net/null/rte_pmd_null_version.map +7 -0
@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.1 { + global: + + eth_dev_null_create; + +} DPDK_2.0;
Signature · 1 line
1.7.9.5
Re: [PATCHv4 5/9] null: export eth_dev_null_create
Hi Tomasz,
2015-07-15 19:26, Tomasz Kulasek:
Quoted 11 lines
drivers/net/null/rte_eth_null.c +1
-0@@ -2,6 +2,7 @@* BSD LICENSE * * Copyright (C) IGEL Co.,Ltd. +* Copyright (c) 2015 Intel Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without
drivers/net/null/rte_eth_null.c static const struct eth_dev_ops ops = { · line 488
Quoted 8 lines
drivers/net/null/rte_eth_null.c +1
-1@@ -481,7 +482,7 @@ static const struct eth_dev_ops ops = { .rss_hash_conf_get = eth_rss_hash_conf_get }; -static int +int eth_dev_null_create(const char *name, const unsigned numa_node, unsigned packet_size,
There is no rule to update a copyright but I think it is not justified here.
drivers/net/null/rte_pmd_null_version.map DPDK_2.0 { · line 11
Quoted 13 lines
drivers/net/null/rte_pmd_null_version.map +7
-0@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.1 { + global: + + eth_dev_null_create; + +} DPDK_2.0;
Please, could you update it to DPDK_2.2?
Thanks
Re: [PATCHv4 5/9] null: export eth_dev_null_create
Hi Thomas,
Quoted 24 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, September 25, 2015 12:11
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCHv4 5/9] null: exporteth_dev_null_createdrivers/net/null/rte_pmd_null_version.map DPDK_2.0 { · line 11
Quoted 13 lines
drivers/net/null/rte_pmd_null_version.map +7
-0@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.1 { + global: + + eth_dev_null_create; + +} DPDK_2.0;Please, could you update it to DPDK_2.2?
Quoted 2 lines
Thanks
drivers/net/null/rte_pmd_null_version.map +7 -0
@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.2 { + global: + + eth_dev_null_create; + +} DPDK_2.0;
This change is fine?
Tomasz.
Re: [PATCHv4 5/9] null: export eth_dev_null_create
Quoted 10 lines
Quoted 1 line
Please, could you update it to DPDK_2.2?
drivers/net/null/rte_pmd_null_version.map +6
-0+DPDK_2.2 { + global: + + eth_dev_null_create; + +} DPDK_2.0;This change is fine?
Yes, only one letter to change :)
Re: [PATCHv4 5/9] null: export eth_dev_null_create
In reply to Tomasz KulasekQuoted 96 lines · Tomasz Kulasek
To use
eth_dev_null_createin application this method needs to be exported.Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 3 ++- drivers/net/null/rte_eth_null.h | 40 +++++++++++++++++++++++++++++ drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.hdrivers/net/null/Makefile +1
-1@@ -51,7 +51,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += rte_eth_null.c # # Export include files # -SYMLINK-y-include += +SYMLINK-y-include += rte_eth_null.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbufdrivers/net/null/rte_eth_null.c +2
-1@@ -2,6 +2,7 @@* BSD LICENSE * * Copyright (C) IGEL Co.,Ltd. +* Copyright (c) 2015 Intel Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -481,7 +482,7 @@ static const struct eth_dev_ops ops = { .rss_hash_conf_get = eth_rss_hash_conf_get }; -static int +int eth_dev_null_create(const char *name, const unsigned numa_node, unsigned packet_size,drivers/net/null/rte_eth_null.h new file +40
-0@@ -0,0 +1,40 @@ +/*- +* BSD LICENSE +* +* Copyright(c) 2015 Intel Corporation. All rights reserved. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of Intel Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef RTE_ETH_NULL_H_ +#define RTE_ETH_NULL_H_ + +int eth_dev_null_create (const char *name,const unsigned numa_node, +unsigned packet_size,unsigned packet_copy); + +#endif /* RTE_ETH_NULL_H_ */ drivers/net/null/rte_pmd_null_version.map +0
-0
drivers/net/null/rte_pmd_null_version.map DPDK_2.0 { · line 11
Quoted 10 lines
drivers/net/null/rte_pmd_null_version.map +7
-0@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.1 { + global: + + eth_dev_null_create; + +} DPDK_2.0;
Hi Thomasz,
I don't have any comments without the version miss Thomas has already commented.
Tetsuya
PATCH v4 6/9 test: dynamic rss configuration
In reply to Tomasz KulasekThis test module uses modified null device to check right RSS configuration propagation.
1) Propagation test
a) Set RSS hash function for bonding, fetch RSS hash function from bonded slave, check if same. Do it for all slaves.
b) Repeat above for RSS key and RETA.
2)Dynamic adding slave to the bonding
a) Remove slave from bonding.
b) Change its configuration to other than bonding.
c) Add slave to the started bonding device.
d) Check if slaves configuration changed.
3) Repeat point 1) and 2) with RSS multi-queue mode enabled/disabled for bonding port.
v4 changes:
- adapted to use null pmd driver in place of ring pmd
--- app/test/Makefile | 8 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++++++++++++++++ 2 files changed, 687 insertions(+) create mode 100644 app/test/test_link_bonding_rssconf.c
app/test/Makefile +8 -0
@@ -137,6 +137,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c endif SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
@@ -173,6 +174,13 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) LDLIBS += -lrte_pmd_ring endif endif +ifneq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) +$(error Link bonding rssconf tests require CONFIG_RTE_LIBRTE_PMD_NULL=y) +else +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +LDLIBS += -lrte_pmd_null +endif +endif endif include $(RTE_SDK)/mk/rte.app.mk
app/test/test_link_bonding_rssconf.c new file +679 -0
679 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v4 7/9 bonding: queue stats mapping
In reply to Tomasz KulasekThis patch adds propagation of mapping over the slaves, and fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 34 +++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +33 -1
@@ -1783,7 +1783,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) {struct bond_dev_private *internals = dev->data->dev_private;struct rte_eth_stats slave_stats; -int i; +int i, j;for (i =0 ; i < internals->slave_count; i++) {rte_eth_stats_get (internals->slaves[i].port_id, &slave_stats);
@@ -1802,6 +1802,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + +for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_opackets[j]; + stats->q_ibytes[j] += slave_stats.q_ibytes[j]; + stats->q_obytes[j] += slave_stats.q_obytes[j]; + stats->q_errors[j] += slave_stats.q_errors[j]; + } + } }
@@ -2110,6 +2119,28 @@ bond_ethdev_rss_hash_conf_get(struct rte_eth_dev *dev,return 0 ; } +static int +bond_ethdev_queue_stats_mapping_set (struct rte_eth_dev *dev,uint16_t queue_id, +uint8_t stat_idx,uint8_t is_rx) +{ +int i; +int retval; +struct bond_dev_private *internals = dev->data->dev_private; + +for (i =0 ; i < internals->slave_count; i++) { +if (is_rx) + retval =rte_eth_dev_set_rx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); +else + retval =rte_eth_dev_set_tx_queue_stats_mapping ( + internals->slaves[i].port_id, queue_id, stat_idx); +if (retval !=0 ) +return retval; + } + +return 0 ; +} +struct eth_dev_ops default_dev_ops = { .dev_start = bond_ethdev_start, .dev_stop = bond_ethdev_stop,
@@ -2123,6 +2154,7 @@ struct eth_dev_ops default_dev_ops = { .link_update = bond_ethdev_link_update, .stats_get = bond_ethdev_stats_get, .stats_reset = bond_ethdev_stats_reset, + .queue_stats_mapping_set = bond_ethdev_queue_stats_mapping_set, .promiscuous_enable = bond_ethdev_promiscuous_enable, .promiscuous_disable = bond_ethdev_promiscuous_disable, .reta_update = bond_ethdev_rss_reta_update,
Signature · 1 line
1.7.9.5
Re: [PATCHv4 7/9] bonding: queue stats mapping
2015-07-15 19:26, Tomasz Kulasek:
drivers/net/bonding/rte_eth_bond_pmd.c struct eth_dev_ops default_dev_ops = { · line 2157
Quoted 1 line
drivers/net/bonding/rte_eth_bond_pmd.c +1
-0+ .queue_stats_mapping_set = bond_ethdev_queue_stats_mapping_set,
As explained with previous version of this patchset, this API should be removed. It is specific to some Intel devices.
Please do not use it in bonding.
Then we could discuss in another thread how to remove it from ethdev.
Re: [PATCHv4 7/9] bonding: queue stats mapping
Quoted 7 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, September 25, 2015 12:15
To: Kulasek, TomaszX
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCHv4 7/9] bonding: queue stats mapping
Quoted 8 lines
2015-07-15 19:26, Tomasz Kulasek:
Review
Quoted 1 line
(quoted diff) +1
-0+ .queue_stats_mapping_set =
bond_ethdev_queue_stats_mapping_set,As explained with previous version of this patchset, this API should be removed. It is specific to some Intel devices.
Please do not use it in bonding.
Then we could discuss in another thread how to remove it from ethdev.
Ok, I remove it in v5.
PATCH v4 8/9 doc: fixed spellings and typos
In reply to Tomasz Kulasek--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +4 -4
@@ -188,7 +188,7 @@ conditions are not met. If a user wishes to monitor individual slaves then they must register callbacks with that slave directly. The link bonding library also supports devices which do not implement link -status change interrupts, this is achieve by polling the devices link status at +status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` API, the default polling interval is 10ms. When a device is added as a slave to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
@@ -286,7 +286,7 @@ and UDP protocols for load balancing. Using Link Bonding Devices -------------------------- -The librte_pmd_bond library support two modes of device creation, the libraries +The librte_pmd_bond library supports two modes of device creation, the libraries export full C API or using the EAL command line to statically configure link bonding devices at application startup. Using the EAL option it is possible to use link bonding functionality transparently without specific knowledge of the
@@ -299,7 +299,7 @@ Using the Poll Mode Driver from an Application Using the librte_pmd_bond libraries API it is possible to dynamically create and manage link bonding device from within any application. Link bonding -device are created using the ``rte_eth_bond_create`` API which requires a +devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the link bonding mode to initial the device in and finally the socket Id which to allocate the devices resources onto. After successful creation of a bonding device it must be configured using the generic Ethernet
@@ -362,7 +362,7 @@ The different options are: mode=2 * slave: Defines the PMD device which will be added as slave to the bonded - device. This option can be selected multiple time, for each device to be + device. This option can be selected multiple times, for each device to be added as a slave. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function
Signature · 1 line
1.7.9.5
PATCH v4 9/9 doc: dynamic rss configuration for bonding
In reply to Tomasz KulasekDocumentation update about implementation details and requirements for Dynamic RSS Configuration for Bonding.
--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +32 -2
@@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,28 @@ After a slave device is added to a bonded device slave is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding -device. +device. If RSS is enabled for bonding device, this mode is also enabled on new +slave and configured as well. + +Setting up multi-queue mode for bonding device to RSS, makes it fully +RSS-capable, so all slaves are synchronized with its configuration. This mode is +intended to provide RSS configuration on slaves transparent for client +application implementation. + +Bonding device stores its own version of RSS settings i.e. RETA, RSS hash +function and RSS key, used to set up its slaves. That let to define the meaning +of RSS configuration of bonding device as desired configuration of whole bonding +(as one unit), without pointing any of slave inside. It is required to ensure +consistency and made it more errorproof. + +RSS hash function set for bonding device, is a maximal set of RSS hash functions +supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if slave +RETAs' sizes are different. If RSS Key is not set for bonded device, it's not +changed on the slaves and default key for device is used. + +All settings are managed through the bonding port API and always are propagated +in one direction (from bonding to slaves). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +228,15 @@ these parameters. A bonding device must have a minimum of one slave before the bonding device itself can be started. +To use a bonding device dynamic RSS configuration feature effectively, it is +also required, that all slaves should be RSS-capable and support, at least one +common hash function available for each of them. Changing RSS key is only +possible, when all slave devices support the same key size. + +To prevent inconsistency on how slaves process packets, once a device is added +to a bonding device, RSS configuration should be managed through the bonding +device API, and not directly on the slave. + Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object.
Signature · 1 line
1.7.9.5
2015-07-15 19:26, Tomasz Kulasek:
Quoted 6 lines
Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault whennull_pmdadded to bonding
null: extend number of virtual queues
null: virtual dynamic rss configuration
null: exporteth_dev_null_create
Please Tetsuya, could you review the patches on null PMD? Thanks
Quoted 17 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, September 25, 2015 12:17
To: Tetsuya Mukawa
Cc: [email protected]; Kulasek, TomaszX
Subject: Re: [dpdk-dev] [PATCHv4 0/9] Dynamic RSS Configuration for Bonding2015-07-15 19:26, Tomasz Kulasek:
Quoted 6 lines
Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault whennull_pmdadded to bonding
null: extend number of virtual queues
null: virtual dynamic rss configuration
null: exporteth_dev_null_create
Quoted 2 lines
Please Tetsuya, could you review the patches on null PMD? Thanks
Do you need patch-set v5 or should I wait?
Tomasz
2015-09-25 13:28, Kulasek, TomaszX:
Quoted 5 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 2 lines
Please Tetsuya, could you review the patches on null PMD? Thanks
Do you need patch-set v5 or should I wait?
I think you should wait for Tetsuya feedback.
v5 cover Dynamic RSS Configuration for Bonding
In reply to Tomasz KulasekOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.
Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v5 changes:
- updated to DPDK 2.2
- removed copyright change from null device source
- removed queue_stats_mapping_set from eth_dev_ops of bonding device
- null pmd cleanups (removed unnecessary malloc, replaced memcpy with rte_memcpy)
- fixed queues number configuration in null pmd
v4 changes:
- fixed copy-paste error,
- removed example application as too complex and introducing a new dependency,
- addapted null pmd to be used as testing device for dynamic RSS configuration,
- addapted test units to use null pmd instead of ring pmd,
- ring pmd is not used and changed in this patchset
v3 changes:
- checkpatch cleanups
v2 changes:
- added support for keys other than 40 bytes long,
- now, if RSS key is not set for bonding, it is not set also for slaves,
- fix - full initial RSS configuration before any slave is added was not possible due to the initially zeroed flow_type_rss_offloads for bonding,
- fix - changed error to warning when slave is synchronizing due to the bonding's initial configuration (to allow use slaves' drivers not supporting dynamic RSS configuration in bonding),
- some code cleanups,
- updated documentation,
Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault when null_pmd added to bonding
null: extend number of virtual queues
null: virtual dynamic rss configuration
null: export eth_dev_null_create
test: dynamic rss configuration
bonding: per queue stats
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
app/test/Makefile | 8 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 28 + drivers/net/bonding/rte_eth_bond_pmd.c | 216 ++++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 148 ++++- drivers/net/null/rte_eth_null.h | 40 ++ drivers/net/null/rte_pmd_null_version.map | 7 + 10 files changed, 1150 insertions(+), 32 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 drivers/net/null/rte_eth_null.h
Signature · 1 line
1.7.9.5
PATCH v5 1/9 bonding: rss dynamic configuration
Bonding device implements independent management of RSS settings. It stores its own copies of settings i.e. RETA, RSS hash function and RSS key. It’s required to ensure consistency.
1) RSS hash function set for bonding device is maximal set of RSS hash functions supported by all bonded devices. That mean, to have RSS support for bonding, all slaves should be RSS-capable.
2) RSS key is propagated over the slaves "as is".
3) RETA for bonding is an internal table managed by bonding API, and is used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so it can be easily used as a pattern providing expected behavior, even if slaves RETA sizes are different.
--- drivers/net/bonding/rte_eth_bond_api.c | 28 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 205 ++++++++++++++++++++++++++-- drivers/net/bonding/rte_eth_bond_private.h | 12 ++ 3 files changed, 231 insertions(+), 14 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +28 -0
@@ -273,6 +273,9 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; +/* Initially allow to choose any offload type */ + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; +memset (internals->active_slaves,0 ,sizeof (internals->active_slaves));memset (internals->slaves,0 ,sizeof (internals->slaves));
@@ -369,6 +372,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)rte_eth_dev_info_get (slave_port_id, &dev_info); +/* We need to store slaves reta_size to be able to synchronize RETA for all +* slave devices even if its sizes are different. +*/ + internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; +if (internals->slave_count <1 ) {/* if MAC is not user defined then use MAC of first slave add to * bonded device */
@@ -382,9 +390,16 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)/* Make primary slave */ internals->primary_port = slave_port_id; +/* Inherit queues settings from first slave */ + internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + + internals->reta_size = dev_info.reta_size; +/* Take the first dev's offload capabilities */ internals->rx_offload_capa = dev_info.rx_offload_capa; internals->tx_offload_capa = dev_info.tx_offload_capa; + internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; }else {/* Check slave link properties are supported if props are set,
@@ -403,8 +418,19 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; + internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; + +/* RETA size is GCD of all slaves RETA sizes, so, if all sizes will be +* the power of 2, the lower one is GCD +*/ +if (internals->reta_size > dev_info.reta_size) + internals->reta_size = dev_info.reta_size; + } + bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= + internals->flow_type_rss_offloads; + internals->slave_count++;/* Update all slave devices MACs*/
@@ -531,6 +557,8 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)if (internals->slave_count ==0 ) { internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =0 ; }return 0 ; }
drivers/net/bonding/rte_eth_bond_pmd.c +191 -14
236 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +12 -0
@@ -103,6 +103,8 @@ struct bond_slave_details {uint8_t last_link_status;/**< Port Id of slave eth_dev */ struct ether_addr persisted_mac_addr; + +uint16_t reta_size; };
@@ -155,6 +157,16 @@ struct bond_dev_private {uint32_t rx_offload_capa;/** Rx offload capability */ uint32_t tx_offload_capa;/** Tx offload capability */ +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_512 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[52 ];/**< 52-byte hash key buffer. */ +uint8_t rss_key_len;/**< hash key length in bytes. */ +struct rte_kvargs *kvlist;uint8_t slave_update_idx; };
Signature · 1 line
1.7.9.5
PATCH v5 2/9 null: fix segfault when null_pmd added to bonding
In reply to Tomasz KulasekThis patch initializes eth_dev->link_intr_cbs queue used when null pmd is added to the bonding.
v5 changes:
- removed unnecessary malloc for eth_driver (rte_null_pmd)
--- drivers/net/null/rte_eth_null.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/null/rte_eth_null.c +2 -0
@@ -432,6 +432,7 @@ eth_dev_null_create(const char *name, internals->numa_node = numa_node; pci_dev->numa_node = numa_node; + pci_dev->driver = &rte_null_pmd.pci_drv; data->dev_private = internals; data->port_id = eth_dev->data->port_id;
@@ -445,6 +446,7 @@ eth_dev_null_create(const char *name, eth_dev->dev_ops = &ops; eth_dev->pci_dev = pci_dev; eth_dev->driver = &rte_null_pmd; +TAILQ_INIT (ð_dev->link_intr_cbs);/* finally assign rx and tx ops */ if (packet_copy) {
Signature · 1 line
1.7.9.5
Re: [PATCH v5 2/9] null: fix segfault when null_pmd added to bonding
Quoted 10 lines · Tomasz Kulasek
This patch initializes
eth_dev->link_intr_cbsqueue used when null pmd is added to the bonding.v5 changes:
- removed unnecessary malloc foreth_driver(rte_null_pmd)Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH v5 3/9 null: extend number of virtual queues
In reply to Tomasz KulasekThis patch adds a possibility to configure more than one queue on null device.
v5 changes:
- fixed queues number configuration (using internals->nb_*_queues instead of dev->data->nb_*_queues)
--- drivers/net/null/rte_eth_null.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/net/null/rte_eth_null.c +19 -9
@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };
@@ -178,7 +178,15 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) }static int -eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; } +eth_dev_configure (struct rte_eth_dev *dev) { +struct pmd_internals *internals; + + internals = dev->data->dev_private; + internals->nb_rx_queues = dev->data->nb_rx_queues; + internals->nb_tx_queues = dev->data->nb_tx_queues; + +return 0 ; +}static int eth_dev_start (struct rte_eth_dev *dev)
@@ -213,10 +221,11 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (rx_queue_id >= internals->nb_rx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;
@@ -246,10 +255,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (tx_queue_id >= internals->nb_tx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; dev->data->tx_queues[tx_queue_id] =
@@ -279,8 +289,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }
Signature · 1 line
1.7.9.5
Re: [PATCH v5 3/9] null: extend number of virtual queues
Quoted 11 lines · Tomasz Kulasek
This patch adds a possibility to configure more than one queue on null device.
v5 changes:
- fixed queues number configuration (using internals->nb_*_queues instead of dev->data->nb_*_queues)Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
PATCH v5 4/9 null: virtual dynamic rss configuration
In reply to Tomasz KulasekThis implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
v5 changes:
- replaced memcpy with rte_memcpy
--- drivers/net/null/rte_eth_null.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)
drivers/net/null/rte_eth_null.c +116 -0
@@ -37,6 +37,8 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_eth_null.h> +#include <rte_spinlock.h> #define ETH_NULL_PACKET_SIZE_ARG "size"#define ETH_NULL_PACKET_COPY_ARG "copy"
@@ -73,6 +75,17 @@ struct pmd_internals {struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ];struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; + +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +rte_spinlock_t rss_lock; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ };
@@ -293,6 +306,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; + dev_info->reta_size = internals->reta_size; + dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; } static void
@@ -373,6 +388,91 @@ static int eth_link_update(struct rte_eth_dev *dev __rte_unused, int wait_to_complete __rte_unused) { return 0; } +static int +eth_rss_reta_update (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { + internal->reta_conf[i].mask = reta_conf[i].mask; +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + internal->reta_conf[i].reta[j] = reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_reta_query (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + reta_conf[i].reta[j] = internal->reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_update (struct rte_eth_dev *dev,struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key) +rte_memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key) +rte_memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -385,6 +485,10 @@ static const struct eth_dev_ops ops = { .link_update = eth_link_update, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, + .reta_update = eth_rss_reta_update, + .reta_query = eth_rss_reta_query, + .rss_hash_update = eth_rss_hash_update, + .rss_hash_conf_get = eth_rss_hash_conf_get }; static int
@@ -400,6 +504,13 @@ eth_dev_null_create(const char *name,struct pmd_internals *internals =NULL ;struct rte_eth_dev *eth_dev =NULL ; +static const uint8_t default_rss_key[40 ] = { +0x6D ,0x5A ,0x56 ,0xDA ,0x25 ,0x5B ,0x0E ,0xC2 ,0x41 ,0x67 ,0x25 ,0x3D , +0x43 ,0xA3 ,0x8F ,0xB0 ,0xD0 ,0xCA ,0x2B ,0xCB ,0xAE ,0x7B ,0x30 ,0xB4 , +0x77 ,0xCB ,0x2D ,0xA3 ,0x80 ,0x30 ,0xF2 ,0x0C ,0x6A ,0x42 ,0xB7 ,0x3B , +0xBE ,0xAC ,0x01 ,0xFA + }; +if (name ==NULL )return -EINVAL ;
@@ -441,6 +552,11 @@ eth_dev_null_create(const char *name, internals->packet_copy = packet_copy; internals->numa_node = numa_node; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ; + +rte_memcpy (internals->rss_key, default_rss_key,40 ); + pci_dev->numa_node = numa_node; pci_dev->driver = &rte_null_pmd.pci_drv;
Signature · 1 line
1.7.9.5
Re: [PATCH v5 4/9] null: virtual dynamic rss configuration
Quoted 11 lines · Tomasz Kulasek
This implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
v5 changes:
- replaced memcpy withrte_memcpySigned-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)
Re: [PATCH v5 4/9] null: virtual dynamic rss configuration
In reply to Tomasz KulasekQuoted 17 lines · Tomasz Kulasek
This implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
v5 changes:
- replaced memcpy withrte_memcpySigned-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)drivers/net/null/rte_eth_null.c +0
-0
drivers/net/null/rte_eth_null.c line 43
Quoted 7 lines
drivers/net/null/rte_eth_null.c +2
-0@@ -37,6 +37,8 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_eth_null.h> +#include <rte_spinlock.h>
Hi Tomasz,
We don't have "rte_eth_null.h" at this point.
(The header file will be added next patch)
Probably, we also need "rte_pmd_null_version.map" to compile correctly. (To make sure, please compile DPDK with "CONFIG_RTE_BUILD_SHARED_LIB=y" option.)
Also, it seems 'rte_eth_null.h' should be included like below. #include "rte_eth_null.h"
Without it, we cannot compile.
Thanks,
Tetsuya
Re: [PATCH v5 4/9] null: virtual dynamic rss configuration
Quoted 44 lines
-----Original Message-----
From: Tetsuya Mukawa [mailto:[email protected]]
Sent: Thursday, October 15, 2015 09:46
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 4/9] null: virtual dynamic rss configurationQuoted 18 lines · Tomasz Kulasek
This implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
v5 changes:
- replaced memcpy withrte_memcpySigned-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)(quoted diff) +0
-0
b/drivers/net/null/rte_eth_null.cindex bf81b1b..b01f647 100644drivers/net/null/rte_eth_null.c line 43
Quoted 7 lines
drivers/net/null/rte_eth_null.c +2
-0@@ -37,6 +37,8 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_eth_null.h> +#include <rte_spinlock.h> Hi Tomasz,
We don't have "
rte_eth_null.h" at this point.
(The header file will be added next patch) Probably, we also need "rte_pmd_null_version.map" to compile correctly.
(To make sure, please compile DPDK with "CONFIG_RTE_BUILD_SHARED_LIB=y" option.)
Quoted 6 lines
Also, it seems '
rte_eth_null.h' should be included like below. #include "rte_eth_null.h"
Without it, we cannot compile.Thanks,
Tetsuya
Hi Tetsuya,
This file and modifications are already included in "[dpdk-dev,v5,5/9] null: export eth_dev_null_create" in the patch set, also the required symlink is created like below:
---
drivers/net/null/Makefile +1 -1
@@ -51,7 +51,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += rte_eth_null.c # # Export include files # -SYMLINK-y-include += +SYMLINK-y-include += rte_eth_null.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf
---
Tomasz.
Re: [PATCH v5 4/9] null: virtual dynamic rss configuration
Quoted 46 lines · TomaszX
Quoted 46 lines
-----Original Message-----
From: Tetsuya Mukawa [mailto:[email protected]]
Sent: Thursday, October 15, 2015 09:46
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 4/9] null: virtual dynamic rss configurationQuoted 18 lines · Tomasz Kulasek
This implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
v5 changes:
- replaced memcpy withrte_memcpySigned-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/rte_eth_null.c | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+)(quoted diff) +0
-0
b/drivers/net/null/rte_eth_null.cindex bf81b1b..b01f647 100644drivers/net/null/rte_eth_null.c line 43
Quoted 7 lines
drivers/net/null/rte_eth_null.c +2
-0@@ -37,6 +37,8 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_eth_null.h> +#include <rte_spinlock.h> Hi Tomasz,
We don't have "
rte_eth_null.h" at this point.
(The header file will be added next patch) Probably, we also need "rte_pmd_null_version.map" to compile correctly.
(To make sure, please compile DPDK with "CONFIG_RTE_BUILD_SHARED_LIB=y" option.)Also, it seems '
rte_eth_null.h' should be included like below. #include "rte_eth_null.h"
Without it, we cannot compile.
Quoted 5 lines
Quoted 2 lines
Thanks,
TetsuyaHi Tetsuya,
This file and modifications are already included in "[dpdk-dev,v5,5/9] null: export
eth_dev_null_create" in the patch set, also the required symlink is created like below:
Hi Tomasz,
But "rte_eth_null.h" is used in " [PATCH v5 4/9] null: virtual dynamic rss configuration".
It means we cannot compile DPDK before applying "[dpdk-dev,v5,5/9]". When we need to use git-bisect, this will be problem.
So could you please keep DPDK being able to compile at any point?
Thanks,
Tetsuya,
PATCH v5 5/9 null: export eth_dev_null_create
In reply to Tomasz Kulasek--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/null/rte_eth_null.h | 40 +++++++++++++++++++++++++++++ drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.h
drivers/net/null/Makefile +1 -1
@@ -51,7 +51,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += rte_eth_null.c # # Export include files # -SYMLINK-y-include += +SYMLINK-y-include += rte_eth_null.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf
drivers/net/null/rte_eth_null.c +1 -1
@@ -491,7 +491,7 @@ static const struct eth_dev_ops ops = { .rss_hash_conf_get = eth_rss_hash_conf_get }; -static int +int eth_dev_null_create(const char *name, const unsigned numa_node, unsigned packet_size,
drivers/net/null/rte_eth_null.h new file +40 -0
@@ -0,0 +1,40 @@ +/*- +* BSD LICENSE +* +* Copyright(c) 2015 Intel Corporation. All rights reserved. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of Intel Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef RTE_ETH_NULL_H_ +#define RTE_ETH_NULL_H_ + +int eth_dev_null_create (const char *name,const unsigned numa_node, +unsigned packet_size,unsigned packet_copy); + +#endif /* RTE_ETH_NULL_H_ */
drivers/net/null/rte_pmd_null_version.map +7 -0
@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.2 { + global: + + eth_dev_null_create; + +} DPDK_2.0;
Signature · 1 line
1.7.9.5
Re: [PATCH v5 5/9] null: export eth_dev_null_create
Quoted 8 lines · Tomasz Kulasek
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/null/rte_eth_null.h | 40 +++++++++++++++++++++++++++++ drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.h
Re: [PATCH v5 5/9] null: export eth_dev_null_create
Quoted 12 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tetsuya Mukawa
Sent: Wednesday, October 14, 2015 3:35 AM
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 5/9] null: exporteth_dev_null_createQuoted 5 lines · Tomasz Kulasek
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/null/rte_eth_null.h | 40
Quoted 5 lines
+++++++++++++++++++++++++++++
Quoted 3 lines
drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.hAcked-by Tetsuya Mukawa <[email protected]>
Hi Tetsuya,
Thank You for a review and acking patches.
There are 5 remaining patches in a patch-set:
[dpdk-dev] [PATCH v5 1/9] bonding: rss dynamic configuration [dpdk-dev] [PATCH v5 6/9] test: dynamic rss configuration [dpdk-dev] [PATCH v5 7/9] bonding: per queue stats [dpdk-dev] [PATCH v5 8/9] doc: fixed spellings and typos [dpdk-dev] [PATCH v5 9/9] doc: dynamic rss configuration for bonding
Could You also review them and ack if You agree with that implementation, please?
Re: [PATCH v5 5/9] null: export eth_dev_null_create
Quoted 21 lines · MichalX K
Quoted 12 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tetsuya Mukawa
Sent: Wednesday, October 14, 2015 3:35 AM
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 5/9] null: exporteth_dev_null_createQuoted 5 lines · Tomasz Kulasek
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/null/rte_eth_null.h | 40Quoted 5 lines
+++++++++++++++++++++++++++++
Quoted 3 lines
drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.hAcked-by Tetsuya Mukawa <[email protected]>Hi Tetsuya,
Thank You for a review and acking patches.
There are 5 remaining patches in a patch-set:
Quoted 7 lines
[dpdk-dev] [PATCH v5 1/9] bonding: rss dynamic configuration [dpdk-dev] [PATCH v5 6/9] test: dynamic rss configuration [dpdk-dev] [PATCH v5 7/9] bonding: per queue stats [dpdk-dev] [PATCH v5 8/9] doc: fixed spellings and typos [dpdk-dev] [PATCH v5 9/9] doc: dynamic rss configuration for bonding
Could You also review them and ack if You agree with that implementation, please?
Hi MichalX,
I've checked above patches. But I am sorry that I am not a correct person to ack your patches.
To review it correctly, at least knowledge about RSS and bonding PMD are needed, but honestly I am not familiar with RSS.
Is it possible to find a correct person who can ack it?
BTW, I've checked the patch from the following point of view. It may help other reviewers.
(I've checked after fixing null PMD issues I've found today, please check an email I've sent to Tomasz)
- No fatal errors are reported by checkpatch.pl.
- Some style warnings are reported, but I guess we can ignore it.
- No compile error with gcc-4.6/4.7/4.8/4.9/5, clang and icc.
- No missing symbol.
- No compile error for docs.
- No compile error for examples.
Thanks,
Tetsuya
Re: [PATCH v5 5/9] null: export eth_dev_null_create
Quoted 57 lines
-----Original Message-----
From: Tetsuya Mukawa [mailto:[email protected]]
Sent: Thursday, October 15, 2015 10:17 AM
To: Jastrzebski, MichalX K
Cc: Glynn, Michael J; Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 5/9] null: exporteth_dev_null_createQuoted 21 lines · MichalX K
Quoted 12 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tetsuya Mukawa
Sent: Wednesday, October 14, 2015 3:35 AM
To: Kulasek, TomaszX; [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 5/9] null: exporteth_dev_null_createQuoted 5 lines · Tomasz Kulasek
Signed-off-by Tomasz Kulasek <[email protected]>--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/null/rte_eth_null.h | 40Quoted 5 lines
+++++++++++++++++++++++++++++
Quoted 3 lines
drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.hAcked-by Tetsuya Mukawa <[email protected]>Hi Tetsuya,
Thank You for a review and acking patches.
There are 5 remaining patches in a patch-set:Quoted 7 lines
[dpdk-dev] [PATCH v5 1/9] bonding: rss dynamic configuration [dpdk-dev] [PATCH v5 6/9] test: dynamic rss configuration [dpdk-dev] [PATCH v5 7/9] bonding: per queue stats [dpdk-dev] [PATCH v5 8/9] doc: fixed spellings and typos [dpdk-dev] [PATCH v5 9/9] doc: dynamic rss configuration for bonding
Could You also review them and ack if You agree with that implementation,
please?
Hi MichalX,
I've checked above patches. But I am sorry that I am not a correct person to ack your patches.
To review it correctly, at least knowledge about RSS and bonding PMD are needed, but honestly I am not familiar with RSS.
Is it possible to find a correct person who can ack it?BTW, I've checked the patch from the following point of view. It may help other reviewers.
(I've checked after fixing null PMD issues I've found today, please check an email I've sent to Tomasz)
- No fatal errors are reported by checkpatch.pl.
- Some style warnings are reported, but I guess we can ignore it.
- No compile error with gcc-4.6/4.7/4.8/4.9/5, clang and icc.
- No missing symbol.
- No compile error for docs.
- No compile error for examples.
Quoted 2 lines
Thanks,
Tetsuya
Hi Tetsuya,
Thank You very much for verifications and Your comments. I will ask maintainers in term of reviewing remaining patches.
Regarding an issue with rte_eth_null.h I think that reordering of patches 4 and 5 may be sufficient.
Best regards
Michal
PATCH v5 6/9 test: dynamic rss configuration
In reply to Tomasz Kulasek--- app/test/Makefile | 8 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++++++++++++++++ 2 files changed, 687 insertions(+) create mode 100644 app/test/test_link_bonding_rssconf.c
app/test/Makefile +8 -0
@@ -138,6 +138,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c endif SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
@@ -168,6 +169,13 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) LDLIBS += -lrte_pmd_ring endif endif +ifneq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) +$(error Link bonding rssconf tests require CONFIG_RTE_LIBRTE_PMD_NULL=y) +else +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +LDLIBS += -lrte_pmd_null +endif +endif endif include $(RTE_SDK)/mk/rte.app.mk
app/test/test_link_bonding_rssconf.c new file +679 -0
679 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 7/9 bonding: per queue stats
In reply to Tomasz KulasekThis patch fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port.
v5 changes:
- removed queue_stats_mapping_set from eth_dev_ops of bonding device
--- drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +10 -1
@@ -1801,7 +1801,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) {struct bond_dev_private *internals = dev->data->dev_private;struct rte_eth_stats slave_stats; -int i; +int i, j;for (i =0 ; i < internals->slave_count; i++) {rte_eth_stats_get (internals->slaves[i].port_id, &slave_stats);
@@ -1820,6 +1820,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + +for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_opackets[j]; + stats->q_ibytes[j] += slave_stats.q_ibytes[j]; + stats->q_obytes[j] += slave_stats.q_obytes[j]; + stats->q_errors[j] += slave_stats.q_errors[j]; + } + } }
Signature · 1 line
1.7.9.5
PATCH v5 8/9 doc: fixed spellings and typos
In reply to Tomasz Kulasek--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +4 -4
@@ -188,7 +188,7 @@ conditions are not met. If a user wishes to monitor individual slaves then they must register callbacks with that slave directly. The link bonding library also supports devices which do not implement link -status change interrupts, this is achieve by polling the devices link status at +status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` API, the default polling interval is 10ms. When a device is added as a slave to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
@@ -286,7 +286,7 @@ and UDP protocols for load balancing. Using Link Bonding Devices -------------------------- -The librte_pmd_bond library support two modes of device creation, the libraries +The librte_pmd_bond library supports two modes of device creation, the libraries export full C API or using the EAL command line to statically configure link bonding devices at application startup. Using the EAL option it is possible to use link bonding functionality transparently without specific knowledge of the
@@ -299,7 +299,7 @@ Using the Poll Mode Driver from an Application Using the librte_pmd_bond libraries API it is possible to dynamically create and manage link bonding device from within any application. Link bonding -device are created using the ``rte_eth_bond_create`` API which requires a +devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the link bonding mode to initial the device in and finally the socket Id which to allocate the devices resources onto. After successful creation of a bonding device it must be configured using the generic Ethernet
@@ -362,7 +362,7 @@ The different options are: mode=2 * slave: Defines the PMD device which will be added as slave to the bonded - device. This option can be selected multiple time, for each device to be + device. This option can be selected multiple times, for each device to be added as a slave. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function
Signature · 1 line
1.7.9.5
PATCH v5 9/9 doc: dynamic rss configuration for bonding
In reply to Tomasz KulasekDocumentation update about implementation details and requirements for Dynamic RSS Configuration for Bonding.
--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +32 -2
@@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,28 @@ After a slave device is added to a bonded device slave is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding -device. +device. If RSS is enabled for bonding device, this mode is also enabled on new +slave and configured as well. + +Setting up multi-queue mode for bonding device to RSS, makes it fully +RSS-capable, so all slaves are synchronized with its configuration. This mode is +intended to provide RSS configuration on slaves transparent for client +application implementation. + +Bonding device stores its own version of RSS settings i.e. RETA, RSS hash +function and RSS key, used to set up its slaves. That let to define the meaning +of RSS configuration of bonding device as desired configuration of whole bonding +(as one unit), without pointing any of slave inside. It is required to ensure +consistency and made it more errorproof. + +RSS hash function set for bonding device, is a maximal set of RSS hash functions +supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if slave +RETAs' sizes are different. If RSS Key is not set for bonded device, it's not +changed on the slaves and default key for device is used. + +All settings are managed through the bonding port API and always are propagated +in one direction (from bonding to slaves). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +228,15 @@ these parameters. A bonding device must have a minimum of one slave before the bonding device itself can be started. +To use a bonding device dynamic RSS configuration feature effectively, it is +also required, that all slaves should be RSS-capable and support, at least one +common hash function available for each of them. Changing RSS key is only +possible, when all slave devices support the same key size. + +To prevent inconsistency on how slaves process packets, once a device is added +to a bonding device, RSS configuration should be managed through the bonding +device API, and not directly on the slave. + Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object.
Signature · 1 line
1.7.9.5
v6 cover Dynamic RSS Configuration for Bonding
In reply to Tomasz KulasekOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.
Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v6 changes:
- patchset reordered
- fixed forward dependency between patch 4/9 and 5/9
v5 changes:
- updated to DPDK 2.2
- removed copyright change from null device source
- removed queue_stats_mapping_set from eth_dev_ops of bonding device
- null pmd cleanups (removed unnecessary malloc, replaced memcpy with rte_memcpy)
- fixed queues number configuration in null pmd
v4 changes:
- fixed copy-paste error,
- removed example application as too complex and introducing a new dependency,
- addapted null pmd to be used as testing device for dynamic RSS configuration,
- addapted test units to use null pmd instead of ring pmd,
- ring pmd is not used and changed in this patchset
v3 changes:
- checkpatch cleanups
v2 changes:
- added support for keys other than 40 bytes long,
- now, if RSS key is not set for bonding, it is not set also for slaves,
- fix - full initial RSS configuration before any slave is added was not possible due to the initially zeroed flow_type_rss_offloads for bonding,
- fix - changed error to warning when slave is synchronizing due to the bonding's initial configuration (to allow use slaves' drivers not supporting dynamic RSS configuration in bonding),
- some code cleanups,
- updated documentation,
Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault when null_pmd added to bonding
null: extend number of virtual queues
null: export eth_dev_null_create
null: virtual dynamic rss configuration
test: dynamic rss configuration
bonding: per queue stats
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
app/test/Makefile | 8 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 28 + drivers/net/bonding/rte_eth_bond_pmd.c | 216 ++++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 149 ++++- drivers/net/null/rte_eth_null.h | 40 ++ drivers/net/null/rte_pmd_null_version.map | 7 + 10 files changed, 1151 insertions(+), 32 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 drivers/net/null/rte_eth_null.h
Signature · 1 line
1.7.9.5
PATCH v6 1/9 bonding: rss dynamic configuration
Bonding device implements independent management of RSS settings. It stores its own copies of settings i.e. RETA, RSS hash function and RSS key. It’s required to ensure consistency.
1) RSS hash function set for bonding device is maximal set of RSS hash functions supported by all bonded devices. That mean, to have RSS support for bonding, all slaves should be RSS-capable.
2) RSS key is propagated over the slaves "as is".
3) RETA for bonding is an internal table managed by bonding API, and is used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so it can be easily used as a pattern providing expected behavior, even if slaves RETA sizes are different.
--- drivers/net/bonding/rte_eth_bond_api.c | 28 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 205 ++++++++++++++++++++++++++-- drivers/net/bonding/rte_eth_bond_private.h | 12 ++ 3 files changed, 231 insertions(+), 14 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +28 -0
@@ -273,6 +273,9 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; +/* Initially allow to choose any offload type */ + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; +memset (internals->active_slaves,0 ,sizeof (internals->active_slaves));memset (internals->slaves,0 ,sizeof (internals->slaves));
@@ -369,6 +372,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)rte_eth_dev_info_get (slave_port_id, &dev_info); +/* We need to store slaves reta_size to be able to synchronize RETA for all +* slave devices even if its sizes are different. +*/ + internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; +if (internals->slave_count <1 ) {/* if MAC is not user defined then use MAC of first slave add to * bonded device */
@@ -382,9 +390,16 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)/* Make primary slave */ internals->primary_port = slave_port_id; +/* Inherit queues settings from first slave */ + internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + + internals->reta_size = dev_info.reta_size; +/* Take the first dev's offload capabilities */ internals->rx_offload_capa = dev_info.rx_offload_capa; internals->tx_offload_capa = dev_info.tx_offload_capa; + internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; }else {/* Check slave link properties are supported if props are set,
@@ -403,8 +418,19 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; + internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; + +/* RETA size is GCD of all slaves RETA sizes, so, if all sizes will be +* the power of 2, the lower one is GCD +*/ +if (internals->reta_size > dev_info.reta_size) + internals->reta_size = dev_info.reta_size; + } + bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= + internals->flow_type_rss_offloads; + internals->slave_count++;/* Update all slave devices MACs*/
@@ -531,6 +557,8 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)if (internals->slave_count ==0 ) { internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =0 ; }return 0 ; }
drivers/net/bonding/rte_eth_bond_pmd.c +191 -14
236 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +12 -0
@@ -103,6 +103,8 @@ struct bond_slave_details {uint8_t last_link_status;/**< Port Id of slave eth_dev */ struct ether_addr persisted_mac_addr; + +uint16_t reta_size; };
@@ -155,6 +157,16 @@ struct bond_dev_private {uint32_t rx_offload_capa;/** Rx offload capability */ uint32_t tx_offload_capa;/** Tx offload capability */ +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_512 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[52 ];/**< 52-byte hash key buffer. */ +uint8_t rss_key_len;/**< hash key length in bytes. */ +struct rte_kvargs *kvlist;uint8_t slave_update_idx; };
Signature · 1 line
1.7.9.5
PATCH v6 2/9 null: fix segfault when null_pmd added to bonding
In reply to Tomasz KulasekThis patch initializes eth_dev->link_intr_cbs queue used when null pmd is added to the bonding.
v5 changes:
- removed unnecessary malloc for eth_driver (rte_null_pmd)
--- drivers/net/null/rte_eth_null.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/null/rte_eth_null.c +2 -0
@@ -432,6 +432,7 @@ eth_dev_null_create(const char *name, internals->numa_node = numa_node; pci_dev->numa_node = numa_node; + pci_dev->driver = &rte_null_pmd.pci_drv; data->dev_private = internals; data->port_id = eth_dev->data->port_id;
@@ -445,6 +446,7 @@ eth_dev_null_create(const char *name, eth_dev->dev_ops = &ops; eth_dev->pci_dev = pci_dev; eth_dev->driver = &rte_null_pmd; +TAILQ_INIT (ð_dev->link_intr_cbs);/* finally assign rx and tx ops */ if (packet_copy) {
Signature · 1 line
1.7.9.5
Re: [PATCH v6 2/9] null: fix segfault when null_pmd added to bonding
Hi,
There is no change in v6 for this patch which was acked by Tetsuya. So why not keep the Acked-by below your Signed-off-by?
It seems patches 2, 3, 4 and 5 were Acked by Tetsuya. Other acks I'm missing?
2015-10-16 12:00, Tomasz Kulasek:
Quoted 7 lines
This patch initializes
eth_dev->link_intr_cbsqueue used when null pmd is added to the bonding.v5 changes:
- removed unnecessary malloc foreth_driver(rte_null_pmd)Signed-off-by Tomasz Kulasek <[email protected]>
Re: [PATCH v6 2/9] null: fix segfault when null_pmd added to bonding
Quoted 9 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, October 27, 2015 17:59
To: Kulasek, TomaszX
Cc: [email protected]; Tetsuya Mukawa
Subject: Re: [dpdk-dev] [PATCH v6 2/9] null: fix segfault whennull_pmdadded to bonding
Quoted 7 lines
Hi,
There is no change in v6 for this patch which was acked by Tetsuya. So why not keep the Acked-by below your Signed-off-by?It seems patches 2, 3, 4 and 5 were Acked by Tetsuya. Other acks I'm missing?
Hi,
Patches 4 and 5 were changed due to the Tetsuya's suggestions and already reviewed. There are not big changes, but I'm not sure if it should be reacked by Tetsuya, or I can just copy ack?
Tomasz
Re: [PATCH v6 2/9] null: fix segfault when null_pmd added to bonding
Quoted 12 lines · TomaszX
Quoted 12 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, October 27, 2015 17:59
To: Kulasek, TomaszX
Cc: [email protected]; Tetsuya Mukawa
Subject: Re: [dpdk-dev] [PATCH v6 2/9] null: fix segfault whennull_pmdadded to bondingHi,
There is no change in v6 for this patch which was acked by Tetsuya. So why not keep the Acked-by below your Signed-off-by?
Quoted 8 lines
Quoted 3 lines
It seems patches 2, 3, 4 and 5 were Acked by Tetsuya. Other acks I'm missing?
Hi,
Patches 4 and 5 were changed due to the Tetsuya's suggestions and already reviewed. There are not big changes, but I'm not sure if it should be reacked by Tetsuya, or I can just copy ack?
Tomasz
Hi Tomasz,
Could you please check Bernard's patch series?
- [PATCH v5 00/28] remove pci driver from vdevs
He tries to remove pci_drv from PMD.
It seems your below patch will be affected by his patch.
- null: fix segfault when null_pmd added to bonding
I just wonder your bonding RSS patch works without below fixing. drivers/net/null/rte_eth_null.c :
+ pci_dev->driver = &rte_null_pmd.pci_drv;
Anyway, Could you please check him patches?
Thanks,
Tetsuya
Re: [PATCH v6 2/9] null: fix segfault when null_pmd added to bonding
Quoted 42 lines
-----Original Message-----
From: Tetsuya Mukawa [mailto:[email protected]]
Sent: Thursday, October 29, 2015 08:19
To: Kulasek, TomaszX
Cc: Thomas Monjalon; [email protected]
Subject: Re: [dpdk-dev] [PATCH v6 2/9] null: fix segfault whennull_pmdadded to bondingQuoted 12 lines · TomaszX
Quoted 12 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, October 27, 2015 17:59
To: Kulasek, TomaszX
Cc: [email protected]; Tetsuya Mukawa
Subject: Re: [dpdk-dev] [PATCH v6 2/9] null: fix segfault whennull_pmdadded to bondingHi,
There is no change in v6 for this patch which was acked by Tetsuya. So why not keep the Acked-by below your Signed-off-by?Quoted 6 lines
Quoted 3 lines
It seems patches 2, 3, 4 and 5 were Acked by Tetsuya. Other acks I'm missing?
Hi,
Patches 4 and 5 were changed due to the Tetsuya's suggestions and
already reviewed. There are not big changes, but I'm not sure if it should be reacked by Tetsuya, or I can just copy ack?
Quoted 2 lines
Tomasz
Hi Tomasz,
Could you please check Bernard's patch series?
- [PATCH v5 00/28] remove pci driver from vdevs He tries to removepci_drvfrom PMD.It seems your below patch will be affected by his patch.
- null: fix segfault whennull_pmdadded to bonding
Quoted 8 lines
I just wonder your bonding RSS patch works without below fixing.
drivers/net/null/rte_eth_null.c:
+pci_dev->driver= &rte_null_pmd.pci_drv;Anyway, Could you please check him patches?
Thanks,
Tetsuya
Hi Tetsuya,
I've just checked Bernard's patches and it seems that it can be safely removed from here. It's not used in RSS implementation, so have no impact on it.
I'm sending patchset v7 with copied your acks, as Thomas suggested, if you have no other objections.
Tomasz
PATCH v6 3/9 null: extend number of virtual queues
In reply to Tomasz KulasekThis patch adds a possibility to configure more than one queue on null device.
v5 changes:
- fixed queues number configuration (using internals->nb_*_queues instead of dev->data->nb_*_queues)
--- drivers/net/null/rte_eth_null.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/net/null/rte_eth_null.c +19 -9
@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };
@@ -178,7 +178,15 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) }static int -eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; } +eth_dev_configure (struct rte_eth_dev *dev) { +struct pmd_internals *internals; + + internals = dev->data->dev_private; + internals->nb_rx_queues = dev->data->nb_rx_queues; + internals->nb_tx_queues = dev->data->nb_tx_queues; + +return 0 ; +}static int eth_dev_start (struct rte_eth_dev *dev)
@@ -213,10 +221,11 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (rx_queue_id >= internals->nb_rx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;
@@ -246,10 +255,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (tx_queue_id >= internals->nb_tx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; dev->data->tx_queues[tx_queue_id] =
@@ -279,8 +289,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }
Signature · 1 line
1.7.9.5
PATCH v6 4/9 null: export eth_dev_null_create
In reply to Tomasz Kulasekv6 changes:
- reordered with patch 5/9
- fixed forward dependency to the patch 5/9
--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 4 ++- drivers/net/null/rte_eth_null.h | 40 +++++++++++++++++++++++++++++ drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.h
drivers/net/null/Makefile +1 -1
@@ -51,7 +51,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += rte_eth_null.c # # Export include files # -SYMLINK-y-include += +SYMLINK-y-include += rte_eth_null.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf
drivers/net/null/rte_eth_null.c +3 -1
@@ -38,6 +38,8 @@#include <rte_dev.h> #include <rte_kvargs.h> +#include "rte_eth_null.h" +#define ETH_NULL_PACKET_SIZE_ARG "size"#define ETH_NULL_PACKET_COPY_ARG "copy"
@@ -387,7 +389,7 @@ static const struct eth_dev_ops ops = { .stats_reset = eth_stats_reset, }; -static int +int eth_dev_null_create(const char *name, const unsigned numa_node, unsigned packet_size,
drivers/net/null/rte_eth_null.h new file +40 -0
@@ -0,0 +1,40 @@ +/*- +* BSD LICENSE +* +* Copyright(c) 2015 Intel Corporation. All rights reserved. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of Intel Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef RTE_ETH_NULL_H_ +#define RTE_ETH_NULL_H_ + +int eth_dev_null_create (const char *name,const unsigned numa_node, +unsigned packet_size,unsigned packet_copy); + +#endif /* RTE_ETH_NULL_H_ */
drivers/net/null/rte_pmd_null_version.map +7 -0
@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.2 { + global: + + eth_dev_null_create; + +} DPDK_2.0;
Signature · 1 line
1.7.9.5
PATCH v6 5/9 null: virtual dynamic rss configuration
In reply to Tomasz KulasekThis implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
v6 changes:
- reordered with patch 4/9
- recreated due to the changes in patch 4/9
v5 changes:
- replaced memcpy with rte_memcpy
--- drivers/net/null/rte_eth_null.c | 115 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+)
drivers/net/null/rte_eth_null.c +115 -0
@@ -37,6 +37,7 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_spinlock.h> #include "rte_eth_null.h"
@@ -75,6 +76,17 @@ struct pmd_internals {struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ];struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; + +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +rte_spinlock_t rss_lock; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ };
@@ -295,6 +307,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; + dev_info->reta_size = internals->reta_size; + dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; } static void
@@ -375,6 +389,91 @@ static int eth_link_update(struct rte_eth_dev *dev __rte_unused, int wait_to_complete __rte_unused) { return 0; } +static int +eth_rss_reta_update (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { + internal->reta_conf[i].mask = reta_conf[i].mask; +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + internal->reta_conf[i].reta[j] = reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_reta_query (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + reta_conf[i].reta[j] = internal->reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_update (struct rte_eth_dev *dev,struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key) +rte_memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key) +rte_memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -387,6 +486,10 @@ static const struct eth_dev_ops ops = { .link_update = eth_link_update, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, + .reta_update = eth_rss_reta_update, + .reta_query = eth_rss_reta_query, + .rss_hash_update = eth_rss_hash_update, + .rss_hash_conf_get = eth_rss_hash_conf_get };int
@@ -402,6 +505,13 @@ eth_dev_null_create(const char *name,struct pmd_internals *internals =NULL ;struct rte_eth_dev *eth_dev =NULL ; +static const uint8_t default_rss_key[40 ] = { +0x6D ,0x5A ,0x56 ,0xDA ,0x25 ,0x5B ,0x0E ,0xC2 ,0x41 ,0x67 ,0x25 ,0x3D , +0x43 ,0xA3 ,0x8F ,0xB0 ,0xD0 ,0xCA ,0x2B ,0xCB ,0xAE ,0x7B ,0x30 ,0xB4 , +0x77 ,0xCB ,0x2D ,0xA3 ,0x80 ,0x30 ,0xF2 ,0x0C ,0x6A ,0x42 ,0xB7 ,0x3B , +0xBE ,0xAC ,0x01 ,0xFA + }; +if (name ==NULL )return -EINVAL ;
@@ -443,6 +553,11 @@ eth_dev_null_create(const char *name, internals->packet_copy = packet_copy; internals->numa_node = numa_node; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ; + +rte_memcpy (internals->rss_key, default_rss_key,40 ); + pci_dev->numa_node = numa_node; pci_dev->driver = &rte_null_pmd.pci_drv;
Signature · 1 line
1.7.9.5
PATCH v6 6/9 test: dynamic rss configuration
In reply to Tomasz Kulasek--- app/test/Makefile | 8 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++++++++++++++++ 2 files changed, 687 insertions(+) create mode 100644 app/test/test_link_bonding_rssconf.c
app/test/Makefile +8 -0
@@ -138,6 +138,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c endif SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
@@ -168,6 +169,13 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) LDLIBS += -lrte_pmd_ring endif endif +ifneq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) +$(error Link bonding rssconf tests require CONFIG_RTE_LIBRTE_PMD_NULL=y) +else +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +LDLIBS += -lrte_pmd_null +endif +endif endif include $(RTE_SDK)/mk/rte.app.mk
app/test/test_link_bonding_rssconf.c new file +679 -0
679 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Re: [PATCH v6 6/9] test: dynamic rss configuration
This new test depends on null PMD.
The dependency should be checked gracefully, see below.
2015-10-16 12:00, Tomasz Kulasek:
app/test/Makefile SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c · line 140
Quoted 6 lines
app/test/Makefile +0
-0@@ -138,6 +138,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c
Why not enclose in ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y)?
app/test/Makefile ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) · line 173
Quoted 10 lines
app/test/Makefile +3
-0+SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c endif SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c@@ -168,6 +169,13 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) LDLIBS += -lrte_pmd_ring endif endif +ifneq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) +$(error Link bonding rssconf tests require CONFIG_RTE_LIBRTE_PMD_NULL=y)
Not needed if handled as suggested above.
The build should not fail because a module is disabled.
Quoted 5 lines
app/test/Makefile +5
-0+else +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +LDLIBS += -lrte_pmd_null +endif +endif
PATCH v6 7/9 bonding: per queue stats
In reply to Tomasz KulasekThis patch adds fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port.
v5 changes:
- removed queue_stats_mapping_set from eth_dev_ops of bonding device
--- drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +10 -1
@@ -1801,7 +1801,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) {struct bond_dev_private *internals = dev->data->dev_private;struct rte_eth_stats slave_stats; -int i; +int i, j;for (i =0 ; i < internals->slave_count; i++) {rte_eth_stats_get (internals->slaves[i].port_id, &slave_stats);
@@ -1820,6 +1820,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + +for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_opackets[j]; + stats->q_ibytes[j] += slave_stats.q_ibytes[j]; + stats->q_obytes[j] += slave_stats.q_obytes[j]; + stats->q_errors[j] += slave_stats.q_errors[j]; + } + } }
Signature · 1 line
1.7.9.5
PATCH v6 8/9 doc: fixed spellings and typos
In reply to Tomasz Kulasek--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +4 -4
@@ -188,7 +188,7 @@ conditions are not met. If a user wishes to monitor individual slaves then they must register callbacks with that slave directly. The link bonding library also supports devices which do not implement link -status change interrupts, this is achieve by polling the devices link status at +status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` API, the default polling interval is 10ms. When a device is added as a slave to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
@@ -286,7 +286,7 @@ and UDP protocols for load balancing. Using Link Bonding Devices -------------------------- -The librte_pmd_bond library support two modes of device creation, the libraries +The librte_pmd_bond library supports two modes of device creation, the libraries export full C API or using the EAL command line to statically configure link bonding devices at application startup. Using the EAL option it is possible to use link bonding functionality transparently without specific knowledge of the
@@ -299,7 +299,7 @@ Using the Poll Mode Driver from an Application Using the librte_pmd_bond libraries API it is possible to dynamically create and manage link bonding device from within any application. Link bonding -device are created using the ``rte_eth_bond_create`` API which requires a +devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the link bonding mode to initial the device in and finally the socket Id which to allocate the devices resources onto. After successful creation of a bonding device it must be configured using the generic Ethernet
@@ -362,7 +362,7 @@ The different options are: mode=2 * slave: Defines the PMD device which will be added as slave to the bonded - device. This option can be selected multiple time, for each device to be + device. This option can be selected multiple times, for each device to be added as a slave. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function
Signature · 1 line
1.7.9.5
PATCH v6 9/9 doc: dynamic rss configuration for bonding
In reply to Tomasz KulasekDocumentation update about implementation details and requirements for Dynamic RSS Configuration for Bonding.
--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +32 -2
@@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,28 @@ After a slave device is added to a bonded device slave is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding -device. +device. If RSS is enabled for bonding device, this mode is also enabled on new +slave and configured as well. + +Setting up multi-queue mode for bonding device to RSS, makes it fully +RSS-capable, so all slaves are synchronized with its configuration. This mode is +intended to provide RSS configuration on slaves transparent for client +application implementation. + +Bonding device stores its own version of RSS settings i.e. RETA, RSS hash +function and RSS key, used to set up its slaves. That let to define the meaning +of RSS configuration of bonding device as desired configuration of whole bonding +(as one unit), without pointing any of slave inside. It is required to ensure +consistency and made it more errorproof. + +RSS hash function set for bonding device, is a maximal set of RSS hash functions +supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if slave +RETAs' sizes are different. If RSS Key is not set for bonded device, it's not +changed on the slaves and default key for device is used. + +All settings are managed through the bonding port API and always are propagated +in one direction (from bonding to slaves). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +228,15 @@ these parameters. A bonding device must have a minimum of one slave before the bonding device itself can be started. +To use a bonding device dynamic RSS configuration feature effectively, it is +also required, that all slaves should be RSS-capable and support, at least one +common hash function available for each of them. Changing RSS key is only +possible, when all slave devices support the same key size. + +To prevent inconsistency on how slaves process packets, once a device is added +to a bonding device, RSS configuration should be managed through the bonding +device API, and not directly on the slave. + Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object.
Signature · 1 line
1.7.9.5
Quoted 73 lines · Tomasz Kulasek
OVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device toETH_MQ_RX_RSSmakes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.2) If .rxmode.mq_mode for bonding device isn't
ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v6 changes:
- patchset reordered
- fixed forward dependency between patch 4/9 and 5/9v5 changes:
- updated to DPDK 2.2
- removed copyright change from null device source
- removedqueue_stats_mapping_setfrometh_dev_opsof bonding device
- null pmd cleanups (removed unnecessary malloc, replaced memcpy withrte_memcpy)
- fixed queues number configuration in null pmdv4 changes:
- fixed copy-paste error,
- removed example application as too complex and introducing a new dependency,
- addapted null pmd to be used as testing device for dynamic RSS configuration,
- addapted test units to use null pmd instead of ring pmd,
- ring pmd is not used and changed in this patchsetv3 changes:
- checkpatch cleanupsv2 changes:
- added support for keys other than 40 bytes long,
- now, if RSS key is not set for bonding, it is not set also for slaves,
- fix - full initial RSS configuration before any slave is added was not possible due to the initially zeroedflow_type_rss_offloadsfor bonding,
- fix - changed error to warning when slave is synchronizing due to the bonding's initial configuration (to allow use slaves' drivers not supporting dynamic RSS configuration in bonding),
- some code cleanups,
- updated documentation,Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault whennull_pmdadded to bonding
null: extend number of virtual queues
null: exporteth_dev_null_create
null: virtual dynamic rss configuration
test: dynamic rss configuration
bonding: per queue stats
doc: fixed spellings and typos
doc: dynamic rss configuration for bondingapp/test/Makefile | 8 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 28 + drivers/net/bonding/rte_eth_bond_pmd.c | 216 ++++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 149 ++++- drivers/net/null/rte_eth_null.h | 40 ++ drivers/net/null/rte_pmd_null_version.map | 7 + 10 files changed, 1151 insertions(+), 32 deletions(-)
Quoted 3 lines
create mode 100644
app/test/test_link_bonding_rssconf.ccreate mode 100644drivers/net/null/rte_eth_null.h
Series Acked-by: Declan Doherty <[email protected]>
v7 cover Dynamic RSS Configuration for Bonding
In reply to Tomasz KulasekOVERVIEW
--------
1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes bonding device fully RSS-capable, so all slaves are synchronized with its configuration. This mode is intended to provide RSS configuration as known from "dynamic RSS configuration for one port" and made slaves transparent for client application implementation.
2) If .rxmode.mq_mode for bonding device isn't ETH_MQ_RX_RSS, slaves are not synchronized. That provides an ability to configure them manually. This mode may be useful when application wants to manage RSS in an unusual way and the consistency of RSS configuration for slaves isn't required.
Turning on/off RSS mode for slaves when bonding is started is not possible. Other RSS configuration is propagated over slaves, when bonding device API is used to do it.
v7 changes:
- Makefile for test application changed to not fail when requirements for test units not met
v6 changes:
- patchset reordered
- fixed forward dependency between patch 4/9 and 5/9
v5 changes:
- updated to DPDK 2.2
- removed copyright change from null device source
- removed queue_stats_mapping_set from eth_dev_ops of bonding device
- null pmd cleanups (removed unnecessary malloc, replaced memcpy with rte_memcpy)
- fixed queues number configuration in null pmd
v4 changes:
- fixed copy-paste error,
- removed example application as too complex and introducing a new dependency,
- addapted null pmd to be used as testing device for dynamic RSS configuration,
- addapted test units to use null pmd instead of ring pmd,
- ring pmd is not used and changed in this patchset
v3 changes:
- checkpatch cleanups
v2 changes:
- added support for keys other than 40 bytes long,
- now, if RSS key is not set for bonding, it is not set also for slaves,
- fix - full initial RSS configuration before any slave is added was not possible due to the initially zeroed flow_type_rss_offloads for bonding,
- fix - changed error to warning when slave is synchronizing due to the bonding's initial configuration (to allow use slaves' drivers not supporting dynamic RSS configuration in bonding),
- some code cleanups,
- updated documentation,
Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault when null_pmd added to bonding
null: extend number of virtual queues
null: export eth_dev_null_create
null: virtual dynamic rss configuration
test: dynamic rss configuration
bonding: per queue stats
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
app/test/Makefile | 7 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++ .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 42 +- drivers/net/bonding/rte_eth_bond_api.c | 28 + drivers/net/bonding/rte_eth_bond_pmd.c | 216 ++++++- drivers/net/bonding/rte_eth_bond_private.h | 12 + drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 149 ++++- drivers/net/null/rte_eth_null.h | 40 ++ drivers/net/null/rte_pmd_null_version.map | 7 + 10 files changed, 1150 insertions(+), 32 deletions(-) create mode 100644 app/test/test_link_bonding_rssconf.c create mode 100644 drivers/net/null/rte_eth_null.h
Signature · 1 line
1.7.9.5
PATCH v7 1/9 bonding: rss dynamic configuration
Bonding device implements independent management of RSS settings. It stores its own copies of settings i.e. RETA, RSS hash function and RSS key. It’s required to ensure consistency.
1) RSS hash function set for bonding device is maximal set of RSS hash functions supported by all bonded devices. That mean, to have RSS support for bonding, all slaves should be RSS-capable.
2) RSS key is propagated over the slaves "as is".
3) RETA for bonding is an internal table managed by bonding API, and is used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so it can be easily used as a pattern providing expected behavior, even if slaves RETA sizes are different.
--- drivers/net/bonding/rte_eth_bond_api.c | 28 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 205 ++++++++++++++++++++++++++-- drivers/net/bonding/rte_eth_bond_private.h | 12 ++ 3 files changed, 231 insertions(+), 14 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +28 -0
@@ -273,6 +273,9 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; +/* Initially allow to choose any offload type */ + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; +memset (internals->active_slaves,0 ,sizeof (internals->active_slaves));memset (internals->slaves,0 ,sizeof (internals->slaves));
@@ -369,6 +372,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)rte_eth_dev_info_get (slave_port_id, &dev_info); +/* We need to store slaves reta_size to be able to synchronize RETA for all +* slave devices even if its sizes are different. +*/ + internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; +if (internals->slave_count <1 ) {/* if MAC is not user defined then use MAC of first slave add to * bonded device */
@@ -382,9 +390,16 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)/* Make primary slave */ internals->primary_port = slave_port_id; +/* Inherit queues settings from first slave */ + internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + + internals->reta_size = dev_info.reta_size; +/* Take the first dev's offload capabilities */ internals->rx_offload_capa = dev_info.rx_offload_capa; internals->tx_offload_capa = dev_info.tx_offload_capa; + internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads; }else {/* Check slave link properties are supported if props are set,
@@ -403,8 +418,19 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; + internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; + +/* RETA size is GCD of all slaves RETA sizes, so, if all sizes will be +* the power of 2, the lower one is GCD +*/ +if (internals->reta_size > dev_info.reta_size) + internals->reta_size = dev_info.reta_size; + } + bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= + internals->flow_type_rss_offloads; + internals->slave_count++;/* Update all slave devices MACs*/
@@ -531,6 +557,8 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)if (internals->slave_count ==0 ) { internals->rx_offload_capa =0 ; internals->tx_offload_capa =0 ; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =0 ; }return 0 ; }
drivers/net/bonding/rte_eth_bond_pmd.c +191 -14
236 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +12 -0
@@ -103,6 +103,8 @@ struct bond_slave_details {uint8_t last_link_status;/**< Port Id of slave eth_dev */ struct ether_addr persisted_mac_addr; + +uint16_t reta_size; };
@@ -155,6 +157,16 @@ struct bond_dev_private {uint32_t rx_offload_capa;/** Rx offload capability */ uint32_t tx_offload_capa;/** Tx offload capability */ +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_512 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[52 ];/**< 52-byte hash key buffer. */ +uint8_t rss_key_len;/**< hash key length in bytes. */ +struct rte_kvargs *kvlist;uint8_t slave_update_idx; };
Signature · 1 line
1.7.9.5
PATCH v7 2/9 null: fix segfault when null_pmd added to bonding
In reply to Tomasz KulasekThis patch initializes eth_dev->link_intr_cbs queue used when null pmd is added to the bonding.
v5 changes:
- removed unnecessary malloc for eth_driver (rte_null_pmd)
--- drivers/net/null/rte_eth_null.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/null/rte_eth_null.c +2 -0
@@ -432,6 +432,7 @@ eth_dev_null_create(const char *name, internals->numa_node = numa_node; pci_dev->numa_node = numa_node; + pci_dev->driver = &rte_null_pmd.pci_drv; data->dev_private = internals; data->port_id = eth_dev->data->port_id;
@@ -445,6 +446,7 @@ eth_dev_null_create(const char *name, eth_dev->dev_ops = &ops; eth_dev->pci_dev = pci_dev; eth_dev->driver = &rte_null_pmd; +TAILQ_INIT (ð_dev->link_intr_cbs);/* finally assign rx and tx ops */ if (packet_copy) {
Signature · 1 line
1.7.9.5
PATCH v7 3/9 null: extend number of virtual queues
In reply to Tomasz KulasekThis patch adds a possibility to configure more than one queue on null device.
v5 changes:
- fixed queues number configuration (using internals->nb_*_queues instead of dev->data->nb_*_queues)
--- drivers/net/null/rte_eth_null.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/net/null/rte_eth_null.c +19 -9
@@ -71,8 +71,8 @@ struct pmd_internals {unsigned nb_rx_queues;unsigned nb_tx_queues; -struct null_queue rx_null_queues[1 ]; -struct null_queue tx_null_queues[1 ]; +struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; +struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; };
@@ -178,7 +178,15 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) }static int -eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; } +eth_dev_configure (struct rte_eth_dev *dev) { +struct pmd_internals *internals; + + internals = dev->data->dev_private; + internals->nb_rx_queues = dev->data->nb_rx_queues; + internals->nb_tx_queues = dev->data->nb_tx_queues; + +return 0 ; +}static int eth_dev_start (struct rte_eth_dev *dev)
@@ -213,10 +221,11 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,if ((dev ==NULL ) || (mb_pool ==NULL ))return -EINVAL ; -if (rx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (rx_queue_id >= internals->nb_rx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;
@@ -246,10 +255,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,if (dev ==NULL )return -EINVAL ; -if (tx_queue_id !=0 ) + internals = dev->data->dev_private; + +if (tx_queue_id >= internals->nb_tx_queues)return -ENODEV ; - internals = dev->data->dev_private; packet_size = internals->packet_size; dev->data->tx_queues[tx_queue_id] =
@@ -279,8 +289,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->driver_name = drivername; dev_info->max_mac_addrs =1 ; dev_info->max_rx_pktlen = (uint32_t )-1 ; - dev_info->max_rx_queues = (uint16_t )internals->nb_rx_queues; - dev_info->max_tx_queues = (uint16_t )internals->nb_tx_queues; + dev_info->max_rx_queues =RTE_DIM (internals->rx_null_queues); + dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; }
Signature · 1 line
1.7.9.5
PATCH v7 4/9 null: export eth_dev_null_create
In reply to Tomasz Kulasekv6 changes:
- reordered with patch 5/9
- fixed forward dependency to patch patch 5/9
--- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 4 ++- drivers/net/null/rte_eth_null.h | 40 +++++++++++++++++++++++++++++ drivers/net/null/rte_pmd_null_version.map | 7 +++++ 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 drivers/net/null/rte_eth_null.h
drivers/net/null/Makefile +1 -1
@@ -51,7 +51,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += rte_eth_null.c # # Export include files # -SYMLINK-y-include += +SYMLINK-y-include += rte_eth_null.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf
drivers/net/null/rte_eth_null.c +3 -1
@@ -38,6 +38,8 @@#include <rte_dev.h> #include <rte_kvargs.h> +#include "rte_eth_null.h" +#define ETH_NULL_PACKET_SIZE_ARG "size"#define ETH_NULL_PACKET_COPY_ARG "copy"
@@ -387,7 +389,7 @@ static const struct eth_dev_ops ops = { .stats_reset = eth_stats_reset, }; -static int +int eth_dev_null_create(const char *name, const unsigned numa_node, unsigned packet_size,
drivers/net/null/rte_eth_null.h new file +40 -0
@@ -0,0 +1,40 @@ +/*- +* BSD LICENSE +* +* Copyright(c) 2015 Intel Corporation. All rights reserved. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of Intel Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef RTE_ETH_NULL_H_ +#define RTE_ETH_NULL_H_ + +int eth_dev_null_create (const char *name,const unsigned numa_node, +unsigned packet_size,unsigned packet_copy); + +#endif /* RTE_ETH_NULL_H_ */
drivers/net/null/rte_pmd_null_version.map +7 -0
@@ -2,3 +2,10 @@ DPDK_2.0 { local: *; }; + +DPDK_2.2 { + global: + + eth_dev_null_create; + +} DPDK_2.0;
Signature · 1 line
1.7.9.5
PATCH v7 5/9 null: virtual dynamic rss configuration
In reply to Tomasz KulasekThis implementation allows to set and read RSS configuration for null device, and is used to validate right values propagation over the slaves, in test units for dynamic RSS configuration for bonding.
v6 changes:
- reordered with patch 4/9
- recreated due to the changes in patch 4/9
v5 changes:
- replaced memcpy with rte_memcpy
--- drivers/net/null/rte_eth_null.c | 115 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+)
drivers/net/null/rte_eth_null.c +115 -0
@@ -37,6 +37,7 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_kvargs.h> +#include <rte_spinlock.h> #include "rte_eth_null.h"
@@ -75,6 +76,17 @@ struct pmd_internals {struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT ];struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT ]; + +/** Bit mask of RSS offloads, the bit offset also means flow type */ +uint64_t flow_type_rss_offloads; + +rte_spinlock_t rss_lock; + +uint16_t reta_size; +struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 / +RTE_RETA_GROUP_SIZE ]; + +uint8_t rss_key[40 ];/**< 40-byte hash key. */ };
@@ -295,6 +307,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues =RTE_DIM (internals->tx_null_queues); dev_info->min_rx_bufsize =0 ; dev_info->pci_dev =NULL ; + dev_info->reta_size = internals->reta_size; + dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; } static void
@@ -375,6 +389,91 @@ static int eth_link_update(struct rte_eth_dev *dev __rte_unused, int wait_to_complete __rte_unused) { return 0; } +static int +eth_rss_reta_update (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { + internal->reta_conf[i].mask = reta_conf[i].mask; +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + internal->reta_conf[i].reta[j] = reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_reta_query (struct rte_eth_dev *dev, +struct rte_eth_rss_reta_entry64 *reta_conf,uint16_t reta_size) +{ +int i, j; +struct pmd_internals *internal = dev->data->dev_private; + +if (reta_size != internal->reta_size) +return -EINVAL ; + +rte_spinlock_lock (&internal->rss_lock); + +/* Copy RETA table */ +for (i =0 ; i < (internal->reta_size /RTE_RETA_GROUP_SIZE ); i++) { +for (j =0 ; j <RTE_RETA_GROUP_SIZE ; j++) +if ((reta_conf[i].mask >> j) &0x01 ) + reta_conf[i].reta[j] = internal->reta_conf[i].reta[j]; + } + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_update (struct rte_eth_dev *dev,struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + +if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) !=0 ) + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + rss_conf->rss_hf & internal->flow_type_rss_offloads; + +if (rss_conf->rss_key) +rte_memcpy (internal->rss_key, rss_conf->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} + +static int +eth_rss_hash_conf_get (struct rte_eth_dev *dev, +struct rte_eth_rss_conf *rss_conf) +{ +struct pmd_internals *internal = dev->data->dev_private; + +rte_spinlock_lock (&internal->rss_lock); + + rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; +if (rss_conf->rss_key) +rte_memcpy (rss_conf->rss_key, internal->rss_key,40 ); + +rte_spinlock_unlock (&internal->rss_lock); + +return 0 ; +} +static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop,
@@ -387,6 +486,10 @@ static const struct eth_dev_ops ops = { .link_update = eth_link_update, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, + .reta_update = eth_rss_reta_update, + .reta_query = eth_rss_reta_query, + .rss_hash_update = eth_rss_hash_update, + .rss_hash_conf_get = eth_rss_hash_conf_get };int
@@ -402,6 +505,13 @@ eth_dev_null_create(const char *name,struct pmd_internals *internals =NULL ;struct rte_eth_dev *eth_dev =NULL ; +static const uint8_t default_rss_key[40 ] = { +0x6D ,0x5A ,0x56 ,0xDA ,0x25 ,0x5B ,0x0E ,0xC2 ,0x41 ,0x67 ,0x25 ,0x3D , +0x43 ,0xA3 ,0x8F ,0xB0 ,0xD0 ,0xCA ,0x2B ,0xCB ,0xAE ,0x7B ,0x30 ,0xB4 , +0x77 ,0xCB ,0x2D ,0xA3 ,0x80 ,0x30 ,0xF2 ,0x0C ,0x6A ,0x42 ,0xB7 ,0x3B , +0xBE ,0xAC ,0x01 ,0xFA + }; +if (name ==NULL )return -EINVAL ;
@@ -443,6 +553,11 @@ eth_dev_null_create(const char *name, internals->packet_copy = packet_copy; internals->numa_node = numa_node; + internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; + internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ; + +rte_memcpy (internals->rss_key, default_rss_key,40 ); + pci_dev->numa_node = numa_node; pci_dev->driver = &rte_null_pmd.pci_drv;
Signature · 1 line
1.7.9.5
PATCH v7 6/9 test: dynamic rss configuration
In reply to Tomasz Kulasekv7 changes:
- Makefile for test app changed to not break compilation when CONFIG_RTE_LIBRTE_PMD_NULL=n (now module is silently omitted when requirements not met)
--- app/test/Makefile | 7 + app/test/test_link_bonding_rssconf.c | 679 ++++++++++++++++++++++++++++++++++ 2 files changed, 686 insertions(+) create mode 100644 app/test/test_link_bonding_rssconf.c
app/test/Makefile +7 -0
@@ -140,6 +140,13 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c endif +ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +LDLIBS += -lrte_pmd_null +endif +endif + SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c
app/test/test_link_bonding_rssconf.c new file +679 -0
679 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v7 7/9 bonding: per queue stats
In reply to Tomasz KulasekThis patch adds fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port.
v5 changes:
- removed queue_stats_mapping_set from eth_dev_ops of bonding device
--- drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +10 -1
@@ -1801,7 +1801,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) {struct bond_dev_private *internals = dev->data->dev_private;struct rte_eth_stats slave_stats; -int i; +int i, j;for (i =0 ; i < internals->slave_count; i++) {rte_eth_stats_get (internals->slaves[i].port_id, &slave_stats);
@@ -1820,6 +1820,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + +for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_opackets[j]; + stats->q_ibytes[j] += slave_stats.q_ibytes[j]; + stats->q_obytes[j] += slave_stats.q_obytes[j]; + stats->q_errors[j] += slave_stats.q_errors[j]; + } + } }
Signature · 1 line
1.7.9.5
PATCH v7 8/9 doc: fixed spellings and typos
In reply to Tomasz Kulasek--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +4 -4
@@ -188,7 +188,7 @@ conditions are not met. If a user wishes to monitor individual slaves then they must register callbacks with that slave directly. The link bonding library also supports devices which do not implement link -status change interrupts, this is achieve by polling the devices link status at +status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` API, the default polling interval is 10ms. When a device is added as a slave to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
@@ -286,7 +286,7 @@ and UDP protocols for load balancing. Using Link Bonding Devices -------------------------- -The librte_pmd_bond library support two modes of device creation, the libraries +The librte_pmd_bond library supports two modes of device creation, the libraries export full C API or using the EAL command line to statically configure link bonding devices at application startup. Using the EAL option it is possible to use link bonding functionality transparently without specific knowledge of the
@@ -299,7 +299,7 @@ Using the Poll Mode Driver from an Application Using the librte_pmd_bond libraries API it is possible to dynamically create and manage link bonding device from within any application. Link bonding -device are created using the ``rte_eth_bond_create`` API which requires a +devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the link bonding mode to initial the device in and finally the socket Id which to allocate the devices resources onto. After successful creation of a bonding device it must be configured using the generic Ethernet
@@ -362,7 +362,7 @@ The different options are: mode=2 * slave: Defines the PMD device which will be added as slave to the bonded - device. This option can be selected multiple time, for each device to be + device. This option can be selected multiple times, for each device to be added as a slave. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function
Signature · 1 line
1.7.9.5
PATCH v7 9/9 doc: dynamic rss configuration for bonding
In reply to Tomasz KulasekDocumentation update about implementation details and requirements for Dynamic RSS Configuration for Bonding.
--- .../prog_guide/link_bonding_poll_mode_drv_lib.rst | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +32 -2
@@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,28 @@ After a slave device is added to a bonded device slave is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding -device. +device. If RSS is enabled for bonding device, this mode is also enabled on new +slave and configured as well. + +Setting up multi-queue mode for bonding device to RSS, makes it fully +RSS-capable, so all slaves are synchronized with its configuration. This mode is +intended to provide RSS configuration on slaves transparent for client +application implementation. + +Bonding device stores its own version of RSS settings i.e. RETA, RSS hash +function and RSS key, used to set up its slaves. That let to define the meaning +of RSS configuration of bonding device as desired configuration of whole bonding +(as one unit), without pointing any of slave inside. It is required to ensure +consistency and made it more errorproof. + +RSS hash function set for bonding device, is a maximal set of RSS hash functions +supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if slave +RETAs' sizes are different. If RSS Key is not set for bonded device, it's not +changed on the slaves and default key for device is used. + +All settings are managed through the bonding port API and always are propagated +in one direction (from bonding to slaves). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +228,15 @@ these parameters. A bonding device must have a minimum of one slave before the bonding device itself can be started. +To use a bonding device dynamic RSS configuration feature effectively, it is +also required, that all slaves should be RSS-capable and support, at least one +common hash function available for each of them. Changing RSS key is only +possible, when all slave devices support the same key size. + +To prevent inconsistency on how slaves process packets, once a device is added +to a bonding device, RSS configuration should be managed through the bonding +device API, and not directly on the slave. + Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object.
Signature · 1 line
1.7.9.5
Thomas Monjalon
AppliedQuoted 10 lines
Tomasz Kulasek (9):
bonding: rss dynamic configuration
null: fix segfault whennull_pmdadded to bonding
null: extend number of virtual queues
null: exporteth_dev_null_create
null: virtual dynamic rss configuration
test: dynamic rss configuration
bonding: per queue stats
doc: fixed spellings and typos
doc: dynamic rss configuration for bonding
Applied, thanks
PS: I've added an entry in the release notes