aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/nvmet.h
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2018-01-24 20:27:10 +0200
committerJens Axboe <axboe@kernel.dk>2018-03-26 08:53:43 -0600
commit4c65268588102014837b2d09e5a02557e5d3fc9e (patch)
tree2778e3f03905f2b14faf5bf3df397c6be7719936 /drivers/nvme/target/nvmet.h
parentnet/utils: Introduce inet_addr_is_any (diff)
downloadlinux-dev-4c65268588102014837b2d09e5a02557e5d3fc9e.tar.xz
linux-dev-4c65268588102014837b2d09e5a02557e5d3fc9e.zip
nvmet: don't return "any" ip address in discovery log page
Its perfectly valid to assign a nvmet port to listen on "any" IP address (traddr 0.0.0.0 for ipv4 address family) for IP based transport ports. However, we must not return this address in discovery log entries. Instead we need to return the address where the request was accepted on (req->port address). Since this is nvme transport specific, introduce an optional .disc_traddr interface that is designed to check that a port in question is bound to "any" IP address and if so, set the traddr from the port where the request came from. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/target/nvmet.h')
-rw-r--r--drivers/nvme/target/nvmet.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 417f6c0331cc..40afb5d6ed91 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -209,6 +209,8 @@ struct nvmet_fabrics_ops {
int (*add_port)(struct nvmet_port *port);
void (*remove_port)(struct nvmet_port *port);
void (*delete_ctrl)(struct nvmet_ctrl *ctrl);
+ void (*disc_traddr)(struct nvmet_req *req,
+ struct nvmet_port *port, char *traddr);
};
#define NVMET_MAX_INLINE_BIOVEC 8