[PATCH] nvmet: Add support for FDP devices in fabrics passthru path

Nitesh Shetty posted 1 patch 2 months, 3 weeks ago
drivers/nvme/target/passthru.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] nvmet: Add support for FDP devices in fabrics passthru path
Posted by Nitesh Shetty 2 months, 3 weeks ago
In nvmet passthru path FDP is disabled, because of failure of
admin_get_features FDP(0x1d) feature command.
Supporting this through nvmet_setup_passthru_command enables FDP.

Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
---
 drivers/nvme/target/passthru.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index b7515c53829b..bf27ae4c42dc 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -460,6 +460,7 @@ static u16 nvmet_passthru_get_set_features(struct nvmet_req *req)
 	case NVME_FEAT_PLM_WINDOW:
 	case NVME_FEAT_HOST_BEHAVIOR:
 	case NVME_FEAT_SANITIZE:
+	case NVME_FEAT_FDP:
 	case NVME_FEAT_VENDOR_START ... NVME_FEAT_VENDOR_END:
 		return nvmet_setup_passthru_command(req);
 

base-commit: 3f31a806a62e44f7498e2d17719c03f816553f11
-- 
2.43.0
Re: [PATCH] nvmet: Add support for FDP devices in fabrics passthru path
Posted by Christoph Hellwig 2 months, 3 weeks ago
On Tue, Jul 15, 2025 at 11:48:04AM +0530, Nitesh Shetty wrote:
> In nvmet passthru path FDP is disabled, because of failure of
> admin_get_features FDP(0x1d) feature command.
> Supporting this through nvmet_setup_passthru_command enables FDP.

I don't think this is safe - the feature has endurance group scope
and thus can affect other controllers not passed through as well.
Re: [PATCH] nvmet: Add support for FDP devices in fabrics passthru path
Posted by Nitesh Shetty 2 months, 3 weeks ago
On 15/07/25 10:09AM, Christoph Hellwig wrote:
>On Tue, Jul 15, 2025 at 11:48:04AM +0530, Nitesh Shetty wrote:
>> In nvmet passthru path FDP is disabled, because of failure of
>> admin_get_features FDP(0x1d) feature command.
>> Supporting this through nvmet_setup_passthru_command enables FDP.
>
>I don't think this is safe - the feature has endurance group scope
>and thus can affect other controllers not passed through as well.
>
Agree, how about only enabling only for nvme_admin_get_features,
but not for nvme_admin_set_features, something like below?

--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -533,6 +533,8 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
  		case NVME_FEAT_HOST_ID:
  			req->execute = nvmet_execute_get_features;
  			return NVME_SC_SUCCESS;
+		case NVME_FEAT_FDP:
+			return nvmet_setup_passthru_command(req);
  		default:
  			return nvmet_passthru_get_set_features(req);
  		}

Thanks,
Nitesh
Re: [PATCH] nvmet: Add support for FDP devices in fabrics passthru path
Posted by Christoph Hellwig 2 months, 3 weeks ago
On Wed, Jul 16, 2025 at 02:13:55PM +0530, Nitesh Shetty wrote:
> On 15/07/25 10:09AM, Christoph Hellwig wrote:
>> On Tue, Jul 15, 2025 at 11:48:04AM +0530, Nitesh Shetty wrote:
>>> In nvmet passthru path FDP is disabled, because of failure of
>>> admin_get_features FDP(0x1d) feature command.
>>> Supporting this through nvmet_setup_passthru_command enables FDP.
>>
>> I don't think this is safe - the feature has endurance group scope
>> and thus can affect other controllers not passed through as well.
>>
> Agree, how about only enabling only for nvme_admin_get_features,
> but not for nvme_admin_set_features, something like below?

Yes, that looks fine.