Discussion:
targ dir issue
(too old to reply)
や もり
2021-08-24 19:14:38 UTC
Permalink
* { margin: 0; font-size: 13px; font-family: 'MS Pゎシック', sans-serif;}a { color: #0064c8; text-decoration: none;}a:hover { color: #0057af; text-decoration: underline;}a:active { color: #004c98;}
Hi




I port ncv to eps for NCR53C500. And Support targ at esp.




I have question for targ.




inquery data is send by scsi_target apprication by CAM_DIR_IN.




But CAM_DIR_IN not copyin.




https://svnweb.freebsd.org/base/head/sys/cam/cam_periph.c?view=markup#l929




Why different ?




Hiroki Mori
Kenneth D. Merry
2021-08-30 16:51:33 UTC
Permalink
* { margin: 0; font-size: 13px; font-family: 'MS P????????????', sans-serif;}a { color: #0064c8; text-decoration: none;}a:hover { color: #0057af; text-decoration: underline;}a:active { color: #004c98;}
Hi
I port ncv to eps for NCR53C500. And Support targ at esp.
I have question for targ.
inquery data is send by scsi_target apprication by CAM_DIR_IN.
But CAM_DIR_IN not copyin.
https://svnweb.freebsd.org/base/head/sys/cam/cam_periph.c?view=markup#l929
Why different ?
I think that may be a bug. I see that if you have an XPT_CONT_TARGET_IO
CCB, for an INQUIRY, as you would in your case, it would be CAM_DIR_IN, but
would need to copy the data from userland into the kernel.

It looks like it changed in SVN revision 345656.

I have CCed Alexander Motin, he originally wrote that change and can take a
look at it.
Hiroki Mori
Thanks,

Ken
--
Kenneth Merry
***@FreeBSD.ORG


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Alexander Motin
2021-08-30 17:12:23 UTC
Permalink
Hi,
Post by Kenneth D. Merry
* { margin: 0; font-size: 13px; font-family: 'MS P????????????', sans-serif;}a { color: #0064c8; text-decoration: none;}a:hover { color: #0057af; text-decoration: underline;}a:active { color: #004c98;}
Hi
I port ncv to eps for NCR53C500. And Support targ at esp.
I have question for targ.
inquery data is send by scsi_target apprication by CAM_DIR_IN.
But CAM_DIR_IN not copyin.
https://svnweb.freebsd.org/base/head/sys/cam/cam_periph.c?view=markup#l929
Why different ?
I think that may be a bug. I see that if you have an XPT_CONT_TARGET_IO
CCB, for an INQUIRY, as you would in your case, it would be CAM_DIR_IN, but
would need to copy the data from userland into the kernel.
It looks like it changed in SVN revision 345656.
I have CCed Alexander Motin, he originally wrote that change and can take a
look at it.
It seems like a bug indeed. XPT_CONT_TARGET_IO has opposite meaning of
IN/OUT, since those are always interpreted as seen by initiator, so the
dirs[i] != CAM_DIR_IN should become dirs[i] != CAM_DIR_OUT for
XPT_CONT_TARGET_IO, and respectively b_iocmd setting below and in
cam_periph_unmapmem(). It went unnoticed because CTL does not use this
code, while I don't know anybody using user-space target targ(4) API.

It would be good to both fix this issue for targ(4) (I'd appreciate a
tested patch, since I am not using targ(4)), and if you are testing
esp(4) in target mode, test it with CTL also.
--
Alexander Motin


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...