From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by dpdk.org (Postfix) with ESMTP id 8C1A51B49B; Thu, 14 Feb 2019 20:10:09 +0100 (CET) Received: by mail-qt1-f195.google.com with SMTP id a48so8159471qtb.4; Thu, 14 Feb 2019 11:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KmRLLP4aGc7P0JcT0lCVntiEK/cTT3opSzUbeYxlhwM=; b=UKzJmPL+h2RhVOvnKnxWHnlWCsHZo+bnc3qNussZohTaBLoOxPkE4xHKO2vtpZHlHb X1SMklelMQzsQDVlLfSk96x8oKcsE7oHdYS/mKT2mZ0VpeWks6tXay9OWLeNK7LcZMrz GYQV6bgsYVFVIYldZlhhjrPnSvgvjMKEHVsX3fXSSLE0I95S0J5uxmhIz1JCnNCRVMSN QqQnlHO41gdgShgh7K2xC8RCWu7Q5LyvoL5WbMmyGePOyHrWUKT+OG//ypjqURXTe8lU 02XEZekw8epRsbdCmXLPXL5hb+8bf7+FfmfOc+deikfOKk2DtUfUdKmMSImcYeij3nMa w21A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KmRLLP4aGc7P0JcT0lCVntiEK/cTT3opSzUbeYxlhwM=; b=uh0LDm9hJgwommJt+QrjhzPnHGDlq74q+SNMaJJqfa1N9iRA5T36VtTcDadZrE8b3r X1xOqKKENUOeDx2KsiVkDDEOYeBLQ45jP3/myowp4nvLhEI7qWeO0wAqZ/hqqvDRWRGd 9J+akku7TshtoJFRg7RPudgiqz0SlNGLGbpwc7TkaOk+PE+r4k8/EcW/TUFWsrdObyhm fuS/kIrgHD/oXTYpDvShdk4NraR64PORC/231AkTGqA2QcypJVg9/gH3LStf+nIZT9MV G3RP2yMIh1ICBIPnZgc0f05+ddjGD0/bGf4D2dqAqpEzZbDQaTJfmvW8jP6hXZ325hOj ug2g== X-Gm-Message-State: AHQUAuYpIPT5lOie8jeUXmDJN8IC0su7W4380hHqQTHK2bx6qij81U3E v3jGcNhVpFj59BrfZTjycffIXQp9 X-Google-Smtp-Source: AHgI3IYkik7OCoMUrX7MgACQtWAoTYdsy0W/KokHEHuWuNqfvM8C12xJCblctgSRTx0gXHcICV4TSg== X-Received: by 2002:ac8:6cb:: with SMTP id j11mr4515435qth.14.1550171408687; Thu, 14 Feb 2019 11:10:08 -0800 (PST) Received: from monolith.fios-router.home (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id j8sm717099qtn.6.2019.02.14.11.10.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Feb 2019 11:10:07 -0800 (PST) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: Chas Williams , stable@dpdk.org, Yunjian Wang Date: Thu, 14 Feb 2019 14:09:58 -0500 Message-Id: <20190214190958.30890-1-3chas3@gmail.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <34EFBCA9F01B0748BEB6B629CE643AE60CA25A87@DGGEMM533-MBX.china.huawei.com> References: <34EFBCA9F01B0748BEB6B629CE643AE60CA25A87@DGGEMM533-MBX.china.huawei.com> Subject: [dpdk-dev] [PATCH v2] net/bonding: fix slave tx burst for mode 4 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2019 19:10:09 -0000 From: Chas Williams The tx burst routine always needs to check for pending LACPDUs and send them if available. Do this first to prioritize the control traffic. We can still early exit, before calculating the distribution slaves, if there isn't any data packets. Fixes: 09150784a776 ("net/bonding: burst mode hash calculation") Cc: stable@dpdk.org Reported-by: Hui Zhao Cc: Yunjian Wang Signed-off-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_pmd.c | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 2304172d0..61e731a8f 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1298,9 +1298,6 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t i; - if (unlikely(nb_bufs == 0)) - return 0; - /* Copy slave list to protect against slave up/down changes during tx * bursting */ slave_count = internals->active_slave_count; @@ -1310,6 +1307,30 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, memcpy(slave_port_ids, internals->active_slaves, sizeof(slave_port_ids[0]) * slave_count); + /* Check for LACP control packets and send if available */ + for (i = 0; i < slave_count; i++) { + struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]]; + struct rte_mbuf *ctrl_pkt = NULL; + + if (likely(rte_ring_empty(port->tx_ring))) + continue; + + if (rte_ring_dequeue(port->tx_ring, + (void **)&ctrl_pkt) != -ENOENT) { + slave_tx_count = rte_eth_tx_burst(slave_port_ids[i], + bd_tx_q->queue_id, &ctrl_pkt, 1); + /* + * re-enqueue LAG control plane packets to buffering + * ring if transmission fails so the packet isn't lost. + */ + if (slave_tx_count != 1) + rte_ring_enqueue(port->tx_ring, ctrl_pkt); + } + } + + if (unlikely(nb_bufs == 0)) + return 0; + dist_slave_count = 0; for (i = 0; i < slave_count; i++) { struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]]; @@ -1365,27 +1386,6 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, } } - /* Check for LACP control packets and send if available */ - for (i = 0; i < slave_count; i++) { - struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]]; - struct rte_mbuf *ctrl_pkt = NULL; - - if (likely(rte_ring_empty(port->tx_ring))) - continue; - - if (rte_ring_dequeue(port->tx_ring, - (void **)&ctrl_pkt) != -ENOENT) { - slave_tx_count = rte_eth_tx_burst(slave_port_ids[i], - bd_tx_q->queue_id, &ctrl_pkt, 1); - /* - * re-enqueue LAG control plane packets to buffering - * ring if transmission fails so the packet isn't lost. - */ - if (slave_tx_count != 1) - rte_ring_enqueue(port->tx_ring, ctrl_pkt); - } - } - return total_tx_count; } -- 2.17.2