<div class="__aliyun_email_body_block"><div  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun"><div  style="clear: both;"><span  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">Hi <span  style="color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;">Stephen,</span></span></div><div  style="clear: both;"><br ></div><div  style="clear: both;"><span >Our driver architecture is designed to support multiple chip variants, each with distinct hardware-software interactions, which contributes to its relative complexity.<br ></span><span >To ensure broad compatibility and modularity, the architecture is organized into the following layers:</span></div><div  style="clear: both;"><div  style="clear: both;">1. Dev Layer (Device Layer)<br ></div><div  style="clear: both;">2. Dispatch Layer<br ></div><div  style="clear: both;">3. Resource Layer<br ></div><div  style="clear: both;">4. Channel Layer<br ></div><div  style="clear: both;">5. HW Layer (Hardware Layer)<br ></div><div  style="clear: both;"><br ></div><div  style="clear: both;">Each chip variant has its own init and remove functions for these layers.<br ></div><div  style="clear: both;">As you correctly pointed out, there are many indirection tables involved. </div><div  style="clear: both;">This patch series implements the tables for one chip, and subsequent patches will add support for more chip variants.<br ></div><div  style="clear: both;"><br ></div><div ><span >Thank you.</span></div><p  class=""><br ></p></div><div  style="clear: both;"><span  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><br ></span></div><div  style="clear: both;"><span  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><br ></span></div><blockquote  _quote="1" style="margin-right: 0px; margin-top: 0px; margin-bottom: 0px; font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);"><div  class="alimail-quote"><div  style="clear: both;">------------------------------------------------------------------</div><div  style="clear: both;">发件人:Stephen Hemminger <stephen@networkplumber.org></div><div  style="clear: both;">发送时间:2025年8月28日(周四) 00:27</div><div  style="clear: both;">收件人:Dimon<dimon.zhao@nebula-matrix.com></div><div  style="clear: both;">抄 送:dev<dev@dpdk.org>; Thomas Monjalon<thomas@monjalon.net>; Kyo Liu<kyo.liu@nebula-matrix.com>; Leon<leon.yu@nebula-matrix.com>; Sam<sam.chen@nebula-matrix.com></div><div  style="clear: both;">主 题:Re: [PATCH v6 01/17] net/nbl: add doc and minimum nbl build framework</div><div  style="clear: both;"><br ></div>This code looks like it was part of something bigger (and/or written<br >by a object oriented programmer).<br ><br >Lots of indirection tables and most never have multiple implementations.<br >Function indirection is slower and risks SPECTRE type attacks.<br ><br >> +struct nbl_product_core_ops {<br >> + int (*hw_init)(void *p);<br >> + void (*hw_remove)(void *p);<br >> + int (*res_init)(void *p, struct rte_eth_dev *eth_dev);<br >> + void (*res_remove)(void *p);<br >> + int (*chan_init)(void *p);<br >> + void (*chan_remove)(void *p);<br >> +};<br ><br ><br ><br ><br >> +struct nbl_product_dev_ops {<br >> + int (*dev_init)(void *adapter);<br >> + void (*dev_uninit)(void *adapter);<br >> + int (*dev_start)(void *adapter);<br >> + void (*dev_stop)(void *adapter);<br >> +};<br >> +<br >> +struct nbl_product_dispatch_ops {<br >> + int (*dispatch_init)(void *mgt);<br >> + int (*dispatch_uninit)(void *mgt);<br >> +};<br ><br ><br ><br >> +struct nbl_product_dev_external_ops {<br >> + int (*external_pf_ops_get)(struct rte_eth_dev *dev, void *arg);<br >> + int (*external_rep_ops_get)(struct rte_eth_dev *dev, void *arg);<br >> + int (*external_bond_ops_get)(struct rte_eth_dev *dev, void *arg);<br >> +};<br ><br >These are defined but never used.<br ><br ><br >> +#endif</div></blockquote><div  style="line-height: 20px; clear: both;"><br ></div></div></div>
<div style="clear: both;"><span style="font-size: 10px; color: rgb(216, 216, 216);">本邮件所含信息及其任何附件为保密信息且可能属于专有信息。任何非指定接收人均无权访问本邮件。如果您不是该邮件的指定接收人,那么任何对本邮件内容进行披露,复制或使用的行为均是禁止的。如果您不是该邮件的指定接收人,请您立即通过邮件通知 compliance@nebula-matrix.com并立即删除您错误接受的邮件。</span></div><div style="clear: both;"><span style="font-size: 10px; color: rgb(216, 216, 216);">The information in this message and any attachments is confidential and may be privileged.  Access to this email by anyone other than the intended recipient is not authorized.  If you are not the intended recipient, disclosure, copying or use of the contents of this email is prohibited.  If you are not the intended recipient, please notify  compliance@nebula-matrix.com immediately by email, and please destroy the email you received in error.</span></div>