Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-13 Thread fengchengwen
On 2024/9/14 10:54, Stephen Hemminger wrote: > On Fri, 13 Sep 2024 10:55:08 +0800 > "WanRenyong" wrote: > >>> Ioctl API is used for interaction between PMD and kernel driver. As you said, ioctl is the worst API, should I consider using read and write instead? >>> It seemed

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-13 Thread Stephen Hemminger
On Fri, 13 Sep 2024 10:55:08 +0800 "WanRenyong" wrote: > > > >> Ioctl API is used for interaction between PMD and kernel driver. As you > >> said, ioctl is > >> > >> the worst API, should I consider using read and write instead? > > It seemed the ioctl couldn't handle VF located in VM, and in

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-12 Thread WanRenyong
On 2024/9/12 17:18, fengchengwen wrote: > On 2024/9/12 16:19, WanRenyong wrote: >> On 2024/9/12 13:50, Stephen Hemminger wrote: >>> On Thu, 12 Sep 2024 12:14:08 +0800 >>> "WanRenyong" wrote: >>> > >> +}; >> + > Does this device driver depend on some upstr Yes, it depends o

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-12 Thread fengchengwen
On 2024/9/12 16:19, WanRenyong wrote: > On 2024/9/12 13:50, Stephen Hemminger wrote: >> On Thu, 12 Sep 2024 12:14:08 +0800 >> "WanRenyong" wrote: >> > +}; > + Does this device driver depend on some upstr >>> Yes, it depends on linux kernel driver of the device. >>> >>> Hello,

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-12 Thread WanRenyong
On 2024/9/12 13:50, Stephen Hemminger wrote: > On Thu, 12 Sep 2024 12:14:08 +0800 > "WanRenyong" wrote: > >>> +}; + >>> Does this device driver depend on some upstr >> Yes, it depends on linux kernel driver of the device. >> >> Hello, Stephen, >> >> Thanks for your review,  please see

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-11 Thread Stephen Hemminger
On Thu, 12 Sep 2024 12:14:08 +0800 "WanRenyong" wrote: > > > >> +}; > >> + > > Does this device driver depend on some upstr > Yes, it depends on linux kernel driver of the device. > > Hello, Stephen, > > Thanks for your review,  please see above. What is the driver? I don't see in the cu

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-11 Thread WanRenyong
On 2024/9/11 11:50, Stephen Hemminger wrote: > On Wed, 11 Sep 2024 10:07:26 +0800 > "WanRenyong" wrote: > >> +#define XSC_IOCTL_CHECK_FIELD 0x01234567 >> + >> +#define XSC_IOCTL_MAGIC 0x1b >> +#define XSC_IOCTL_CMDQ \ >> +_IOWR(XSC_IOCTL_MAGIC, 1, struct xsc_ioctl_hdr) >> +#define XS

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-11 Thread WanRenyong
On 2024/9/11 11:49, Stephen Hemminger wrote: > On Wed, 11 Sep 2024 10:07:26 +0800 > "WanRenyong" wrote: > >> +if (data_in != NULL && in_len > 0) >> +rte_memcpy(hdr + 1, data_in, in_len); >> + >> +ret = ioctl(dev->ctrl_fd, cmd, hdr); >> +if (ret == 0) { >> +if (h

Re: [PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-11 Thread WanRenyong
On 2024/9/11 11:48, Stephen Hemminger wrote: > On Wed, 11 Sep 2024 10:07:26 +0800 > "WanRenyong" wrote: > >> +hdr = rte_zmalloc(NULL, alloc_len, RTE_CACHE_LINE_SIZE); >> +if (hdr == NULL) { >> +PMD_DRV_LOG(ERR, "Failed to allocate xsc ioctl cmd memory"); >> +return

[PATCH v2 05/19] net/xsc: add ioctl command interface

2024-09-10 Thread WanRenyong
IOCTL command interface is one of methods used to interact with firmware by PMD. By using ioctl interface, PMD sends command to the kernel module, then the kernel module translates the command and sends it to firmware, at last, the kernel module send back PDM the result from firmware. Signed-off-b