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 5D2C645CD9; Wed, 13 Nov 2024 15:59:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E923440290; Wed, 13 Nov 2024 15:59:13 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 2D4134025E for ; Wed, 13 Nov 2024 15:59:13 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20ca388d242so74092645ad.2 for ; Wed, 13 Nov 2024 06:59:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731509952; x=1732114752; 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=7fCoODJAOZMIWBowYhML5qcanuQR+WuKcwlRI4B2uWQ=; b=CzaJu4goBZT4GKCPmnJBIA1Eg620O5LO8Dr6bl5IMTKTWoxRhNgwG1kXMCdzigjcOV OsjkqPy+HniDS9DQTB7xM8sRCUZ6ORe/Udhz5wkVsOnAB2yIDo2DPi5b5j1ucctRxcL9 CIhFZPC6o1onzeucvfKgeQFrg5tBIK5rxnXUq8PyxeG8pQXacyLjBiBQ0zalSgTazz0H KILrQKynspnbdqbqP8DGECqiNbaKaGc90I9IH9ZKL8gXdZKGXqtv9zorSUFVC8rXSTDH gIhjbws9+e+oXOecxgNTB0pLRb4Q0vFIpVtTKeGGYocg/U8j28hDa7dx/PyNjCiPGUMQ fScw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731509952; x=1732114752; 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=7fCoODJAOZMIWBowYhML5qcanuQR+WuKcwlRI4B2uWQ=; b=iyncT/auVxhs20H2v/tfMU/+kaYJXNL45nbnafN/Jixk9rtuOjXT1hd6cu8prUU990 /EdyH43sFtbGaHOm32uUe/OW6sdq6pYlXp8jfL5E2/U5ndn5vusXA8O/p9ut7tfHsnV4 9ivNm1I6zq6kePOB3ce3XII4J1OV1jyond3e9qpgC4/a5TCGxJRbDk5Ls7lo68A6MDe8 z++Exd8fjEuiNwT9PeOkzAekHfw48er1QWq2Yh5RUUgpooOglF4fegAePrsSVBt6Omzu MjWeFgv3jF2RzbRpiug/Ffyzy21bXicCsrLLnAMtnS085xpX/1nsHw1go4WphO4G6aGy C64g== X-Gm-Message-State: AOJu0Yz/Z95vmdQ//2l+GDCVesp6muREQpLpkn84X2nuqSWhrAOiG1el LCqLoIzafuwuJKDQ/lE31yD/mC9FJQtWXgDCs3HQWGn7xWLROdpak30xvOHHWOE= X-Google-Smtp-Source: AGHT+IHWNncI+OBWVXpEzhvCppILuXV5ULBpKbJwA/RZOhhro+v7XFEg/AxaBUyA9BJU4FDB09qMlw== X-Received: by 2002:a17:902:c951:b0:1fb:90e1:c8c5 with SMTP id d9443c01a7336-21183dac280mr279351925ad.33.1731509952145; Wed, 13 Nov 2024 06:59:12 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21177de0428sm111238065ad.105.2024.11.13.06.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 06:59:11 -0800 (PST) Date: Wed, 13 Nov 2024 06:59:10 -0800 From: Stephen Hemminger To: Cc: , , , Subject: Re: [v4,1/5] raw/gdtc: introduce gdtc raw device driver Message-ID: <20241113065910.56bf435b@hermes.local> In-Reply-To: <20241113172257141UUFsGeMvKYlsewZJD2KTm@zte.com.cn> References: <20241111210803.7530e34f@hermes.local> <20241113172257141UUFsGeMvKYlsewZJD2KTm@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 13 Nov 2024 17:22:57 +0800 (CST) wrote: > Hi Stephen=EF=BC=8C >=20 > >> +char zxdh_gdma_driver_name[] =3D "rawdev_zxdh_gdma";>> +char dev_name= [] =3D "zxdh_gdma";>> +>> +uint32_t>> +zxdh_gdma_read_reg(struct rte_rawdev= *dev, uint16_t queue_id, uint32_t offset)>> +{>> + struct zxdh_gdma_raw= dev *gdmadev =3D zxdh_gdma_rawdev_get_priv(dev);>> + uint32_t addr =3D 0= ;>> + uint32_t val =3D 0;>> +>> + addr =3D offset + queue_id * ZXDH_G= DMA_CHAN_SHIFT;>> + val =3D *(uint32_t *)(gdmadev->base_addr + addr);>> = +>> + return val;>> +}>> +>> +void>> +zxdh_gdma_write_reg(struct rte_raw= dev *dev, uint16_t queue_id, uint32_t offset, uint32_t val)>> +{>> + str= uct zxdh_gdma_rawdev *gdmadev =3D zxdh_gdma_rawdev_get_priv(dev);>> + ui= nt32_t addr =3D 0;>> +>> + addr =3D offset + queue_id * ZXDH_GDMA_CHAN_S= HIFT;>> + *(uint32_t *)(gdmadev->base_addr + addr) =3D val;>> +}>>This d= river is made up one C file. Please make all these helper functions>and the= names static. If static checkers and optimizers can work better. =20 >=20 > Thanks for your suggestion, I will check other functions. But these two f= unctions will also=20 > be called by the test application(Not Submitted), so it is not appropriat= e to names static. If you need the functions for a test app then they need to be in version.ma= p and in a user API header file. It is ok to have PMD specific hooks, but they ne= ed to be treated as real API's.