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 DA04245CED; Tue, 12 Nov 2024 06:10:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF0AF42D27; Tue, 12 Nov 2024 06:10:50 +0100 (CET) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by mails.dpdk.org (Postfix) with ESMTP id 1ADF1427E2 for ; Tue, 12 Nov 2024 06:10:49 +0100 (CET) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-7180f2f5fb0so3036816a34.1 for ; Mon, 11 Nov 2024 21:10:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731388248; x=1731993048; 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=k94Y1HGsvbyIrxCjF/UXBr82SP65LQ5EnYoLGepI9Gc=; b=oJfutCJ87DTcjR6h6CE2WJPPpzZJ/npOum+82vUSLp1AOFLp4IDeJjr9cTj1ncKYTq pCSCvIjE2kSonA43/pC93me+Vn6XPcUYPEsxsiCR5QT17zScI+gQdPU2GJ5TbnKHMAnl ebS3PwNcbwpHsyHJizQym6owKII095mWBVmEHlYr79Ktd2urBmMZMmrut4uR/iKaIc/k sSvJm/OksKu8wcfn24l4D0eMsAzjXt40pMiInOPqsH0e185aVJpi1pCnwWTvvF1nOSgy CqDbB7OSj6ziBQ9i7m1xHmWOJbEG/7RjGbOLQWXjYZ+mTONkhA+2yYLceaq2XwqdfNWb BMMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731388248; x=1731993048; 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=k94Y1HGsvbyIrxCjF/UXBr82SP65LQ5EnYoLGepI9Gc=; b=R3AnFNpsLG/TVhr1nyN0CT9J842cx+N6rIKh/qUpGqL/dF/SOn5CzQk3INC2plxBeV tzVRCij0yG2bXVBfcMNVVAHRer0kjjn9CeW1PHxM9m8449ymKne5/rgnDPtplGf+FU27 eFdhhL8L9tWAZ7uixg1Pc/fL6m7FZ/vmpMCC6ShHY6qGu223U04WDKWwWaIPEj5ZXIcy yn+U/xzi992OMW4Fvb0f/JP3fZ1e2PRfZVOSuYu/HqJTqRpXQ+hkrprp3lZH3nL84UwG NOUZmuFuJ33VdhGXxkR2LBRP+kTTzojffuvVT7T6V4oDr4fNvqTAfbHjbHxd5t3m7HUm EcHQ== X-Forwarded-Encrypted: i=1; AJvYcCX20kYwyEKWwmwSIBRrpIxT6oMQk55AlVLUNVIufPfuWQQl0lZVQamuLkjGvldC4ZZXAAg=@dpdk.org X-Gm-Message-State: AOJu0Yyqt/gRiDC9xKyCz2aIcIFLkWGHlNwSMbyy3cbOZO/UtufkCrdI RszkT+VAuDoNK9YW4ijJNyDb+g/0G+SMft96bpznukA8eHJ8Sb+HIebVAdEKe5U= X-Google-Smtp-Source: AGHT+IGR7SFGiWwVPysM5PwEyKMt4n51kYnMpmK3qwyGyrqfbHGceyPho8Efi2Pw16iUm+/HKtu2Iw== X-Received: by 2002:a05:6830:6004:b0:715:3a11:ece2 with SMTP id 46e09a7af769-71a1c0f547bmr15104495a34.0.1731388248335; Mon, 11 Nov 2024 21:10:48 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7f41f65bfbdsm9570432a12.75.2024.11.11.21.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 21:10:48 -0800 (PST) Date: Mon, 11 Nov 2024 21:08:03 -0800 From: Stephen Hemminger To: Yong Zhang Cc: thomas@monjalon.net, dev@dpdk.org, wang.yong19@zte.com.cn, li.min10@zte.com.cn, ran.ming@zte.com.cn Subject: Re: [v4,1/5] raw/gdtc: introduce gdtc raw device driver Message-ID: <20241111210803.7530e34f@hermes.local> In-Reply-To: <20241029134609.2499338-1-zhang.yong25@zte.com.cn> References: <20241029134609.2499338-1-zhang.yong25@zte.com.cn> 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 Tue, 29 Oct 2024 21:45:22 +0800 Yong Zhang wrote: > +char zxdh_gdma_driver_name[] = "rawdev_zxdh_gdma"; > +char dev_name[] = "zxdh_gdma"; > + > +uint32_t > +zxdh_gdma_read_reg(struct rte_rawdev *dev, uint16_t queue_id, uint32_t offset) > +{ > + struct zxdh_gdma_rawdev *gdmadev = zxdh_gdma_rawdev_get_priv(dev); > + uint32_t addr = 0; > + uint32_t val = 0; > + > + addr = offset + queue_id * ZXDH_GDMA_CHAN_SHIFT; > + val = *(uint32_t *)(gdmadev->base_addr + addr); > + > + return val; > +} > + > +void > +zxdh_gdma_write_reg(struct rte_rawdev *dev, uint16_t queue_id, uint32_t offset, uint32_t val) > +{ > + struct zxdh_gdma_rawdev *gdmadev = zxdh_gdma_rawdev_get_priv(dev); > + uint32_t addr = 0; > + > + addr = offset + queue_id * ZXDH_GDMA_CHAN_SHIFT; > + *(uint32_t *)(gdmadev->base_addr + addr) = val; > +} This driver is made up one C file. Please make all these helper functions and the names static. If static checkers and optimizers can work better.