From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 930E1EDE981 for ; Thu, 14 Sep 2023 05:51:46 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1qgfGB-00036E-10; Thu, 14 Sep 2023 01:51:27 -0400 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qgfG9-000366-0W for kernelnewbies@kernelnewbies.org; Thu, 14 Sep 2023 01:51:25 -0400 Received: from unknown (HELO send001-relay.gov-dooray.com) (211.180.235.152) by 129.254.9.16 with ESMTP; 14 Sep 2023 14:51:21 +0900 X-Original-SENDERIP: 211.180.235.152 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send001-relay.gov-dooray.com with SMTP id 8adb662665029f59; Thu, 14 Sep 2023 14:51:21 +0900 DKIM-Signature: a=rsa-sha256; b=wtEtm4b+TyzMrRdN/5wU9IPUg9InXVV0VcKuuLJrhKCha1fBXhctKeJ5P4/btV3qPElklzEWU5 A2lCiHmm+ckSHhj/ADFfeRVAKDtq7qOjsDNMTVHD2sB05mwxJEAvG0fk7UYt+Mh0M90h8+4Wz48I D97CgIUQS2ISg99q40NPK4zFECe8ykNhbWwkNFZRgFyPSbrBOYFGqrEWvUGKAu/Hrou39ktg/KMY A202UDZnoRrzjY5SYLcoJn+xDxAMVKyROtBi3kYm/0wVdFKNH0wdQssBJvUKnGtcXRuLZCZkXN7s d/iKBfft03Wzo5i0+EDbFXmgSIwnql8t2/moyENA==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=k3G+dF5sDU2ebF8cFw+Lls3NJBV0obPGlgZqVNW6OFg=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id e42c84b065029f59; Thu, 14 Sep 2023 14:51:21 +0900 From: "Chan Kim" To: References: <027c01d9e6cd$bd3c4c70$37b4e550$@etri.re.kr> In-Reply-To: <027c01d9e6cd$bd3c4c70$37b4e550$@etri.re.kr> Subject: RE: A question on endpoint_test code in the linux source by Kishon Vijay Abraham I. Date: Thu, 14 Sep 2023 14:51:19 +0900 Message-ID: <027e01d9e6cf$7bdfbee0$739f3ca0$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: ko Thread-Index: AQGbeVSPsqpphv65s3SlwJkXqyvAHbCWqvnA X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Oh, I right after I sent my previous email, I realized how it's working. The endpoint test driver (drivers/pci/endpoint/functions/pci-epf-test.c) queues delayed work after linkup or binding (binding epc and epf), or after processing the delayed work (re-queues). And in the delayed work performs the function "pci_epf_test_cmd_handler" and there it reads the command register and performs various actions including DMA read for the 'write test from the RC' that I mentioned in my previous email. After it performs the command, it sends interrupt to the host using rais_irq function. I had analyzed this pci-epf-test.c before and right after sending my question I realized how it's working after searching 'raise_irq' in the endpoint test code. Thank you. Best regards, Chan Kim >-----Original Message----- >From: Chan Kim >Sent: Thursday, September 14, 2023 2:39 PM >To: kernelnewbies@kernelnewbies.org >Subject: A question on endpoint_test code in the linux source by Kishon >Vijay Abraham I. > >Hello linux experts, > >I was analyzing drivers/misc/pci_endpoint_test.c (linux-5.15.68) It uses a >miscdev and when the driver receives PCITEST_WRITE command using ioctl(line >726 in the link below) from the user, the driver sets registers of the >endpoint device and writes COMMAND_READ at register >PCI_ENDPOINT_TEST_COMMAND >(https://elixir.bootlin.com/linux/v5.15.68/source/drivers/misc/pci_endpoin >t_ >test.c#L553 ). This seems to be setting DMA paramaters (source DMA address >and size) and triggering DMA. The driver then waits for completion and I can >see the interrupt service routine completes the completion(test->irq_raised). >I guess the endpoint device should actually do the DMA-read (when told to >use DMA) or read the data to itself(I don't know where it is) and send >interrupt to the host(using msix or msi or intx). > >The code was written by "Kishon Vijay Abraham I" and I know it is supposed >to be run with drivers/pci/endpoint/functions/pci-epf-test.c >(https://elixir.bootlin.com/linux/v5.15.68/source/drivers/pci/endpoint/fun >ct >ions/pci-epf-test.c) in the endpoint side. And how to use this endpoint >framework test is shown in https://docs.kernel.org/PCI/endpoint/pci-test- >howto.html . But I cannot find where the actual DMA and sending interrupt is >occurring in the endpoint side source code when the registers at set. Am I >supposed to be running this code with some real hardware?(as listed in the >pci_device_id in the hostside pci_endpoint_test.c driver?) Where can I find >the corresponding (acting on the register triggering above) action in the >endpoint side? > >If you have once seen these codes and send me any hint or suggestion, I'll >be grateful. >Thank you. > >Best regards, >Chan Kim > > > > > >_______________________________________________ >Kernelnewbies mailing list >Kernelnewbies@kernelnewbies.org >https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies