DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] wrong core receive the package
@ 2018-03-21  3:13 shengxiao qian
  2018-03-21 14:48 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: shengxiao qian @ 2018-03-21  3:13 UTC (permalink / raw)
  To: users

Hi there;
    Our machine has 2 cpus(Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz)with
40 cores.
If the core num is less than or equal to 16. the application with dpdk
works fine.But if the core num more than 16.there is something wrong with
it.
    In our test scenario(more then 16 cores), server a is a tcp client and
server b is a tcp server. Server a sends a syn packet to server B with
core1, and server B returns a syn ack message to server a.Although the hash
value of these two packets is the same, syn ack packets are distributed to
server a other core(not the send core),Can anyone give some help?

NIC info:
 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network
Connection(recv 01)

I reconnect the nic to Linux and examine it with ethtool:

RX flow hash indirection table for enp4s0f1 with 40 RX ring(s):
    0:      0     1     2     3     4     5     6     7
    8:      8     9    10    11    12    13    14    15
   16:      0     1     2     3     4     5     6     7
   24:      8     9    10    11    12    13    14    15
   32:      0     1     2     3     4     5     6     7
   40:      8     9    10    11    12    13    14    15
   48:      0     1     2     3     4     5     6     7
   56:      8     9    10    11    12    13    14    15
   64:      0     1     2     3     4     5     6     7
   72:      8     9    10    11    12    13    14    15
   80:      0     1     2     3     4     5     6     7
   88:      8     9    10    11    12    13    14    15
   96:      0     1     2     3     4     5     6     7
  104:      8     9    10    11    12    13    14    15
  112:      0     1     2     3     4     5     6     7
  120:      8     9    10    11    12    13    14    15
RSS hash key:
64:8e:94:4d:41:6e:5b:84:47:49:df:34:e0:f2:6c:4f:cf:1e:c7:ec:f2:ff:e5:dc:a1:10:85:58:4e:af:f4:a7:98:f4:77:94:5b:d3:27:49
RSS hash function:
    toeplitz: on
    xor: off


RSS related configuration and code :

1:rxmode_mq_mode = ETH_MQ_RX_RSS
2:rx_adv_conf.rss_conf.rss_hf = ETH_RSS_PROTO_MASK

           3:

void dpdk_device::set_rss_table()

{

    if (_dev_info.reta_size == 0)

        return;


    int reta_conf_size =std::max(1, _dev_info.reta_size /
RTE_RETA_GROUP_SIZE);

    rte_eth_rss_reta_entry64 reta_conf[reta_conf_size];//reta_conf_size=2


    // Configure the HW indirection table

    unsigned i = 0;

    for (auto& x : reta_conf) {

        x.mask = ~0ULL;

        for (auto& r: x.reta) {

            r = i++ % _num_queues;//_num_queues = 40

        }

    }


    if (rte_eth_dev_rss_reta_update(_port_idx, reta_conf,
_dev_info.reta_size)) {

        rte_exit(EXIT_FAILURE, "Port %d: Failed to update an RSS
indirection table", _port_idx);

    }


  }



is there anything wrong with the congigure?

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

* Re: [dpdk-users] wrong core receive the package
  2018-03-21  3:13 [dpdk-users] wrong core receive the package shengxiao qian
@ 2018-03-21 14:48 ` Stephen Hemminger
  2018-03-22  6:40   ` shengxiao qian
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2018-03-21 14:48 UTC (permalink / raw)
  To: shengxiao qian; +Cc: users

On Wed, 21 Mar 2018 11:13:19 +0800
shengxiao qian <tedsxqian@gmail.com> wrote:

> Hi there;
>     Our machine has 2 cpus(Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz)with
> 40 cores.
> If the core num is less than or equal to 16. the application with dpdk
> works fine.But if the core num more than 16.there is something wrong with
> it.
>     In our test scenario(more then 16 cores), server a is a tcp client and
> server b is a tcp server. Server a sends a syn packet to server B with
> core1, and server B returns a syn ack message to server a.Although the hash
> value of these two packets is the same, syn ack packets are distributed to
> server a other core(not the send core),Can anyone give some help?
> 

RSS hash is not symmetrical. The SYN and SYN-ACK packets have swapped
address and port (src/dest); therefore the hash will be different.

There are some weaker RSS hash keys that are symmetrical.

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

* Re: [dpdk-users] wrong core receive the package
  2018-03-21 14:48 ` Stephen Hemminger
@ 2018-03-22  6:40   ` shengxiao qian
  0 siblings, 0 replies; 3+ messages in thread
From: shengxiao qian @ 2018-03-22  6:40 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

I add some logs,it shows that the packet's hash value is 3104575691
<(310)%20457-5691> and it was received by core 3.
if the function rte_eth_dev_rss_reta_update works well.the  hash
indirection table maybe like this:
    0:       0     1     2     3      4      5      6      7
    8:       8     9    10    11    12    13    14    15
   16:      16  17 18     19    20   21     22     23
   24:      24   25  26   27    28   29     30      31
   32:      32   33  34    35    36    37     38    39
   40:      0     1     2     3      4      5      6      7
   48:      8     9    10    11    12    13    14    15
   56:      16  17 18     19    20   21     22     23
   64:      24   25  26   27    28   29     30      31
   72:      32   33  34    35    36    37     38    39
   80:       0     1     2     3      4      5      6      7
   88:      8     9    10    11    12    13    14    15
   96:     8     9    10    11    12    13    14    15
  104:       24   25  26   27    28   29     30      31
  112:      32   33  34    35    36    37     38    39
  120:       0     1     2     3      4      5      6      7

The hash value 3104575691 <(310)%20457-5691> & 127 = 75,according to the hash
indirection table, the core num 35 is right.But actually it was core3
received.

So i guess may be the hash indirection table is wrong? How can i check this?


2018-03-21 22:48 GMT+08:00 Stephen Hemminger <stephen@networkplumber.org>:

> On Wed, 21 Mar 2018 11:13:19 +0800
> shengxiao qian <tedsxqian@gmail.com> wrote:
>
> > Hi there;
> >     Our machine has 2 cpus(Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz)with
> > 40 cores.
> > If the core num is less than or equal to 16. the application with dpdk
> > works fine.But if the core num more than 16.there is something wrong with
> > it.
> >     In our test scenario(more then 16 cores), server a is a tcp client
> and
> > server b is a tcp server. Server a sends a syn packet to server B with
> > core1, and server B returns a syn ack message to server a.Although the
> hash
> > value of these two packets is the same, syn ack packets are distributed
> to
> > server a other core(not the send core),Can anyone give some help?
> >
>
> RSS hash is not symmetrical. The SYN and SYN-ACK packets have swapped
> address and port (src/dest); therefore the hash will be different.
>
> There are some weaker RSS hash keys that are symmetrical.
>

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

end of thread, other threads:[~2018-03-22  6:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21  3:13 [dpdk-users] wrong core receive the package shengxiao qian
2018-03-21 14:48 ` Stephen Hemminger
2018-03-22  6:40   ` shengxiao qian

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