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 3F9F945CA4; Thu, 7 Nov 2024 20:39:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C813942F83; Thu, 7 Nov 2024 20:39:32 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id A6AA642EBF for ; Thu, 7 Nov 2024 20:39:31 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2e2e87153a3so993625a91.3 for ; Thu, 07 Nov 2024 11:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731008371; x=1731613171; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=rHG+kPznkT2XSrRMQ9yO3oXJap3mPpucJTmlTdMDpRs=; b=YS5yYPVq0ULWpKvXRoHIoJrjfNXTeyT42td1Xcqg3j+YGnnkCg+3ODPNE6unf2CP73 Fk51dFmBw4foJ8+D+0PiaZ4PnR0mUg9VyV4Xr3OfhZj3vcET7Qay90fsuquLLYRq+U2p mt6xtvol4yEb+YsGczgs+Kf93XkKBnwbc9a7aoQVyJ7lTpqWew5VQ9WucWzzZlXWnBc2 VG+kdAEg3BvupLEI7EeOtC7/3Yz+ZC2RC3BOP/wMRFdoVx6uS3WvM1kFB9IVL+vHBZoQ EnzPpdfBoIbIdr7f70PspC9xsAPzV8DjXwle+rQeP5QvYYHOd/2IfI07qkR0sLvF70iQ 4T/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731008371; x=1731613171; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rHG+kPznkT2XSrRMQ9yO3oXJap3mPpucJTmlTdMDpRs=; b=uznSXkcHp/9vidbIKEHIv+0SU6acwNPHGDag+OFQ/shboXkbTK6jc7rJGyQw95ioZ1 OIws3FXnrkwpM7H4b7nED7JHr8DAyqdHa9Q2xI/qNNHWJGrqo+VKX8o4aqMW9CQpibZz x6nPhdjmfRumxkplTwp0w8R13dnBdgD8KU/tJ6sS7nfUBWLMdxK4pW3xp9jWCvLdyvWD W8F79vKw6MBdmwXWo0Tk81ePaA4pLytjMv7MFIrcJWzXcqfj+KKryJeNEWGQMH5MDzZg 5We8ke1LnNIb/oRdQ/Lh+d7lkzFXurOqmdSIFt5qL8+6d9ofV9eWEGpkIe29b1K5lIay ahIw== X-Gm-Message-State: AOJu0YwK9Ai8xt/TraVjnv558Ejv5KqGyXeNi5FoGmrdEqsPHHfd5n9u xGPFW0A9YGjDrpaeA0SHbnf8Ois//zbnIj3hSo8fFWYRY2Ddax5RdKm3Sdt/0Mo= X-Google-Smtp-Source: AGHT+IG2DUelw2G/GF8lSoPMhzQ/jg4eHN4hM2ByKPE+KoA6ikCRH+NyHDiYEUgdyMQ/9tEu55sJJg== X-Received: by 2002:a17:90b:1c08:b0:2d8:3fe8:a195 with SMTP id 98e67ed59e1d1-2e9b16ea69bmr493478a91.4.1731008370624; Thu, 07 Nov 2024 11:39:30 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a55bf2asm3921056a91.31.2024.11.07.11.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 11:39:30 -0800 (PST) Date: Thu, 7 Nov 2024 11:39:26 -0800 From: Stephen Hemminger To: vanshika.shukla@nxp.com Cc: dev@dpdk.org, Thomas Monjalon , Wathsala Vithanage , Bruce Richardson , Gagandeep Singh , Sachin Saxena , Anatoly Burakov , Apeksha Gupta Subject: Re: [v2 01/12] net/enetc: Add initial ENETC4 PMD driver support Message-ID: <20241107113926.30924180@hermes.local> In-Reply-To: <20241023062433.851218-2-vanshika.shukla@nxp.com> References: <20241018072644.2379012-1-vanshika.shukla@nxp.com> <20241023062433.851218-1-vanshika.shukla@nxp.com> <20241023062433.851218-2-vanshika.shukla@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Wed, 23 Oct 2024 11:54:22 +0530 vanshika.shukla@nxp.com wrote: > +/* IOCTL */ > +#define KPG_NC_MAGIC_NUM 0xf0f0 > +#define KPG_NC_IOCTL_UPDATE _IOWR(KPG_NC_MAGIC_NUM, 1, size_t) > + > + > +#define KNRM "\x1B[0m" > +#define KRED "\x1B[31m" > +#define KGRN "\x1B[32m" > +#define KYEL "\x1B[33m" > +#define KBLU "\x1B[34m" > +#define KMAG "\x1B[35m" > +#define KCYN "\x1B[36m" > +#define KWHT "\x1B[37m" > + > +#if defined(RTE_ARCH_ARM) && defined(RTE_ARCH_64) > +static inline void flush_tlb(void *p) > +{ > + asm volatile("dc civac, %0" ::"r"(p)); > + asm volatile("dsb ish"); > + asm volatile("isb"); > +} > +#endif > + > +static inline void mark_kpage_ncache(uint64_t huge_page) > +{ > + int fd, ret; > + > + fd = open(KPG_NC_DEVICE_PATH, O_RDONLY); > + if (fd < 0) { > + ENETC_PMD_ERR(KYEL "Error: " KNRM "Could not open: %s", > + KPG_NC_DEVICE_PATH); > + Do not add your own color stuff into logging! It will mess up when log goes to syslog or journal. There is a better more complete set of patchs to add generic color support to log (still under review). Also directly manipulating kernel page cache via non-upstream ioctl's is a bad idea from security and portability point of view. Do you really want to make Christoph Hellwig, and Al Viro come after you? If you have to do this it should be wrapped in some API in EAL, not in the driver.