Content-Type: multipart/mixed; boundary="===============6552237821554914195==" MIME-Version: 1.0 From: Rong Chen To: kbuild-all@lists.01.org Subject: Re: [PATCH v14 7/9] nvmet-passthru: Add passthru code to process commands Date: Sun, 28 Jun 2020 08:29:24 +0800 Message-ID: <5e65f225-fdbe-3d90-ed0b-99f746581402@intel.com> In-Reply-To: <84aff94b-3e0f-b193-35fe-b6fb354131b7@deltatee.com> List-Id: --===============6552237821554914195== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 6/27/20 2:31 AM, Logan Gunthorpe wrote: > > On 2020-06-26 11:19 a.m., kernel test robot wrote: >> Hi Logan, >> >> I love your patch! Yet something to improve: >> >> [auto build test ERROR on linux/master] >> [also build test ERROR on linus/master v5.8-rc2 next-20200626] >> [If your patch is applied to the wrong git tree, kindly drop us a note. >> And when submitting patch, we suggest to use as documented in >> https://git-scm.com/docs/git-format-patch] >> > The patch set is supposed to be based on nvme-5.9. There was a valid > base-commit tag in the cover letter. Hi Logan, Thanks for the feedback, we'll fix it. Best Regards, Rong Chen > > Thanks, > > Logan > > > >> url: https://github.com/0day-ci/linux/commits/Logan-Gunthorpe/nvmet-a= dd-target-passthru-commands-support/20200626-234457 >> base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.g= it 5e857ce6eae7ca21b2055cca4885545e29228fe2 >> config: mips-allyesconfig (attached as .config) >> compiler: mips-linux-gcc (GCC) 9.3.0 >> reproduce (this is a W=3D1 build): >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/s= bin/make.cross -O ~/bin/make.cross >> chmod +x ~/bin/make.cross >> # save the attached .config to linux build tree >> COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-9.3.0 make.cr= oss ARCH=3Dmips >> >> If you fix the issue, kindly add following tag as appropriate >> Reported-by: kernel test robot >> >> All errors (new ones prefixed by >>): >> >> drivers/nvme/target/passthru.c: In function 'nvmet_passthru_override= _id_ctrl': >>>> drivers/nvme/target/passthru.c:212:15: error: 'const struct nvmet_fabr= ics_ops' has no member named 'flags' >> 212 | if (ctrl->ops->flags & NVMF_KEYED_SGLS) >> | ^~ >>>> drivers/nvme/target/passthru.c:212:25: error: 'NVMF_KEYED_SGLS' undecl= ared (first use in this function) >> 212 | if (ctrl->ops->flags & NVMF_KEYED_SGLS) >> | ^~~~~~~~~~~~~~~ >> drivers/nvme/target/passthru.c:212:25: note: each undeclared identif= ier is reported only once for each function it appears in >> >> vim +212 drivers/nvme/target/passthru.c >> >> 156 = >> 157 static u16 nvmet_passthru_override_id_ctrl(struct nvmet_req *req) >> 158 { >> 159 struct nvmet_ctrl *ctrl =3D req->sq->ctrl; >> 160 struct nvme_ctrl *pctrl =3D ctrl->subsys->passthru_ctrl; >> 161 u16 status =3D NVME_SC_SUCCESS; >> 162 struct nvme_id_ctrl *id; >> 163 u32 max_hw_sectors; >> 164 int page_shift; >> 165 = >> 166 id =3D kzalloc(sizeof(*id), GFP_KERNEL); >> 167 if (!id) >> 168 return NVME_SC_INTERNAL; >> 169 = >> 170 status =3D nvmet_copy_from_sgl(req, 0, id, sizeof(*id)); >> 171 if (status) >> 172 goto out_free; >> 173 = >> 174 id->cntlid =3D cpu_to_le16(ctrl->cntlid); >> 175 id->ver =3D cpu_to_le32(ctrl->subsys->ver); >> 176 = >> 177 /* >> 178 * The passthru NVMe driver may have a limit on the number of s= egments >> 179 * which depends on the host's memory fragementation. To solve = this, >> 180 * ensure mdts is limitted to the pages equal to the number of >> 181 * segments. >> 182 */ >> 183 max_hw_sectors =3D min_not_zero(pctrl->max_segments << (PAGE_SH= IFT - 9), >> 184 pctrl->max_hw_sectors); >> 185 = >> 186 page_shift =3D NVME_CAP_MPSMIN(ctrl->cap) + 12; >> 187 = >> 188 id->mdts =3D ilog2(max_hw_sectors) + 9 - page_shift; >> 189 = >> 190 id->acl =3D 3; >> 191 /* >> 192 * We export aerl limit for the fabrics controller, update this= when >> 193 * passthru based aerl support is added. >> 194 */ >> 195 id->aerl =3D NVMET_ASYNC_EVENTS - 1; >> 196 = >> 197 /* emulate kas as most of the PCIe ctrl don't have a support fo= r kas */ >> 198 id->kas =3D cpu_to_le16(NVMET_KAS); >> 199 = >> 200 /* don't support host memory buffer */ >> 201 id->hmpre =3D 0; >> 202 id->hmmin =3D 0; >> 203 = >> 204 id->sqes =3D min_t(__u8, ((0x6 << 4) | 0x6), id->sqes); >> 205 id->cqes =3D min_t(__u8, ((0x4 << 4) | 0x4), id->cqes); >> 206 id->maxcmd =3D cpu_to_le16(NVMET_MAX_CMD); >> 207 = >> 208 /* don't support fuse commands */ >> 209 id->fuses =3D 0; >> 210 = >> 211 id->sgls =3D cpu_to_le32(1 << 0); /* we always support SGLs */ >> > 212 if (ctrl->ops->flags & NVMF_KEYED_SGLS) >> 213 id->sgls |=3D cpu_to_le32(1 << 2); >> 214 if (req->port->inline_data_size) >> 215 id->sgls |=3D cpu_to_le32(1 << 20); >> 216 = >> 217 /* >> 218 * When passsthru controller is setup using nvme-loop transport= it will >> 219 * export the passthru ctrl subsysnqn (PCIe NVMe ctrl) and will= fail in >> 220 * the nvme/host/core.c in the nvme_init_subsystem()->nvme_acti= ve_ctrl() >> 221 * code path with duplicate ctr subsynqn. In order to prevent t= hat we >> 222 * mask the passthru-ctrl subsysnqn with the target ctrl subsys= nqn. >> 223 */ >> 224 memcpy(id->subnqn, ctrl->subsysnqn, sizeof(id->subnqn)); >> 225 = >> 226 /* use fabric id-ctrl values */ >> 227 id->ioccsz =3D cpu_to_le32((sizeof(struct nvme_command) + >> 228 req->port->inline_data_size) / 16); >> 229 id->iorcsz =3D cpu_to_le32(sizeof(struct nvme_completion) / 16); >> 230 = >> 231 id->msdbd =3D ctrl->ops->msdbd; >> 232 = >> 233 /* Support multipath connections with fabrics */ >> 234 id->cmic |=3D 1 << 1; >> 235 = >> 236 /* Disable reservations, see nvmet_parse_passthru_io_cmd() */ >> 237 id->oncs &=3D cpu_to_le16(~NVME_CTRL_ONCS_RESERVATIONS); >> 238 = >> 239 status =3D nvmet_copy_to_sgl(req, 0, id, sizeof(struct nvme_id_= ctrl)); >> 240 = >> 241 out_free: >> 242 kfree(id); >> 243 return status; >> 244 } >> 245 = >> >> --- >> 0-DAY CI Kernel Test Service, Intel Corporation >> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org >> --===============6552237821554914195==--