<div class="zcontentRow"><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;">Hi Stephen,<br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +char zxdh_gdma_driver_name[] = "rawdev_zxdh_gdma";</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +char dev_name[] = "zxdh_gdma";</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +uint32_t</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +zxdh_gdma_read_reg(struct rte_rawdev *dev, uint16_t queue_id, uint32_t offset)</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +{</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    struct zxdh_gdma_rawdev *gdmadev = zxdh_gdma_rawdev_get_priv(dev);</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    uint32_t addr = 0;</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    uint32_t val = 0;</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    addr = offset + queue_id * ZXDH_GDMA_CHAN_SHIFT;</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    val = *(uint32_t *)(gdmadev->base_addr + addr);</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    return val;</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +}</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +void</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +zxdh_gdma_write_reg(struct rte_rawdev *dev, uint16_t queue_id, uint32_t offset, uint32_t val)</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +{</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    struct zxdh_gdma_rawdev *gdmadev = zxdh_gdma_rawdev_get_priv(dev);</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    uint32_t addr = 0;</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    addr = offset + queue_id * ZXDH_GDMA_CHAN_SHIFT;</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +    *(uint32_t *)(gdmadev->base_addr + addr) = val;</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>> +}</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);">><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>This driver is made up one C file. Please make all these helper functions</span><br style="box-sizing: border-box; outline: 0px; font-family: MicrosoftYaHei; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: MicrosoftYaHei; background-color: rgb(255, 255, 255);">>and the names static. If static checkers and optimizers can work better.</span></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;">Thanks for your suggestion, I will check other functions. But these two functions will also </p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;">be called by the test application(Not Submitted), so it is not appropriate to names static.</p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><div unonameen="Zhang Yong10313449" unonamech="张勇10313449" class="zMailSign"><p style="display: none;" unonameen="Zhang Yong10313449" unonamech="张勇10313449" class="zMailSignTitle"><label class="sign_nameUno"></label><span class="sign_arrow"></span></p><div class="zMailSignContent"><p style="margin:0;line-height:20px;"><span style="font-family: 微软雅黑,Microsoft YaHei;color: #008ed3;font-size: 14px" id="sign_name" class="signedit">张勇 zhangyong</span></p><p style="margin:0;line-height:20px;"><span style="font-family: 微软雅黑,Microsoft YaHei;color: #008ed3;font-size: 14px" class="signedit"><br></span></p><p style="margin:0;line-height:20px;"><span style="font-family: 微软雅黑,Microsoft YaHei;font-size: 14px" id="sign_position" class="signedit"></span><span style="font-family: tahoma, verdana, "sans-serif", 宋体; background-color: rgb(255, 255, 255);">RCH八部/无线及算力研究院/无线及算力产品经营部</span></p><p style="margin:0;line-height:20px;"><span style="font-family: tahoma, verdana, "sans-serif", 宋体; background-color: rgb(255, 255, 255);">RCH Dept. VIII/Wireless and Computing Product R&D Institute/Wireless and Computing Product Operation Division</span><a href="http://zmail.zte.com.cn/"><span style="font-family: Arial;font-size: 14px"></span></a></p></div></div><div class="zhistoryRow" style="display:block"><div class="zhistoryDes" style="width: 100%; height: 28px; line-height: 28px; background-color: #E0E5E9; color: #1388FF; text-align: center;">Original</div><div id="zwriteHistoryContainer"><div class="control-group zhistoryPanel"><div class="zhistoryHeader" style="padding: 8px; background-color: #F5F6F8;"><div><strong>From: </strong><span class="zreadUserName">StephenHemminger <stephen@networkplumber.org></span></div><div><strong>To: </strong><span class="zreadUserName" style="display: inline;">张勇10313449;</span></div><div><strong>Cc: </strong><span class="zreadUserName" style="display: inline;">thomas@monjalon.net <thomas@monjalon.net>;</span><span class="zreadUserName" style="display: inline;">dev@dpdk.org <dev@dpdk.org>;</span><span class="zreadUserName" style="display: inline;">汪勇10032886;</span><span class="zreadUserName" style="display: inline;">李敏10314441;</span><span class="zreadUserName" style="display: inline;">冉明10033339;</span></div><div><strong>Date: </strong><span class="">2024年11月12日 13:11</span></div><div><strong>Subject: </strong><span class="zreadTitle"><strong>Re: [v4,1/5] raw/gdtc: introduce gdtc raw device driver</strong></span></div></div><div class="zhistoryContent">On Tue, 29 Oct 2024 21:45:22 +0800<br>Yong Zhang <zhang.yong25@zte.com.cn> wrote:<br> <br>> +char zxdh_gdma_driver_name[] = "rawdev_zxdh_gdma";<br>> +char dev_name[] = "zxdh_gdma";<br>> +<br>> +uint32_t<br>> +zxdh_gdma_read_reg(struct rte_rawdev *dev, uint16_t queue_id, uint32_t offset)<br>> +{<br>> +    struct zxdh_gdma_rawdev *gdmadev = zxdh_gdma_rawdev_get_priv(dev);<br>> +    uint32_t addr = 0;<br>> +    uint32_t val = 0;<br>> +<br>> +    addr = offset + queue_id * ZXDH_GDMA_CHAN_SHIFT;<br>> +    val = *(uint32_t *)(gdmadev->base_addr + addr);<br>> +<br>> +    return val;<br>> +}<br>> +<br>> +void<br>> +zxdh_gdma_write_reg(struct rte_rawdev *dev, uint16_t queue_id, uint32_t offset, uint32_t val)<br>> +{<br>> +    struct zxdh_gdma_rawdev *gdmadev = zxdh_gdma_rawdev_get_priv(dev);<br>> +    uint32_t addr = 0;<br>> +<br>> +    addr = offset + queue_id * ZXDH_GDMA_CHAN_SHIFT;<br>> +    *(uint32_t *)(gdmadev->base_addr + addr) = val;<br>> +}<br> <br>This driver is made up one C file. Please make all these helper functions<br>and the names static. If static checkers and optimizers can work better.</div></div></div></div><p><br></p></div>