[v2,2/2] qede: make driver accept bigger rss tables

Message ID 20210319094656.5576-3-irusskikh@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series qede: 2020-02 minor fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Igor Russkikh March 19, 2021, 9:46 a.m. UTC
  We found some dpdk applications blindly pass fixed side rss hash tables,
and do not check driver/device capabilities.

Moreover, many other drivers do not do such a strong check as well.

So here we fix it, making qede accept any size rss_key. For larger key
tables we just crop it with notice trace message.

CC: stable@dpdk.org
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
---
 drivers/net/qede/qede_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Jerin Jacob March 20, 2021, 1:14 p.m. UTC | #1
On Fri, Mar 19, 2021 at 3:17 PM Igor Russkikh <irusskikh@marvell.com> wrote:
>
> We found some dpdk applications blindly pass fixed side rss hash tables,

Could you rewrite the git commit by removing "We".

> and do not check driver/device capabilities.
>
> Moreover, many other drivers do not do such a strong check as well.
>
> So here we fix it, making qede accept any size rss_key. For larger key

Could you rewrite the git commit by removing "we".

> tables we just crop it with notice trace message.
>
> CC: stable@dpdk.org
> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>

Waiting for Ack to merge this.


> ---
>  drivers/net/qede/qede_ethdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
> index ab5f5b106..bfd38a977 100644
> --- a/drivers/net/qede/qede_ethdev.c
> +++ b/drivers/net/qede/qede_ethdev.c
> @@ -2139,8 +2139,10 @@ int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
>                 /* RSS hash key */
>                 if (key) {
>                         if (len > (ECORE_RSS_KEY_SIZE * sizeof(uint32_t))) {
> -                               DP_ERR(edev, "RSS key length exceeds limit\n");
> -                               return -EINVAL;
> +                               len = ECORE_RSS_KEY_SIZE * sizeof(uint32_t);
> +                               DP_NOTICE(edev, false,
> +                                         "RSS key length too big, trimmed to %d\n",
> +                                         len);
>                         }
>                         DP_INFO(edev, "Applying user supplied hash key\n");
>                         rss_params.update_rss_key = 1;
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index ab5f5b106..bfd38a977 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -2139,8 +2139,10 @@  int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
 		/* RSS hash key */
 		if (key) {
 			if (len > (ECORE_RSS_KEY_SIZE * sizeof(uint32_t))) {
-				DP_ERR(edev, "RSS key length exceeds limit\n");
-				return -EINVAL;
+				len = ECORE_RSS_KEY_SIZE * sizeof(uint32_t);
+				DP_NOTICE(edev, false,
+					  "RSS key length too big, trimmed to %d\n",
+					  len);
 			}
 			DP_INFO(edev, "Applying user supplied hash key\n");
 			rss_params.update_rss_key = 1;