DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Symmetric RSS Hashing, Part 2
@ 2015-03-14 20:47 Matthew Hall
  2015-03-23 15:05 ` Matt Laswell
  0 siblings, 1 reply; 10+ messages in thread
From: Matthew Hall @ 2015-03-14 20:47 UTC (permalink / raw)
  To: <dev@dpdk.org>

A few months ago we had this thread about symmetric hashing of TCP in RSS:

http://dpdk.org/ml/archives/dev/2014-December/010148.html

I was wondering if we ever did figure out how to get the 0x6d5a hash key mentioned in there to work, or another alternative one.

Thanks,
Matthew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-14 20:47 [dpdk-dev] Symmetric RSS Hashing, Part 2 Matthew Hall
@ 2015-03-23 15:05 ` Matt Laswell
  2015-03-23 15:20   ` Thomas Monjalon
  0 siblings, 1 reply; 10+ messages in thread
From: Matt Laswell @ 2015-03-23 15:05 UTC (permalink / raw)
  To: Matthew Hall; +Cc: <dev@dpdk.org>

Hey Folks,

I have essentially the same question as Matthew.  Has there been progress
in this area?

--
Matt Laswell
infinite io, inc.
laswell@infiniteio.com


On Sat, Mar 14, 2015 at 3:47 PM, Matthew Hall <mhall@mhcomputing.net> wrote:

> A few months ago we had this thread about symmetric hashing of TCP in RSS:
>
> http://dpdk.org/ml/archives/dev/2014-December/010148.html
>
> I was wondering if we ever did figure out how to get the 0x6d5a hash key
> mentioned in there to work, or another alternative one.
>
> Thanks,
> Matthew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-23 15:05 ` Matt Laswell
@ 2015-03-23 15:20   ` Thomas Monjalon
  2015-03-23 21:27     ` Matthew Hall
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2015-03-23 15:20 UTC (permalink / raw)
  To: Matt Laswell, Matthew Hall; +Cc: dev

2015-03-23 10:05, Matt Laswell:
> Hey Folks,
> 
> I have essentially the same question as Matthew.  Has there been progress
> in this area?

No, AFAIK.
Submitting a patch would be a good start I think.

> --
> Matt Laswell
> infinite io, inc.
> laswell@infiniteio.com
> 
> 
> On Sat, Mar 14, 2015 at 3:47 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
> 
> > A few months ago we had this thread about symmetric hashing of TCP in RSS:
> >
> > http://dpdk.org/ml/archives/dev/2014-December/010148.html
> >
> > I was wondering if we ever did figure out how to get the 0x6d5a hash key
> > mentioned in there to work, or another alternative one.
> >
> > Thanks,
> > Matthew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-23 15:20   ` Thomas Monjalon
@ 2015-03-23 21:27     ` Matthew Hall
  2015-03-27  5:30       ` Zhang, Helin
  0 siblings, 1 reply; 10+ messages in thread
From: Matthew Hall @ 2015-03-23 21:27 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Mon, Mar 23, 2015 at 04:20:33PM +0100, Thomas Monjalon wrote:
> 2015-03-23 10:05, Matt Laswell:
> > Hey Folks,
> > 
> > I have essentially the same question as Matthew.  Has there been progress
> > in this area?
> 
> No, AFAIK.
> Submitting a patch would be a good start I think.

Hi Thomas,

We did have somebody in the past thread who tried the key recommended in a 
scientific paper to get a symmetric hash, 0x6d5a I believe. However it didn't 
seem to get the expected results when tested in real life.

We're happy to make patches but we're not sure of the content to put in there 
if the only such RSS key we heard about didn't work when it was tested. Is 
there a subject matter expert in RSS who would be able to assist in more 
detail to figure out what went wrong?

Matthew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-23 21:27     ` Matthew Hall
@ 2015-03-27  5:30       ` Zhang, Helin
  2015-03-27 14:37         ` Matthew Hall
  0 siblings, 1 reply; 10+ messages in thread
From: Zhang, Helin @ 2015-03-27  5:30 UTC (permalink / raw)
  To: Matthew Hall, Thomas Monjalon; +Cc: dev

Hi guys

Did you guys talk about symmetric hash in software or in hardware?

If about hardware, I have one comment.
I40e supports symmetric hash by hardware, which was enabled in i40e PMD recently. You can have a try.

Regards,
Helin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Matthew Hall
> Sent: Tuesday, March 24, 2015 5:27 AM
> To: Thomas Monjalon
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
> 
> On Mon, Mar 23, 2015 at 04:20:33PM +0100, Thomas Monjalon wrote:
> > 2015-03-23 10:05, Matt Laswell:
> > > Hey Folks,
> > >
> > > I have essentially the same question as Matthew.  Has there been
> > > progress in this area?
> >
> > No, AFAIK.
> > Submitting a patch would be a good start I think.
> 
> Hi Thomas,
> 
> We did have somebody in the past thread who tried the key recommended in a
> scientific paper to get a symmetric hash, 0x6d5a I believe. However it didn't
> seem to get the expected results when tested in real life.
> 
> We're happy to make patches but we're not sure of the content to put in there
> if the only such RSS key we heard about didn't work when it was tested. Is there
> a subject matter expert in RSS who would be able to assist in more detail to
> figure out what went wrong?
> 
> Matthew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-27  5:30       ` Zhang, Helin
@ 2015-03-27 14:37         ` Matthew Hall
  2015-03-28  9:10           ` Vladimir Medvedkin
  0 siblings, 1 reply; 10+ messages in thread
From: Matthew Hall @ 2015-03-27 14:37 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

On Mar 26, 2015, at 10:30 PM, Zhang, Helin <helin.zhang@intel.com> wrote:
> Hi guys
> 
> Did you guys talk about symmetric hash in software or in hardware?
> 
> If about hardware, I have one comment.
> I40e supports symmetric hash by hardware, which was enabled in i40e PMD recently. You can have a try.
> 
> Regards,
> Helin

Hello Helin,

Very few of us have that hardware or driver yet.

It's also quite costly if you're doing the open-source model like I am.

Is there any way to get the symmetric mode to work for IGB or IXGBE?

Matthew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-27 14:37         ` Matthew Hall
@ 2015-03-28  9:10           ` Vladimir Medvedkin
  2015-03-28 20:11             ` Matthew Hall
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Medvedkin @ 2015-03-28  9:10 UTC (permalink / raw)
  To: Matthew Hall; +Cc: dev

Hi Matthew,

I just verify RSS symmetric in my code, all works great. I have 82599 NIC
and dpdk 1.7.0. Moreover, we can use not only 0x6d5a, but repeated random 2
bytes for 4 tuple, and repeated 4 bytes for 2 tuple in rss hash key. Bellow
some code:
uint8_t my_rss_key[40];
static const struct rte_eth_conf port_conf = {
        .rxmode = {
                .mq_mode = ETH_MQ_RX_RSS,
                .split_hdr_size = 0,
                .header_split   = 0, /**< Header Split disabled */
                .hw_ip_checksum = 0, /**< IP checksum offload disabled */
                .hw_vlan_filter = 0, /**< VLAN filtering disabled */
                .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
                .hw_strip_crc   = 0, /**< CRC stripped by hardware */
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
        },
        .rx_adv_conf.rss_conf   = {
                .rss_key        = my_rss_key,
                .rss_hf         = ETH_RSS_IPV4|ETH_RSS_IPV4_TCP,
        },

};
...
int i;
uint8_t a, b;
a = rte_rand();
b = rte_rand();
for (i = 0; i < 40; i++) {
   switch( i & 0x1) {
     case 0: my_rss_key[i] = a; break;
     case 1: my_rss_key[i] = b; break;
    }
}
....
ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
...
static uint32_t
softrss(uint32_t sip, uint32_t dip, uint16_t sp, uint16_t dp, int l4flag,
uint32_t *rss_key)
{
        uint32_t ret = 0;
        int i;
        for (i = 0; i < 32; i++) {
                if (sip & (1 << (31 - i))) {
                        ret ^= (rte_cpu_to_be_32(*rss_key) <<
i)|(rte_cpu_to_be_32(*(rss_key + 1)) >> (32 - i));
                }
        }
        rss_key++;
        for (i = 0; i < 32; i++) {
                if (dip & (1 << (31 - i))) {
                        ret ^= (rte_cpu_to_be_32(*rss_key) <<
i)|(rte_cpu_to_be_32(*(rss_key + 1)) >> (32 - i));
                }
        }
        rss_key++;
        if (l4flag == 1) {
                 for (i = 0; i < 32; i++) {
                        if (((sp<<16)|dp) & (1 << (31 - i))) {
                                ret ^= (rte_cpu_to_be_32(*rss_key) <<
i)|(rte_cpu_to_be_32(*(rss_key + 1)) >> (32 - i));
                        }
                }
        }
        return ret;
}
...
uint32_t rss = softrss(rte_be_to_cpu_32(ipv4_hdr->src_addr),
rte_be_to_cpu_32(ipv4_hdr->dst_addr), rte_be_to_cpu_16(tcp_hdr->src_port),
rte_be_to_cpu_16(tcp_hdr->dst_port), 1, (uint32_t *)my_rss_key);
printf("RSS %u \t\t softRSS %u\n",m->pkt.hash.rss, rss);

By the way, maybe it will be usefull to add softrss function in DPDK?

2015-03-27 17:37 GMT+03:00 Matthew Hall <mhall@mhcomputing.net>:

> On Mar 26, 2015, at 10:30 PM, Zhang, Helin <helin.zhang@intel.com> wrote:
> > Hi guys
> >
> > Did you guys talk about symmetric hash in software or in hardware?
> >
> > If about hardware, I have one comment.
> > I40e supports symmetric hash by hardware, which was enabled in i40e PMD
> recently. You can have a try.
> >
> > Regards,
> > Helin
>
> Hello Helin,
>
> Very few of us have that hardware or driver yet.
>
> It's also quite costly if you're doing the open-source model like I am.
>
> Is there any way to get the symmetric mode to work for IGB or IXGBE?
>
> Matthew.
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-28  9:10           ` Vladimir Medvedkin
@ 2015-03-28 20:11             ` Matthew Hall
  2015-03-30 15:00               ` Vladimir Medvedkin
  0 siblings, 1 reply; 10+ messages in thread
From: Matthew Hall @ 2015-03-28 20:11 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev

On Sat, Mar 28, 2015 at 12:10:20PM +0300, Vladimir Medvedkin wrote:
> I just verify RSS symmetric in my code, all works great.
> ...
> By the way, maybe it will be usefull to add softrss function in DPDK?

Vladimir,

All of this is super-awesome code. I agree having SW RSS would be quite nice. 
Then you could more easily support things like virtio-net and other stuff 
which doesn't have RSS.

Did you have to use any special tricks to get the 0x6d5a to work? I wasn't quite 
sure how to initialize that and get it to run right.

Matthew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-28 20:11             ` Matthew Hall
@ 2015-03-30 15:00               ` Vladimir Medvedkin
  2015-03-30 15:13                 ` Matt Laswell
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Medvedkin @ 2015-03-30 15:00 UTC (permalink / raw)
  To: Matthew Hall; +Cc: dev

Matthew,

I don't use any special tricks to make symmetric RSS work. Furthermore, it
works not only with 0x6d5a.

Regards,
Vladimir

2015-03-28 23:11 GMT+03:00 Matthew Hall <mhall@mhcomputing.net>:

> On Sat, Mar 28, 2015 at 12:10:20PM +0300, Vladimir Medvedkin wrote:
> > I just verify RSS symmetric in my code, all works great.
> > ...
> > By the way, maybe it will be usefull to add softrss function in DPDK?
>
> Vladimir,
>
> All of this is super-awesome code. I agree having SW RSS would be quite
> nice.
> Then you could more easily support things like virtio-net and other stuff
> which doesn't have RSS.
>
> Did you have to use any special tricks to get the 0x6d5a to work? I wasn't
> quite
> sure how to initialize that and get it to run right.
>
> Matthew.
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] Symmetric RSS Hashing, Part 2
  2015-03-30 15:00               ` Vladimir Medvedkin
@ 2015-03-30 15:13                 ` Matt Laswell
  0 siblings, 0 replies; 10+ messages in thread
From: Matt Laswell @ 2015-03-30 15:13 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev

That's really encouraging.  Thanks!

One thing I'll note is that if my reading of the original paper is
accurate, the 0x6d5a value isn't there in order to cause symmetry - other
repeated 16 bit values will do that, as you've seen.  What the 0x6d5a value
gets you is symmetry while preserving RSS's effectiveness at load spreading
with typical traffic data.  Not all 16 bit values will do this.

--
Matt Laswell
infinite io, inc.
laswell@infiniteio.com

On Mon, Mar 30, 2015 at 10:00 AM, Vladimir Medvedkin <medvedkinv@gmail.com>
wrote:

> Matthew,
>
> I don't use any special tricks to make symmetric RSS work. Furthermore, it
> works not only with 0x6d5a.
>
> Regards,
> Vladimir
>
> 2015-03-28 23:11 GMT+03:00 Matthew Hall <mhall@mhcomputing.net>:
>
> > On Sat, Mar 28, 2015 at 12:10:20PM +0300, Vladimir Medvedkin wrote:
> > > I just verify RSS symmetric in my code, all works great.
> > > ...
> > > By the way, maybe it will be usefull to add softrss function in DPDK?
> >
> > Vladimir,
> >
> > All of this is super-awesome code. I agree having SW RSS would be quite
> > nice.
> > Then you could more easily support things like virtio-net and other stuff
> > which doesn't have RSS.
> >
> > Did you have to use any special tricks to get the 0x6d5a to work? I
> wasn't
> > quite
> > sure how to initialize that and get it to run right.
> >
> > Matthew.
> >
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-03-30 15:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-14 20:47 [dpdk-dev] Symmetric RSS Hashing, Part 2 Matthew Hall
2015-03-23 15:05 ` Matt Laswell
2015-03-23 15:20   ` Thomas Monjalon
2015-03-23 21:27     ` Matthew Hall
2015-03-27  5:30       ` Zhang, Helin
2015-03-27 14:37         ` Matthew Hall
2015-03-28  9:10           ` Vladimir Medvedkin
2015-03-28 20:11             ` Matthew Hall
2015-03-30 15:00               ` Vladimir Medvedkin
2015-03-30 15:13                 ` Matt Laswell

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).