<feed xmlns='http://www.w3.org/2005/Atom'>
<title>blackbird-op-linux/drivers/net/ethernet/amazon, branch master</title>
<subtitle>Blackbird™ Linux sources for OpenPOWER</subtitle>
<id>https://git.raptorcs.com/git/blackbird-op-linux/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/blackbird-op-linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/'/>
<updated>2020-02-12T01:08:31+00:00</updated>
<entry>
<title>net: ena: ena-com.c: prevent NULL pointer dereference</title>
<updated>2020-02-12T01:08:31+00:00</updated>
<author>
<name>Arthur Kiyanovski</name>
<email>akiyano@amazon.com</email>
</author>
<published>2020-02-11T15:17:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=c207979f5ae10ed70aff1bb13f39f0736973de99'/>
<id>urn:sha1:c207979f5ae10ed70aff1bb13f39f0736973de99</id>
<content type='text'>
comp_ctx can be NULL in a very rare case when an admin command is executed
during the execution of ena_remove().

The bug scenario is as follows:

* ena_destroy_device() sets the comp_ctx to be NULL
* An admin command is executed before executing unregister_netdev(),
  this can still happen because our device can still receive callbacks
  from the netdev infrastructure such as ethtool commands.
* When attempting to access the comp_ctx, the bug occurs since it's set
  to NULL

Fix:
Added a check that comp_ctx is not NULL

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: Arthur Kiyanovski &lt;akiyano@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: ethtool: use correct value for crc32 hash</title>
<updated>2020-02-12T01:08:31+00:00</updated>
<author>
<name>Sameeh Jubran</name>
<email>sameehj@amazon.com</email>
</author>
<published>2020-02-11T15:17:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=886d2089276e40d460731765083a741c5c762461'/>
<id>urn:sha1:886d2089276e40d460731765083a741c5c762461</id>
<content type='text'>
Up till kernel 4.11 there was no enum defined for crc32 hash in ethtool,
thus the xor enum was used for supporting crc32.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE</title>
<updated>2020-02-12T01:08:31+00:00</updated>
<author>
<name>Arthur Kiyanovski</name>
<email>akiyano@amazon.com</email>
</author>
<published>2020-02-11T15:17:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=470793a78ce344bd53d31e0c2d537f71ba957547'/>
<id>urn:sha1:470793a78ce344bd53d31e0c2d537f71ba957547</id>
<content type='text'>
As the name suggests ETH_RSS_HASH_NO_CHANGE is received upon changing
the key or indirection table using ethtool while keeping the same hash
function.

Also add a function for retrieving the current hash function from
the ena-com layer.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: Saeed Bshara &lt;saeedb@amazon.com&gt;
Signed-off-by: Arthur Kiyanovski &lt;akiyano@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: fix corruption of dev_idx_to_host_tbl</title>
<updated>2020-02-12T01:08:31+00:00</updated>
<author>
<name>Arthur Kiyanovski</name>
<email>akiyano@amazon.com</email>
</author>
<published>2020-02-11T15:17:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=e3f89f91e98ce07dc0f121a3b70d21aca749ba39'/>
<id>urn:sha1:e3f89f91e98ce07dc0f121a3b70d21aca749ba39</id>
<content type='text'>
The function ena_com_ind_tbl_convert_from_device() has an overflow
bug as explained below. Either way, this function is not needed at
all since we don't retrieve the indirection table from the device
at any point which means that this conversion is not needed.

The bug:
The for loop iterates over all io_sq_queues, when passing the actual
number of used queues the io_sq_queues[i].idx equals 0 since they are
uninitialized which results in the following code to be executed till
the end of the loop:

dev_idx_to_host_tbl[0] = i;

This results dev_idx_to_host_tbl[0] in being equal to
ENA_TOTAL_NUM_QUEUES - 1.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: Arthur Kiyanovski &lt;akiyano@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: fix incorrectly saving queue numbers when setting RSS indirection table</title>
<updated>2020-02-12T01:08:31+00:00</updated>
<author>
<name>Arthur Kiyanovski</name>
<email>akiyano@amazon.com</email>
</author>
<published>2020-02-11T15:17:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=92569fd27f5cb0ccbdf7c7d70044b690e89a0277'/>
<id>urn:sha1:92569fd27f5cb0ccbdf7c7d70044b690e89a0277</id>
<content type='text'>
The indirection table has the indices of the Rx queues. When we store it
during set indirection operation, we convert the indices to our internal
representation of the indices.

Our internal representation of the indices is: even indices for Tx and
uneven indices for Rx, where every Tx/Rx pair are in a consecutive order
starting from 0. For example if the driver has 3 queues (3 for Tx and 3
for Rx) then the indices are as follows:
0  1  2  3  4  5
Tx Rx Tx Rx Tx Rx

The BUG:
The issue is that when we satisfy a get request for the indirection
table, we don't convert the indices back to the original representation.

The FIX:
Simply apply the inverse function for the indices of the indirection
table after we set it.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: Arthur Kiyanovski &lt;akiyano@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: rss: store hash function as values and not bits</title>
<updated>2020-02-12T01:08:31+00:00</updated>
<author>
<name>Arthur Kiyanovski</name>
<email>akiyano@amazon.com</email>
</author>
<published>2020-02-11T15:17:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=4844470d472d660c26149ad764da2406adb13423'/>
<id>urn:sha1:4844470d472d660c26149ad764da2406adb13423</id>
<content type='text'>
The device receives, stores and retrieves the hash function value as bits
and not as their enum value.

The bug:
* In ena_com_set_hash_function() we set
  cmd.u.flow_hash_func.selected_func to the bit value of rss-&gt;hash_func.
 (1 &lt;&lt; rss-&gt;hash_func)
* In ena_com_get_hash_function() we retrieve the hash function and store
  it's bit value in rss-&gt;hash_func. (Now the bit value of rss-&gt;hash_func
  is stored in rss-&gt;hash_func instead of it's enum value)

The fix:
This commit fixes the issue by converting the retrieved hash function
values from the device to the matching enum value of the set bit using
ffs(). ffs() finds the first set bit's index in a word. Since the function
returns 1 for the LSB's index, we need to subtract 1 from the returned
value (note that BIT(0) is 1).

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: Arthur Kiyanovski &lt;akiyano@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: rss: fix failure to get indirection table</title>
<updated>2020-02-12T01:08:30+00:00</updated>
<author>
<name>Sameeh Jubran</name>
<email>sameehj@amazon.com</email>
</author>
<published>2020-02-11T15:17:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=0c8923c0a64fb5d14bebb9a9065d2dc25ac5e600'/>
<id>urn:sha1:0c8923c0a64fb5d14bebb9a9065d2dc25ac5e600</id>
<content type='text'>
On old hardware, getting / setting the hash function is not supported while
gettting / setting the indirection table is.

This commit enables us to still show the indirection table on older
hardwares by setting the hash function and key to NULL.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: rss: do not allocate key when not supported</title>
<updated>2020-02-12T01:08:30+00:00</updated>
<author>
<name>Sameeh Jubran</name>
<email>sameehj@amazon.com</email>
</author>
<published>2020-02-11T15:17:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=6a4f7dc82d1e3abd3feb0c60b5041056fcd9880c'/>
<id>urn:sha1:6a4f7dc82d1e3abd3feb0c60b5041056fcd9880c</id>
<content type='text'>
Currently we allocate the key whether the device supports setting the
key or not. This commit adds a check to the allocation function and
handles the error accordingly.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: fix incorrect default RSS key</title>
<updated>2020-02-12T01:08:30+00:00</updated>
<author>
<name>Arthur Kiyanovski</name>
<email>akiyano@amazon.com</email>
</author>
<published>2020-02-11T15:17:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=0d1c3de7b8c78a5e44b74b62ede4a63629f5d811'/>
<id>urn:sha1:0d1c3de7b8c78a5e44b74b62ede4a63629f5d811</id>
<content type='text'>
Bug description:
When running "ethtool -x &lt;if_name&gt;" the key shows up as all zeros.

When we use "ethtool -X &lt;if_name&gt; hfunc toeplitz hkey &lt;some:random:key&gt;" to
set the key and then try to retrieve it using "ethtool -x &lt;if_name&gt;" then
we return the correct key because we return the one we saved.

Bug cause:
We don't fetch the key from the device but instead return the key
that we have saved internally which is by default set to zero upon
allocation.

Fix:
This commit fixes the issue by initializing the key to a random value
using netdev_rss_key_fill().

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran &lt;sameehj@amazon.com&gt;
Signed-off-by: Arthur Kiyanovski &lt;akiyano@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ena: add missing ethtool TX timestamping indication</title>
<updated>2020-02-12T01:08:30+00:00</updated>
<author>
<name>Arthur Kiyanovski</name>
<email>akiyano@amazon.com</email>
</author>
<published>2020-02-11T15:17:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=cf6d17fde93bdda23c9b02dd5906a12bf8c55209'/>
<id>urn:sha1:cf6d17fde93bdda23c9b02dd5906a12bf8c55209</id>
<content type='text'>
Current implementation of the driver calls skb_tx_timestamp()to add a
software tx timestamp to the skb, however the software-transmit capability
is not reported in ethtool -T.

This commit updates the ethtool structure to report the software-transmit
capability in ethtool -T using the standard ethtool_op_get_ts_info().
This function reports all software timestamping capabilities (tx and rx),
as well as setting phc_index = -1. phc_index is the index of the PTP
hardware clock device that will be used for hardware timestamps. Since we
don't have such a device in ENA, using the default -1 value is the correct
setting.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Ezequiel Lara Gomez &lt;ezegomez@amazon.com&gt;
Signed-off-by: Arthur Kiyanovski &lt;akiyano@amazon.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
