From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7C3FFA00BE; Tue, 14 Jun 2022 12:25:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2088240DDD; Tue, 14 Jun 2022 12:25:50 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2063.outbound.protection.outlook.com [40.107.237.63]) by mails.dpdk.org (Postfix) with ESMTP id A042740C35 for ; Tue, 14 Jun 2022 12:25:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZ5BOYkC8G8bzKiQeC3n1xDbE6jZ8ybkCCnoS2Z3Ow63Zs0qrOJ7wQ1L0jWgdr+Ubjrf690QUTNyavpg9eV4MxYAMn944x/9LGO5kflcjSR9TNfGjbAlOxyAlScTmdO2ry7kFUVgoBpRFzlqy8ixgO144+iKeC1l0Wsk2NwCewiDTRC8LL0qqfCQfI3qh2CXRr19xxJ2OeqPHKGDhemmAxxfNEd6mqAI5OOi8EY8b2xnmNGhQeMvHl8nYRJY5pMS3Wzn1aOiLxjmdyym0eqVpNqQuEDG+Vg74PPFIS+FM+KLVpGW1/1ljZBFq6eR8cszQB5eOEvzxfbWVaV0iOSMZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Bv3mpgQGKqxuk9/oomb51O7gctodcwDpbK20WDNy8oE=; b=hDDvyn5kdTitg9i650OrFzbTmCjHFyNcaqcF132vYTDvkpV/goBN9n4WQFt/tE79poEf7BIjC8O55Bg8fsT7F6dRC86YOFdWOyxSUSvUXa0IwPu0jNI5fnncW8LwC9Nv7nUE+Xwo0M4AFB97gLW8UJbOWzzv5b/Z9i0NLlgrx8e2kAQwkWeAoRqRVJo56lv29dIPqr3uU/TVsVf0VRPh48vHUl+Zm3KDG9YsCyodpK/7QQX1o0CA/NLCvjnkI6amYUeoSDjdgIvtxWLP+xrd+tuXVOzYZ489vk9J4id4eWqGQ888hnwHhm7rRMQoolKPonvRuEYkj8xUst+c1VfndA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=intel.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Bv3mpgQGKqxuk9/oomb51O7gctodcwDpbK20WDNy8oE=; b=K1CpHbqcUZ5WTeIcVaUhAvK6IAfuOPPdVmAaWQ+m2Ms9V1xGbnlAzLd2rWtWvxwttvAvxmKGvq1YtJGpFQ5TzxpBoyXyJOogaIfyalH31dT9mLETeSwGDINxKArIWo+FNIcrTsHYvK8sgOgt4x8CqdwLD6NwxRvggWbAy1QYjYU= Received: from DM6PR08CA0059.namprd08.prod.outlook.com (2603:10b6:5:1e0::33) by DM8PR02MB7895.namprd02.prod.outlook.com (2603:10b6:8:10::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Tue, 14 Jun 2022 10:25:46 +0000 Received: from DM3NAM02FT049.eop-nam02.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::c4) by DM6PR08CA0059.outlook.office365.com (2603:10b6:5:1e0::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11 via Frontend Transport; Tue, 14 Jun 2022 10:25:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; pr=C Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT049.mail.protection.outlook.com (10.13.5.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Tue, 14 Jun 2022 10:25:45 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 14 Jun 2022 11:25:44 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 14 Jun 2022 11:25:44 +0100 Envelope-to: bruce.richardson@intel.com, dev@dpdk.org Received: from [10.71.119.224] (port=55921) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1o13jz-00027r-OU; Tue, 14 Jun 2022 11:25:44 +0100 Message-ID: Date: Tue, 14 Jun 2022 11:25:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [kmods PATCH] linux/igb_uio: allow modules install Content-Language: en-US To: Bruce Richardson References: <20220412131453.3927-1-bruce.richardson@intel.com> From: Ferruh Yigit CC: In-Reply-To: <20220412131453.3927-1-bruce.richardson@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0bf44423-26fc-49fc-f531-08da4df03e6a X-MS-TrafficTypeDiagnostic: DM8PR02MB7895:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kx5T+F3ZMbX28PqqSDi8U3sBSmkHDconTnRIoLI1r+nL1KuuPmkBno/9GUXyd9y2f1HR2/48rfQPdWxVf9Y4f3m4ojLcE85KwkGQTRBXO9rDUN3dPDI9BxRkD7XoI7mNVD2mBKJsVeLt29pAd4YWEYjyGnBqThG6qFapmISvbkGHCUEef9Pdab0v7Nc77Iay1CxAkaBFHEoRuQy+wWhXHl7ke5pZv1joCtKIAOrXWsEUyZgdDUYYPCmPjts3wQq+jdRcz++CK6ObbDuGIij1Cpcqz9cz/V36EWYLAV22sEgeCRCMQsilXC8PuLWqsl7W19ECm5TOWna7UoEwfgwsuSN9msOuuC+q0b1ydJF5pHs6d95vO+BLshnm6XTWZUnjwwsFz4B/ROf4VNbYY9IWHIX6oIV2UZgqNRsVwjSEZdg0BgemDibwE4U7PxNZKSjjN1g37JCLWYXeyHsokPzKIyQqFt7e8BSA9rgnoxCF+oWxoeSJQtfFHLkPRnnscpgOh9qeHxS9pXMmLQXwwgYbobZdhJk1yKPbM3WjCGZJJVtgzheH76uFwQ4f6QrB6ZKhepSDZKm0aYoakgxiWFPsP8+SO6Ucl89+ime+9j/L2QxSb6uJxG9jCNGq4GfuPAJBGVxvmu/OfCUmWN+hIW0/dLn/k0unU3FPgmV+vhmqojeNd6+rIeCJ+D6jKFqROdH3UNStjkJi6QtwejR0R0hM3NAAJuaLRQNoARAEJj6eq/E= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(40470700004)(46966006)(36840700001)(356005)(508600001)(70586007)(82310400005)(70206006)(8676002)(31696002)(2616005)(8936002)(7636003)(36860700001)(426003)(336012)(47076005)(26005)(4326008)(6916009)(316002)(40460700003)(83380400001)(44832011)(5660300002)(36756003)(9786002)(2906002)(186003)(31686004)(53546011)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2022 10:25:45.8220 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0bf44423-26fc-49fc-f531-08da4df03e6a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT049.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7895 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 4/12/2022 2:14 PM, Bruce Richardson wrote: > CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. > > > For those still using the "igb_uio" kernel module, there may be > occasions where the module is installed in /lib/modules/$VERSION folder > rather than being insmod'ed from the build directory. To support this, a > number of changes are needed to the makefile: > > * Change the "clean" command to a generic wildcard target where that > target is just passed through to the top-level kernel makefile. This > should allow all standard kernel module targets, including "clean" and > "modules_install" to work. ack > * To install in /lib/modules, root permissions are needed, so it is > likely that users may try installing the module using "sudo". However, > under sudo there is often no $PWD environment variable, breaking the > build. This can be fixed by changing the environment variable $PWD to > the make built-in variable "CURDIR"[1]. It can be possible to use shell PWD: "make -C $(KSRC)/ M=$$PWD" or " PWD := $(shell pwd) all: make -C $(KSRC)/ M=$(PWD) " But '$(CURDIR)' also seems doing the job, so lgtm. > * As a cleanup, the actual kernel module path is got directly by make > from the shell, rather than relying on the shell substitution later > when making the recursive make call. This improves things slightly for > the user as the full recursive command is visible, with the kernel > version appearing in place of `uname -r` in the output. > ack > [1] While neither PWD nor CURDIR will work correctly in the case where > one is building outside of the sources directory, this is an edge case, > and a simple replacement of PWD by CURDIR keeps things simple while > adding support for "sudo". > > Signed-off-by: Bruce Richardson Acked-by: Ferruh Yigit > --- > linux/igb_uio/Makefile | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/linux/igb_uio/Makefile b/linux/igb_uio/Makefile > index 09ae5d9..bd2e356 100644 > --- a/linux/igb_uio/Makefile > +++ b/linux/igb_uio/Makefile > @@ -1,7 +1,7 @@ > -KSRC ?= /lib/modules/`uname -r`/build > +KSRC ?= /lib/modules/$(shell uname -r)/build > > all: > - make -C $(KSRC)/ M=$(PWD) > + make -C $(KSRC)/ M=$(CURDIR) > > -clean: > - make -C $(KSRC)/ M=$(PWD) clean > +%: > + make -C $(KSRC)/ M=$(CURDIR) $@ > -- > 2.32.0 >