From 9edef078cc0e3ea7d789b5df6a762ae1718cbb8f Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Sat, 27 Oct 2018 05:26:09 +0000 Subject: [PATCH] cxgbetool(8): Add a subaction (tcbrss ) that can be used with "pass" action to distribute traffic using the half of the VI's RSS indirection table. The value specified should either be the start of the VI's RSS slice (available at dev...rss_base since r339700) or the midpoint (rss_base + rss_size/2). The traffic that hits the filter will use the first or second half of the indirection table respectively. The indirection table can be populated in different ways to achieve different kinds of traffic/load distributions. For example, r339749 allows a netmap interface to have half the rx queues in the first half of the table and the rest in the other. Sponsored by: Chelsio Communications --- usr.sbin/cxgbetool/cxgbetool.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/usr.sbin/cxgbetool/cxgbetool.c b/usr.sbin/cxgbetool/cxgbetool.c index a67e863ad1da..c852b4e9940d 100644 --- a/usr.sbin/cxgbetool/cxgbetool.c +++ b/usr.sbin/cxgbetool/cxgbetool.c @@ -924,7 +924,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t mode) if (t->fs.dirsteer == 0) { printf("RSS"); if (t->fs.maskhash) - printf("(TCB=hash)"); + printf("(region %d)", t->fs.iq << 1); } else { printf("%d", t->fs.iq); if (t->fs.dirsteerhash == 0) @@ -1263,11 +1263,19 @@ set_filter(uint32_t idx, int argc, const char *argv[], int hash) } else if (!parse_val("rpttid", args, &val)) { t.fs.rpttid = 1; } else if (!parse_val("queue", args, &val)) { - t.fs.dirsteer = 1; - t.fs.iq = val; + t.fs.dirsteer = 1; /* direct steer */ + t.fs.iq = val; /* to the iq with this cntxt_id */ } else if (!parse_val("tcbhash", args, &val)) { - t.fs.maskhash = 1; - t.fs.dirsteerhash = 1; + t.fs.dirsteerhash = 1; /* direct steer */ + /* XXX: use (val << 1) as the rss_hash? */ + t.fs.iq = val; + } else if (!parse_val("tcbrss", args, &val)) { + t.fs.maskhash = 1; /* steer to RSS region */ + /* + * val = start idx of the region but the internal TCB + * field is 10b only and is left shifted by 1 before use. + */ + t.fs.iq = val >> 1; } else if (!parse_val("eport", args, &val)) { t.fs.eport = val; } else if (!parse_val("swapmac", args, &val)) {