[PATCH] hw/block/nvme: fix io-command set profile feature

Gollu Appalanaidu posted 1 patch 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210419104832.25455-1-anaidu.gollu@samsung.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>, Klaus Jensen <its@irrelevant.dk>, Keith Busch <kbusch@kernel.org>
hw/block/nvme.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH] hw/block/nvme: fix io-command set profile feature
Posted by Gollu Appalanaidu 3 years ago
Currently IO Command Set Profile feaure is supported, but
feature support flag not set and this feature is changable
add support for that.

Remove filling default value of feature in CQE CDW0 with zero,
since it fallbacks to default case and it is zero initialized,
if feature default value not set explicitly.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
---
 hw/block/nvme.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 624a1431d0..b5d2c29fc4 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -185,6 +185,7 @@ static const bool nvme_feature_support[NVME_FID_MAX] = {
     [NVME_WRITE_ATOMICITY]          = true,
     [NVME_ASYNCHRONOUS_EVENT_CONF]  = true,
     [NVME_TIMESTAMP]                = true,
+    [NVME_COMMAND_SET_PROFILE]      = true,
 };
 
 static const uint32_t nvme_feature_cap[NVME_FID_MAX] = {
@@ -194,6 +195,7 @@ static const uint32_t nvme_feature_cap[NVME_FID_MAX] = {
     [NVME_NUMBER_OF_QUEUES]         = NVME_FEAT_CAP_CHANGE,
     [NVME_ASYNCHRONOUS_EVENT_CONF]  = NVME_FEAT_CAP_CHANGE,
     [NVME_TIMESTAMP]                = NVME_FEAT_CAP_CHANGE,
+    [NVME_COMMAND_SET_PROFILE]      = NVME_FEAT_CAP_CHANGE,
 };
 
 static const uint32_t nvme_cse_acs[256] = {
@@ -4707,9 +4709,6 @@ defaults:
             result |= NVME_INTVC_NOCOALESCING;
         }
         break;
-    case NVME_COMMAND_SET_PROFILE:
-        result = 0;
-        break;
     default:
         result = nvme_feature_default[fid];
         break;
-- 
2.17.1


Re: [PATCH] hw/block/nvme: fix io-command set profile feature
Posted by Klaus Jensen 3 years ago
On Apr 19 16:18, Gollu Appalanaidu wrote:
>Currently IO Command Set Profile feaure is supported, but
>feature support flag not set and this feature is changable
>add support for that.
>
>Remove filling default value of feature in CQE CDW0 with zero,
>since it fallbacks to default case and it is zero initialized,
>if feature default value not set explicitly.
>
>Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
>---
> hw/block/nvme.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
>diff --git a/hw/block/nvme.c b/hw/block/nvme.c
>index 624a1431d0..b5d2c29fc4 100644
>--- a/hw/block/nvme.c
>+++ b/hw/block/nvme.c
>@@ -185,6 +185,7 @@ static const bool nvme_feature_support[NVME_FID_MAX] = {
>     [NVME_WRITE_ATOMICITY]          = true,
>     [NVME_ASYNCHRONOUS_EVENT_CONF]  = true,
>     [NVME_TIMESTAMP]                = true,
>+    [NVME_COMMAND_SET_PROFILE]      = true,
> };
>
> static const uint32_t nvme_feature_cap[NVME_FID_MAX] = {
>@@ -194,6 +195,7 @@ static const uint32_t nvme_feature_cap[NVME_FID_MAX] = {
>     [NVME_NUMBER_OF_QUEUES]         = NVME_FEAT_CAP_CHANGE,
>     [NVME_ASYNCHRONOUS_EVENT_CONF]  = NVME_FEAT_CAP_CHANGE,
>     [NVME_TIMESTAMP]                = NVME_FEAT_CAP_CHANGE,
>+    [NVME_COMMAND_SET_PROFILE]      = NVME_FEAT_CAP_CHANGE,
> };
>
> static const uint32_t nvme_cse_acs[256] = {
>@@ -4707,9 +4709,6 @@ defaults:
>             result |= NVME_INTVC_NOCOALESCING;
>         }
>         break;
>-    case NVME_COMMAND_SET_PROFILE:
>-        result = 0;
>-        break;
>     default:
>         result = nvme_feature_default[fid];
>         break;
>-- 
>2.17.1
>
>

LGTM.

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Re: [PATCH] hw/block/nvme: fix io-command set profile feature
Posted by Klaus Jensen 3 years ago
On Apr 19 16:18, Gollu Appalanaidu wrote:
>Currently IO Command Set Profile feaure is supported, but
>feature support flag not set and this feature is changable
>add support for that.
>
>Remove filling default value of feature in CQE CDW0 with zero,
>since it fallbacks to default case and it is zero initialized,
>if feature default value not set explicitly.
>
>Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
>---
> hw/block/nvme.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
>diff --git a/hw/block/nvme.c b/hw/block/nvme.c
>index 624a1431d0..b5d2c29fc4 100644
>--- a/hw/block/nvme.c
>+++ b/hw/block/nvme.c
>@@ -185,6 +185,7 @@ static const bool nvme_feature_support[NVME_FID_MAX] = {
>     [NVME_WRITE_ATOMICITY]          = true,
>     [NVME_ASYNCHRONOUS_EVENT_CONF]  = true,
>     [NVME_TIMESTAMP]                = true,
>+    [NVME_COMMAND_SET_PROFILE]      = true,
> };
>
> static const uint32_t nvme_feature_cap[NVME_FID_MAX] = {
>@@ -194,6 +195,7 @@ static const uint32_t nvme_feature_cap[NVME_FID_MAX] = {
>     [NVME_NUMBER_OF_QUEUES]         = NVME_FEAT_CAP_CHANGE,
>     [NVME_ASYNCHRONOUS_EVENT_CONF]  = NVME_FEAT_CAP_CHANGE,
>     [NVME_TIMESTAMP]                = NVME_FEAT_CAP_CHANGE,
>+    [NVME_COMMAND_SET_PROFILE]      = NVME_FEAT_CAP_CHANGE,
> };
>
> static const uint32_t nvme_cse_acs[256] = {
>@@ -4707,9 +4709,6 @@ defaults:
>             result |= NVME_INTVC_NOCOALESCING;
>         }
>         break;
>-    case NVME_COMMAND_SET_PROFILE:
>-        result = 0;
>-        break;
>     default:
>         result = nvme_feature_default[fid];
>         break;
>-- 
>2.17.1
>

Applied to nvme-next. Thanks!