DPDK patches and discussions
 help / color / mirror / Atom feed
From: Haifeng Lin <haifeng.lin@huawei.com>
To: <dev@dpdk.org>
Cc: <declan.doherty@intel.com>, <jerry.lilijun@huawei.com>
Subject: [dpdk-dev] [PATCH] net/bonding: improve non-ip packets RSS
Date: Fri, 18 Nov 2016 17:08:42 +0800	[thread overview]
Message-ID: <1479460122-18780-1-git-send-email-haifeng.lin@huawei.com> (raw)

Most ethernet not support non-ip packets RSS and only first
queue can used to receive. In this scenario lacp bond can
only use one queue even if multi queue configured.

We use below formula to change the map between bond_qid and
slave_qid to let at least slave_num queues to receive packets:

	slave_qid = (bond_qid + slave_id) % queue_num

Signed-off-by: Haifeng Lin <haifeng.lin@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 09ce7bf..8ad843a 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -141,6 +141,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 	uint8_t collecting;  /* current slave collecting status */
 	const uint8_t promisc = internals->promiscuous_en;
 	uint8_t i, j, k;
+	int slave_qid, bond_qid = bd_rx_q->queue_id;
+	int queue_num = internals->nb_rx_queues;
 
 	rte_eth_macaddr_get(internals->port_id, &bond_mac);
 	/* Copy slave list to protect against slave up/down changes during tx
@@ -154,7 +156,9 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 		collecting = ACTOR_STATE(&mode_8023ad_ports[slaves[i]], COLLECTING);
 
 		/* Read packets from this slave */
-		num_rx_total += rte_eth_rx_burst(slaves[i], bd_rx_q->queue_id,
+		slave_qid = queue_num ? (bond_qid + slaves[i]) % queue_num :
+				bond_qid;
+		num_rx_total += rte_eth_rx_burst(slaves[i], slave_qid,
 				&bufs[num_rx_total], nb_pkts - num_rx_total);
 
 		for (k = j; k < 2 && k < num_rx_total; k++)
-- 
1.8.3.1

             reply	other threads:[~2016-11-18  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18  9:08 Haifeng Lin [this message]
2016-12-08 17:13 ` Ferruh Yigit
2017-02-10 16:30 ` Declan Doherty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479460122-18780-1-git-send-email-haifeng.lin@huawei.com \
    --to=haifeng.lin@huawei.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerry.lilijun@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).