Re: [v4,1/5] raw/gdtc: introduce gdtc raw device driver
zhang.yong25 at zte.com.cn
zhang.yong25 at zte.com.cn
Wed Nov 13 10:22:57 CET 2024
Hi Stephen,
>> +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.
Thanks for your suggestion, I will check other functions. But these two functions will also
be called by the test application(Not Submitted), so it is not appropriate to names static.
张勇 zhangyong
RCH八部/无线及算力研究院/无线及算力产品经营部
RCH Dept. VIII/Wireless and Computing Product R&D Institute/Wireless and Computing Product Operation Division
Original
From: StephenHemminger <stephen at networkplumber.org>
To: 张勇10313449;
Cc: thomas at monjalon.net <thomas at monjalon.net>;dev at dpdk.org <dev at dpdk.org>;汪勇10032886;李敏10314441;冉明10033339;
Date: 2024年11月12日 13:11
Subject: Re: [v4,1/5] raw/gdtc: introduce gdtc raw device driver
On Tue, 29 Oct 2024 21:45:22 +0800
Yong Zhang <zhang.yong25 at zte.com.cn> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20241113/a3572497/attachment.htm>
More information about the dev
mailing list