File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -1017,7 +1017,7 @@ u16 nvmet_parse_admin_cmd(struct nvmet_req *req)
1017
1017
u16 ret ;
1018
1018
1019
1019
if (nvme_is_fabrics (cmd ))
1020
- return nvmet_parse_fabrics_cmd (req );
1020
+ return nvmet_parse_fabrics_admin_cmd (req );
1021
1021
if (nvmet_is_disc_subsys (nvmet_req_subsys (req )))
1022
1022
return nvmet_parse_discovery_cmd (req );
1023
1023
Original file line number Diff line number Diff line change @@ -865,8 +865,12 @@ static inline u16 nvmet_io_cmd_check_access(struct nvmet_req *req)
865
865
866
866
static u16 nvmet_parse_io_cmd (struct nvmet_req * req )
867
867
{
868
+ struct nvme_command * cmd = req -> cmd ;
868
869
u16 ret ;
869
870
871
+ if (nvme_is_fabrics (cmd ))
872
+ return nvmet_parse_fabrics_io_cmd (req );
873
+
870
874
ret = nvmet_check_ctrl_status (req );
871
875
if (unlikely (ret ))
872
876
return ret ;
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ static void nvmet_execute_prop_get(struct nvmet_req *req)
82
82
nvmet_req_complete (req , status );
83
83
}
84
84
85
- u16 nvmet_parse_fabrics_cmd (struct nvmet_req * req )
85
+ u16 nvmet_parse_fabrics_admin_cmd (struct nvmet_req * req )
86
86
{
87
87
struct nvme_command * cmd = req -> cmd ;
88
88
@@ -103,6 +103,21 @@ u16 nvmet_parse_fabrics_cmd(struct nvmet_req *req)
103
103
return 0 ;
104
104
}
105
105
106
+ u16 nvmet_parse_fabrics_io_cmd (struct nvmet_req * req )
107
+ {
108
+ struct nvme_command * cmd = req -> cmd ;
109
+
110
+ switch (cmd -> fabrics .fctype ) {
111
+ default :
112
+ pr_debug ("received unknown capsule type 0x%x\n" ,
113
+ cmd -> fabrics .fctype );
114
+ req -> error_loc = offsetof(struct nvmf_common_command , fctype );
115
+ return NVME_SC_INVALID_OPCODE | NVME_SC_DNR ;
116
+ }
117
+
118
+ return 0 ;
119
+ }
120
+
106
121
static u16 nvmet_install_queue (struct nvmet_ctrl * ctrl , struct nvmet_req * req )
107
122
{
108
123
struct nvmf_connect_command * c = & req -> cmd -> connect ;
Original file line number Diff line number Diff line change @@ -420,7 +420,8 @@ u16 nvmet_file_parse_io_cmd(struct nvmet_req *req);
420
420
u16 nvmet_bdev_zns_parse_io_cmd (struct nvmet_req * req );
421
421
u16 nvmet_parse_admin_cmd (struct nvmet_req * req );
422
422
u16 nvmet_parse_discovery_cmd (struct nvmet_req * req );
423
- u16 nvmet_parse_fabrics_cmd (struct nvmet_req * req );
423
+ u16 nvmet_parse_fabrics_admin_cmd (struct nvmet_req * req );
424
+ u16 nvmet_parse_fabrics_io_cmd (struct nvmet_req * req );
424
425
425
426
bool nvmet_req_init (struct nvmet_req * req , struct nvmet_cq * cq ,
426
427
struct nvmet_sq * sq , const struct nvmet_fabrics_ops * ops );
You can’t perform that action at this time.
0 commit comments