Re: [dpdk-dev] [PATCH] eal: changes for setting control thread mask
Hi David, This task was supposed to be taken up by someone else in my organisation. Will check and update. Thanks On 25/03/21, 8:21 PM, "David Marchand" wrote: [External Email. Be cautious of content] On Tue, Apr 21, 2020 at 10:01 AM David Marchand wrote: > > On Tue, Apr 21, 2020 at 9:42 AM Kiran KN wrote: > > Define a global variable ctrl_thread_set which the application can set. > > If this is the case, use this for setting control thread affinity instead > > of deducing it from the existing core pinning of the process. > > I am unconvinced on adding an EAL option for this. > It needs an explanation on why you can't rely on the dpdk process > current affinity for control threads. > And we will need a unit test. > > Please rebase your patch on master too. > > > signed-off-by: Kiran KN > > Signed-off-by* Is this patch abandoned? Thanks. -- David Marchand Juniper Business Use Only
[dpdk-dev] GSO/GRO support
We, at Juniper Opencontrail have added software support for TCP send offload and receive offload to DPDK. If the community is interested, we can publish/upstream it. Pl let us know what you think of it. Thanks, Kiran
Re: [dpdk-dev] GSO/GRO support
Hi All, Glad to know that there is interest in this. Currently the code as part of vrouter. But easily separable since its in separate files. You can find the code for GRO here: https://github.com/Juniper/contrail-vrouter/blob/master/dpdk/vr_dpdk_gro.c GSO code is here: https://github.com/Juniper/contrail-vrouter/blob/master/dpdk/vr_dpdk_gso.c Will work on the RFC. - Kiran On 2/13/17, 5:58 AM, "Hu, Jiayu" wrote: > >> -Original Message- >> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Kiran KN >> Sent: Saturday, February 11, 2017 6:56 AM >> To: dev@dpdk.org >> Subject: [dpdk-dev] GSO/GRO support >> >> We, at Juniper Opencontrail have added software support for TCP send >> offload and receive offload to DPDK. >> >> If the community is interested, we can publish/upstream it. >> >> Pl let us know what you think of it. >> >> Thanks, >> Kiran > >Hi Kiran, > >I am glad to hear this news. And Currently, I work on the design of GRO and >GSO too. >After your codes or RFC is released, I am happy to join the discussion and do >some >reviews. > >Regards, >Jiayu
[dpdk-dev] DPDK on Xen Dom-U hangs during hugepage setup
Hello, I am trying to bring up DPDK on Xen Dom-U. Have followed all the steps in DPDK programmers guide in section 14.3. However, when I try to run testpmd or any other example application, it is getting stuck during hugepage setup. It hangs after the print "EAL: Setting up memory..." Has anyone faced similar issue before? Thanks, Kiran
[dpdk-dev] DPDK on Xen Dom-U hangs during hugepage setup
Hello Murillo, Yes, am using rte_dom0_mm as explained in DPDK programmers guide section 14.3.3 step (4). The examples work when using --no-huge option. Are you able to go past the hugepage setup? If so can you tell what are the steps you followed in addition to the ones explained in section 14.3. Thanks, Kiran -Original Message- From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Murillo Sent: Friday, October 31, 2014 1:11 AM To: dev at dpdk.org Subject: Re: [dpdk-dev] DPDK on Xen Dom-U hangs during hugepage setup Hello, Xen does not support hugepages, so you have to use a kernel module called rte_dom0_mm. The instructions are in the getting started guide in the seccion 2.3.3. If you manage to execute any example please tell me, because I am stuck during the execution of the examples after configuring the environment. El 30/10/14 a las 19:15, Kiran KN escribi?: > Hello, > > I am trying to bring up DPDK on Xen Dom-U. > > Have followed all the steps in DPDK programmers guide in section 14.3. > > However, when I try to run testpmd or any other example application, it is > getting stuck during hugepage setup. > > It hangs after the print "EAL: Setting up memory..." > > Has anyone faced similar issue before? > > Thanks, > Kiran > >
[dpdk-dev] [PATCH] eal: changes for setting control thread mask
Define a global variable ctrl_thread_set which the application can set. If this is the case, use this for setting control thread affinity instead of deducing it from the existing core pinning of the process. signed-off-by: Kiran KN --- lib/librte_eal/common/eal_common_options.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index a7f9c5f9b..1b99a986d 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -41,6 +41,7 @@ eal_short_options[] = "b:" /* pci-blacklist */ "c:" /* coremask */ "s:" /* service coremask */ + "C:" /* control threads */ "d:" /* driver */ "h" /* help */ "l:" /* corelist */ @@ -1201,7 +1202,7 @@ eal_parse_common_option(int opt, const char *optarg, { static int b_used; static int w_used; - + static uint16_t set[RTE_MAX_LCORE]; switch (opt) { /* blacklist */ case 'b': @@ -1295,6 +1296,17 @@ eal_parse_common_option(int opt, const char *optarg, return -1; } break; + /* control threads */ + case 'C': + if (eal_parse_set(optarg, set, RTE_DIM(set)) < 0) { + RTE_LOG(ERR, EAL, "invalid control threads\n"); + return -1; + } + if (convert_to_cpuset(&conf->ctrl_cpuset, set, RTE_DIM(set)) < 0) { + RTE_LOG(ERR, EAL, "Error adding set to control cpuset\n"); + return -1; + } + break; /* service corelist */ case 'S': if (eal_parse_service_corelist(optarg) < 0) { @@ -1542,7 +1554,9 @@ eal_adjust_config(struct internal_config *internal_cfg) lcore_config[cfg->master_lcore].core_role = ROLE_RTE; } - compute_ctrl_threads_cpuset(internal_cfg); + if (CPU_COUNT(&internal_cfg->ctrl_cpuset) == 0) { + compute_ctrl_threads_cpuset(internal_cfg); + } /* if no memory amounts were requested, this will result in 0 and * will be overridden later, right after eal_hugepage_info_init() */ @@ -1656,6 +1670,10 @@ eal_common_usage(void) " '( )' can be omitted for single element group,\n" " '@' can be omitted if cpus and lcores have the same value\n" " -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores\n" + " -C CONTROL THREADS The argument format is\n" + " (list of cpus) or Hexadecimal bitmask of cores\n" + " Within the list of cpus, '-' is used as range seperator,\n" + " ',' is used for single number seperator.\n" " --"OPT_MASTER_LCORE" ID Core ID that is used as master\n" " --"OPT_MBUF_POOL_OPS_NAME" Pool ops name for mbuf to use\n" " -n CHANNELS Number of memory channels\n" -- 2.16.6
[dpdk-dev] [PATCH] net/bonding: Changes for accomodating jumbo frames in bond
Propagate max rx packet length and jumbo offload capabilities to slaves from master Signed-off-by: Kiran KN --- drivers/net/bonding/rte_eth_bond_pmd.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index e1f105233..cf9247e7e 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1722,6 +1722,17 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, slave_eth_dev->data->dev_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; + slave_eth_dev->data->dev_conf.rxmode.max_rx_pkt_len = + bonded_eth_dev->data->dev_conf.rxmode.max_rx_pkt_len; + + if (bonded_eth_dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_JUMBO_FRAME) + slave_eth_dev->data->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + else + slave_eth_dev->data->dev_conf.rxmode.offloads &= + ~DEV_RX_OFFLOAD_JUMBO_FRAME; + nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; nb_tx_queues = bonded_eth_dev->data->nb_tx_queues; -- 2.16.6
[dpdk-dev] [PATCH] net/af_packet: changes to accomodate jumbo frames
Change the maximum packet length to accommodate jumbo frames signed-off-by: Kiran KN --- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index f5806bf42..7fe3a28a7 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -312,7 +312,7 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->if_index = internals->if_index; dev_info->max_mac_addrs = 1; - dev_info->max_rx_pktlen = (uint32_t)ETH_FRAME_LEN; + dev_info->max_rx_pktlen = (uint32_t)RTE_ETHER_MAX_JUMBO_FRAME_LEN; dev_info->max_rx_queues = (uint16_t)internals->nb_queues; dev_info->max_tx_queues = (uint16_t)internals->nb_queues; dev_info->min_rx_bufsize = 0; -- 2.16.6
[dpdk-dev] [PATCH] net/bonding: Support configuration for LACP fast timers
Add a rte APIs to set/get the timeout for LACP signed-off-by: Kiran KN --- drivers/net/bonding/eth_bond_private.h| 8 drivers/net/bonding/rte_eth_bond.h| 26 ++ drivers/net/bonding/rte_eth_bond_8023ad.c | 6 ++ drivers/net/bonding/rte_eth_bond_8023ad.h | 9 + drivers/net/bonding/rte_eth_bond_api.c| 27 +++ drivers/net/bonding/rte_eth_bond_args.c | 25 + drivers/net/bonding/rte_eth_bond_pmd.c| 30 +- 7 files changed, 130 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h index c9b2d0fe4..8bab10ee1 100644 --- a/drivers/net/bonding/eth_bond_private.h +++ b/drivers/net/bonding/eth_bond_private.h @@ -28,11 +28,14 @@ #define PMD_BOND_LSC_POLL_PERIOD_KVARG ("lsc_poll_period_ms") #define PMD_BOND_LINK_UP_PROP_DELAY_KVARG ("up_delay") #define PMD_BOND_LINK_DOWN_PROP_DELAY_KVARG("down_delay") +#define PMD_BOND_LACP_RATE_KVARG ("lacp_rate") #define PMD_BOND_XMIT_POLICY_LAYER2_KVARG ("l2") #define PMD_BOND_XMIT_POLICY_LAYER23_KVARG ("l23") #define PMD_BOND_XMIT_POLICY_LAYER34_KVARG ("l34") +#define PMD_BOND_LACP_RATE_FAST_KVARG ("fast") +#define PMD_BOND_LACP_RATE_SLOW_KVARG ("slow") extern int bond_logtype; #define RTE_BOND_LOG(lvl, msg, ...)\ @@ -180,6 +183,7 @@ struct bond_dev_private { void *vlan_filter_bmpmem; /* enabled vlan filter bitmap */ struct rte_bitmap *vlan_filter_bmp; + uint8_t lacp_rate; }; extern const struct eth_dev_ops default_dev_ops; @@ -306,6 +310,10 @@ int bond_ethdev_parse_time_ms_kvarg(const char *key, const char *value, void *extra_args); +int +bond_ethdev_parse_lacp_rate_kvarg(const char *key, + const char *value, void *extra_args); + void bond_tlb_disable(struct bond_dev_private *internals); diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 874aa91a5..0e90ba2cf 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -88,6 +88,10 @@ extern "C" { #define BALANCE_XMIT_POLICY_LAYER34(2) /**< Layer 3+4 (IP Addresses + UDP Ports) transmit load balancing */ +/* LACP Rate */ +#define LACP_RATE_SLOW (0) +#define LACP_RATE_FAST (1) + /** * Create a bonded rte_eth_dev device * @@ -343,6 +347,28 @@ rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, int rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); +/** + * Set the lacp rate for the slave interface + * + * @param bonded_port_idPort ID of bonded device. + * @param lacp_rate 0 - slow, 1 - fast + * + * @return + * 0 on success, negative value otherwise. + */ +int +rte_eth_bond_lacp_rate_set(uint16_t bonded_port_id, uint8_t lacp_rate); + +/** + * Get the lacp rate for the slave device + * + * @param bonded_port_idPort ID of bonded device. + * + * @return + * lacp rate on success, negative value otherwise. + */ +int +rte_eth_bond_lacp_rate_get(uint16_t bonded_port_id); #ifdef __cplusplus } diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index b77a37ddb..e3159004a 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -491,6 +491,12 @@ mux_machine(struct bond_dev_private *internals, uint16_t slave_id) MODE4_DEBUG("Out of sync -> ATTACHED\n"); } + if (internals->lacp_rate) + ACTOR_STATE_SET(port, LACP_SHORT_TIMEOUT); + else + ACTOR_STATE_CLR(port, LACP_SHORT_TIMEOUT); + + if (!ACTOR_STATE(port, SYNCHRONIZATION)) { /* attach mux to aggregator */ RTE_ASSERT((port->actor_state & (STATE_COLLECTING | diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 62265f449..5623e1424 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -331,4 +331,13 @@ rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id); int rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection); + +/** + * Set slave to use fast lacp timeout + * @param port_id Bonding device id + * @return + * 0 on success, negative value otherwise + */ +int +rte_eth_bond_8023ad_ext_set_fast(uint16_t port_id, uint16_t slave_id); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index f38eb3b47..9157a7295 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_
[dpdk-dev] [PATCH] net/bonding: LACP Packet statistics support
net/bonding: LACP Packet statistics support Store the LACP packets sent and received for each slave. This can be used for debug purposes from any DPDK application. Signed-Off-By: Kiran K N Change-Id: Iae82bd7d0879a4c4333a292c96d431798c56e301 --- drivers/net/bonding/eth_bond_8023ad_private.h | 2 ++ drivers/net/bonding/rte_eth_bond_8023ad.c | 39 +++ drivers/net/bonding/rte_eth_bond_8023ad.h | 20 ++ 3 files changed, 61 insertions(+) diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h index ef0b56850..500640b28 100644 --- a/drivers/net/bonding/eth_bond_8023ad_private.h +++ b/drivers/net/bonding/eth_bond_8023ad_private.h @@ -19,6 +19,8 @@ #define BOND_MODE_8023AX_SLAVE_RX_PKTS3 /** Maximum number of LACP packets from one slave queued in TX ring. */ #define BOND_MODE_8023AX_SLAVE_TX_PKTS1 +/** maximum number of slaves for each port */ +#define BOND_MODE_8023AD_MAX_SLAVES 6 /** * Timeouts deffinitions (5.4.4 in 802.1AX documentation). */ diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index ea79a1344..37eb29847 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -132,6 +132,9 @@ static const struct rte_ether_addr lacp_mac_addr = { struct port bond_mode_8023ad_ports[RTE_MAX_ETHPORTS]; +static uint64_t lacpdu_tx_count[BOND_MODE_8023AD_MAX_SLAVES]; +static uint64_t lacpdu_rx_count[BOND_MODE_8023AD_MAX_SLAVES]; + static void timer_cancel(uint64_t *timer) { @@ -629,6 +632,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id) set_warning_flags(port, WRN_TX_QUEUE_FULL); return; } +lacpdu_tx_count[slave_id]++; } else { uint16_t pkts_sent = rte_eth_tx_burst(slave_id, internals->mode4.dedicated_queues.tx_qid, @@ -638,6 +642,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id) set_warning_flags(port, WRN_TX_QUEUE_FULL); return; } +lacpdu_tx_count[slave_id] += pkts_sent; } @@ -896,6 +901,10 @@ bond_mode_8023ad_periodic_cb(void *arg) lacp_pkt = NULL; rx_machine_update(internals, slave_id, lacp_pkt); + +if (retval == 0) { +lacpdu_rx_count[slave_id]++; +} } else { uint16_t rx_count = rte_eth_rx_burst(slave_id, internals->mode4.dedicated_queues.rx_qid, @@ -906,6 +915,8 @@ bond_mode_8023ad_periodic_cb(void *arg) slave_id, lacp_pkt); else rx_machine_update(internals, slave_id, NULL); + +lacpdu_rx_count[slave_id] += rx_count; } periodic_machine(internals, slave_id); @@ -1715,3 +1726,31 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) return retval; } + +uint64_t +rte_eth_bond_8023ad_lacp_tx_count(uint16_t port_id, uint8_t clear) +{ +if(port_id > BOND_MODE_8023AD_MAX_SLAVES) +return -1; + +if(clear) { +lacpdu_tx_count[port_id] = 0; +return 0; +} + + return lacpdu_tx_count[port_id]; +} + +uint64_t +rte_eth_bond_8023ad_lacp_rx_count(uint16_t port_id, uint8_t clear) +{ +if(port_id > BOND_MODE_8023AD_MAX_SLAVES) +return -1; + +if(clear) { +lacpdu_rx_count[port_id] = 0; +return 0; +} + +return lacpdu_rx_count[port_id]; +} diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 5623e1424..7163de381 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -340,4 +340,24 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, */ int rte_eth_bond_8023ad_ext_set_fast(uint16_t port_id, uint16_t slave_id); + +/** + * Get Lacp statistics counter for slaves + * @param port_id Bonding slave device id + * @param clear, reset statistics + * @return + *0 on success, negative value otherwise + */ +uint64_t +rte_eth_bond_8023ad_lacp_tx_count(uint16_t port_id, uint8_t clear); + +/** + * Get Lacp statistics counter for slaves + * @param port_id Bonding slave device id + * @param clear, reset statistics + * @return + *0 on success, negative value otherwise + */ +uint64_t +rte_eth_bond_8023ad_lacp_rx_count(uint16_t port_id, uint8_t clear); #endif /* RTE_ETH_BOND_8023AD_H_ */ -- 2.16.6 Juniper Business Use Only