bnx2x_sp.h 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283
  1. /* bnx2x_sp.h: Broadcom Everest network driver.
  2. *
  3. * Copyright 2011 Broadcom Corporation
  4. *
  5. * Unless you and Broadcom execute a separate written software license
  6. * agreement governing use of this software, this software is licensed to you
  7. * under the terms of the GNU General Public License version 2, available
  8. * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
  9. *
  10. * Notwithstanding the above, under no circumstances may you combine this
  11. * software in any way with any other Broadcom software provided under a
  12. * license other than the GPL, without Broadcom's express prior written
  13. * consent.
  14. *
  15. * Maintained by: Eilon Greenstein <eilong@broadcom.com>
  16. * Written by: Vladislav Zolotarov
  17. *
  18. */
  19. #ifndef BNX2X_SP_VERBS
  20. #define BNX2X_SP_VERBS
  21. struct bnx2x;
  22. struct eth_context;
  23. /* Bits representing general command's configuration */
  24. enum {
  25. RAMROD_TX,
  26. RAMROD_RX,
  27. /* Wait until all pending commands complete */
  28. RAMROD_COMP_WAIT,
  29. /* Don't send a ramrod, only update a registry */
  30. RAMROD_DRV_CLR_ONLY,
  31. /* Configure HW according to the current object state */
  32. RAMROD_RESTORE,
  33. /* Execute the next command now */
  34. RAMROD_EXEC,
  35. /*
  36. * Don't add a new command and continue execution of posponed
  37. * commands. If not set a new command will be added to the
  38. * pending commands list.
  39. */
  40. RAMROD_CONT,
  41. };
  42. typedef enum {
  43. BNX2X_OBJ_TYPE_RX,
  44. BNX2X_OBJ_TYPE_TX,
  45. BNX2X_OBJ_TYPE_RX_TX,
  46. } bnx2x_obj_type;
  47. /* Filtering states */
  48. enum {
  49. BNX2X_FILTER_MAC_PENDING,
  50. BNX2X_FILTER_VLAN_PENDING,
  51. BNX2X_FILTER_VLAN_MAC_PENDING,
  52. BNX2X_FILTER_RX_MODE_PENDING,
  53. BNX2X_FILTER_RX_MODE_SCHED,
  54. BNX2X_FILTER_ISCSI_ETH_START_SCHED,
  55. BNX2X_FILTER_ISCSI_ETH_STOP_SCHED,
  56. BNX2X_FILTER_FCOE_ETH_START_SCHED,
  57. BNX2X_FILTER_FCOE_ETH_STOP_SCHED,
  58. BNX2X_FILTER_MCAST_PENDING,
  59. BNX2X_FILTER_MCAST_SCHED,
  60. BNX2X_FILTER_RSS_CONF_PENDING,
  61. };
  62. struct bnx2x_raw_obj {
  63. u8 func_id;
  64. /* Queue params */
  65. u8 cl_id;
  66. u32 cid;
  67. /* Ramrod data buffer params */
  68. void *rdata;
  69. dma_addr_t rdata_mapping;
  70. /* Ramrod state params */
  71. int state; /* "ramrod is pending" state bit */
  72. unsigned long *pstate; /* pointer to state buffer */
  73. bnx2x_obj_type obj_type;
  74. int (*wait_comp)(struct bnx2x *bp,
  75. struct bnx2x_raw_obj *o);
  76. bool (*check_pending)(struct bnx2x_raw_obj *o);
  77. void (*clear_pending)(struct bnx2x_raw_obj *o);
  78. void (*set_pending)(struct bnx2x_raw_obj *o);
  79. };
  80. /************************* VLAN-MAC commands related parameters ***************/
  81. struct bnx2x_mac_ramrod_data {
  82. u8 mac[ETH_ALEN];
  83. };
  84. struct bnx2x_vlan_ramrod_data {
  85. u16 vlan;
  86. };
  87. struct bnx2x_vlan_mac_ramrod_data {
  88. u8 mac[ETH_ALEN];
  89. u16 vlan;
  90. };
  91. union bnx2x_classification_ramrod_data {
  92. struct bnx2x_mac_ramrod_data mac;
  93. struct bnx2x_vlan_ramrod_data vlan;
  94. struct bnx2x_vlan_mac_ramrod_data vlan_mac;
  95. };
  96. /* VLAN_MAC commands */
  97. enum bnx2x_vlan_mac_cmd {
  98. BNX2X_VLAN_MAC_ADD,
  99. BNX2X_VLAN_MAC_DEL,
  100. BNX2X_VLAN_MAC_MOVE,
  101. };
  102. struct bnx2x_vlan_mac_data {
  103. /* Requested command: BNX2X_VLAN_MAC_XX */
  104. enum bnx2x_vlan_mac_cmd cmd;
  105. /*
  106. * used to contain the data related vlan_mac_flags bits from
  107. * ramrod parameters.
  108. */
  109. unsigned long vlan_mac_flags;
  110. /* Needed for MOVE command */
  111. struct bnx2x_vlan_mac_obj *target_obj;
  112. union bnx2x_classification_ramrod_data u;
  113. };
  114. /*************************** Exe Queue obj ************************************/
  115. union bnx2x_exe_queue_cmd_data {
  116. struct bnx2x_vlan_mac_data vlan_mac;
  117. struct {
  118. /* TODO */
  119. } mcast;
  120. };
  121. struct bnx2x_exeq_elem {
  122. struct list_head link;
  123. /* Length of this element in the exe_chunk. */
  124. int cmd_len;
  125. union bnx2x_exe_queue_cmd_data cmd_data;
  126. };
  127. union bnx2x_qable_obj;
  128. union bnx2x_exeq_comp_elem {
  129. union event_ring_elem *elem;
  130. };
  131. struct bnx2x_exe_queue_obj;
  132. typedef int (*exe_q_validate)(struct bnx2x *bp,
  133. union bnx2x_qable_obj *o,
  134. struct bnx2x_exeq_elem *elem);
  135. /**
  136. * @return positive is entry was optimized, 0 - if not, negative
  137. * in case of an error.
  138. */
  139. typedef int (*exe_q_optimize)(struct bnx2x *bp,
  140. union bnx2x_qable_obj *o,
  141. struct bnx2x_exeq_elem *elem);
  142. typedef int (*exe_q_execute)(struct bnx2x *bp,
  143. union bnx2x_qable_obj *o,
  144. struct list_head *exe_chunk,
  145. unsigned long *ramrod_flags);
  146. typedef struct bnx2x_exeq_elem *
  147. (*exe_q_get)(struct bnx2x_exe_queue_obj *o,
  148. struct bnx2x_exeq_elem *elem);
  149. struct bnx2x_exe_queue_obj {
  150. /*
  151. * Commands pending for an execution.
  152. */
  153. struct list_head exe_queue;
  154. /*
  155. * Commands pending for an completion.
  156. */
  157. struct list_head pending_comp;
  158. spinlock_t lock;
  159. /* Maximum length of commands' list for one execution */
  160. int exe_chunk_len;
  161. union bnx2x_qable_obj *owner;
  162. /****** Virtual functions ******/
  163. /**
  164. * Called before commands execution for commands that are really
  165. * going to be executed (after 'optimize').
  166. *
  167. * Must run under exe_queue->lock
  168. */
  169. exe_q_validate validate;
  170. /**
  171. * This will try to cancel the current pending commands list
  172. * considering the new command.
  173. *
  174. * Must run under exe_queue->lock
  175. */
  176. exe_q_optimize optimize;
  177. /**
  178. * Run the next commands chunk (owner specific).
  179. */
  180. exe_q_execute execute;
  181. /**
  182. * Return the exe_queue element containing the specific command
  183. * if any. Otherwise return NULL.
  184. */
  185. exe_q_get get;
  186. };
  187. /***************** Classification verbs: Set/Del MAC/VLAN/VLAN-MAC ************/
  188. /*
  189. * Element in the VLAN_MAC registry list having all currenty configured
  190. * rules.
  191. */
  192. struct bnx2x_vlan_mac_registry_elem {
  193. struct list_head link;
  194. /*
  195. * Used to store the cam offset used for the mac/vlan/vlan-mac.
  196. * Relevant for 57710 and 57711 only. VLANs and MACs share the
  197. * same CAM for these chips.
  198. */
  199. int cam_offset;
  200. /* Needed for DEL and RESTORE flows */
  201. unsigned long vlan_mac_flags;
  202. union bnx2x_classification_ramrod_data u;
  203. };
  204. /* Bits representing VLAN_MAC commands specific flags */
  205. enum {
  206. BNX2X_UC_LIST_MAC,
  207. BNX2X_ETH_MAC,
  208. BNX2X_ISCSI_ETH_MAC,
  209. BNX2X_NETQ_ETH_MAC,
  210. BNX2X_DONT_CONSUME_CAM_CREDIT,
  211. BNX2X_DONT_CONSUME_CAM_CREDIT_DEST,
  212. };
  213. struct bnx2x_vlan_mac_ramrod_params {
  214. /* Object to run the command from */
  215. struct bnx2x_vlan_mac_obj *vlan_mac_obj;
  216. /* General command flags: COMP_WAIT, etc. */
  217. unsigned long ramrod_flags;
  218. /* Command specific configuration request */
  219. struct bnx2x_vlan_mac_data user_req;
  220. };
  221. struct bnx2x_vlan_mac_obj {
  222. struct bnx2x_raw_obj raw;
  223. /* Bookkeeping list: will prevent the addition of already existing
  224. * entries.
  225. */
  226. struct list_head head;
  227. /* TODO: Add it's initialization in the init functions */
  228. struct bnx2x_exe_queue_obj exe_queue;
  229. /* MACs credit pool */
  230. struct bnx2x_credit_pool_obj *macs_pool;
  231. /* VLANs credit pool */
  232. struct bnx2x_credit_pool_obj *vlans_pool;
  233. /* RAMROD command to be used */
  234. int ramrod_cmd;
  235. /**
  236. * Checks if ADD-ramrod with the given params may be performed.
  237. *
  238. * @return zero if the element may be added
  239. */
  240. int (*check_add)(struct bnx2x_vlan_mac_obj *o,
  241. union bnx2x_classification_ramrod_data *data);
  242. /**
  243. * Checks if DEL-ramrod with the given params may be performed.
  244. *
  245. * @return true if the element may be deleted
  246. */
  247. struct bnx2x_vlan_mac_registry_elem *
  248. (*check_del)(struct bnx2x_vlan_mac_obj *o,
  249. union bnx2x_classification_ramrod_data *data);
  250. /**
  251. * Checks if DEL-ramrod with the given params may be performed.
  252. *
  253. * @return true if the element may be deleted
  254. */
  255. bool (*check_move)(struct bnx2x_vlan_mac_obj *src_o,
  256. struct bnx2x_vlan_mac_obj *dst_o,
  257. union bnx2x_classification_ramrod_data *data);
  258. /**
  259. * Update the relevant credit object(s) (consume/return
  260. * correspondingly).
  261. */
  262. bool (*get_credit)(struct bnx2x_vlan_mac_obj *o);
  263. bool (*put_credit)(struct bnx2x_vlan_mac_obj *o);
  264. bool (*get_cam_offset)(struct bnx2x_vlan_mac_obj *o, int *offset);
  265. bool (*put_cam_offset)(struct bnx2x_vlan_mac_obj *o, int offset);
  266. /**
  267. * Configures one rule in the ramrod data buffer.
  268. */
  269. void (*set_one_rule)(struct bnx2x *bp,
  270. struct bnx2x_vlan_mac_obj *o,
  271. struct bnx2x_exeq_elem *elem, int rule_idx,
  272. int cam_offset);
  273. /**
  274. * Delete all configured elements having the given
  275. * vlan_mac_flags specification. Assumes no pending for
  276. * execution commands. Will schedule all all currently
  277. * configured MACs/VLANs/VLAN-MACs matching the vlan_mac_flags
  278. * specification for deletion and will use the given
  279. * ramrod_flags for the last DEL operation.
  280. *
  281. * @param bp
  282. * @param o
  283. * @param ramrod_flags RAMROD_XX flags
  284. *
  285. * @return 0 if the last operation has completed successfully
  286. * and there are no more elements left, positive value
  287. * if there are pending for completion commands,
  288. * negative value in case of failure.
  289. */
  290. int (*delete_all)(struct bnx2x *bp,
  291. struct bnx2x_vlan_mac_obj *o,
  292. unsigned long *vlan_mac_flags,
  293. unsigned long *ramrod_flags);
  294. /**
  295. * Reconfigures the next MAC/VLAN/VLAN-MAC element from the previously
  296. * configured elements list.
  297. *
  298. * @param bp
  299. * @param p Command parameters (RAMROD_COMP_WAIT bit in
  300. * ramrod_flags is only taken into an account)
  301. * @param ppos a pointer to the cooky that should be given back in the
  302. * next call to make function handle the next element. If
  303. * *ppos is set to NULL it will restart the iterator.
  304. * If returned *ppos == NULL this means that the last
  305. * element has been handled.
  306. *
  307. * @return int
  308. */
  309. int (*restore)(struct bnx2x *bp,
  310. struct bnx2x_vlan_mac_ramrod_params *p,
  311. struct bnx2x_vlan_mac_registry_elem **ppos);
  312. /**
  313. * Should be called on a completion arival.
  314. *
  315. * @param bp
  316. * @param o
  317. * @param cqe Completion element we are handling
  318. * @param ramrod_flags if RAMROD_CONT is set the next bulk of
  319. * pending commands will be executed.
  320. * RAMROD_DRV_CLR_ONLY and RAMROD_RESTORE
  321. * may also be set if needed.
  322. *
  323. * @return 0 if there are neither pending nor waiting for
  324. * completion commands. Positive value if there are
  325. * pending for execution or for completion commands.
  326. * Negative value in case of an error (including an
  327. * error in the cqe).
  328. */
  329. int (*complete)(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o,
  330. union event_ring_elem *cqe,
  331. unsigned long *ramrod_flags);
  332. /**
  333. * Wait for completion of all commands. Don't schedule new ones,
  334. * just wait. It assumes that the completion code will schedule
  335. * for new commands.
  336. */
  337. int (*wait)(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o);
  338. };
  339. /** RX_MODE verbs:DROP_ALL/ACCEPT_ALL/ACCEPT_ALL_MULTI/ACCEPT_ALL_VLAN/NORMAL */
  340. /* RX_MODE ramrod spesial flags: set in rx_mode_flags field in
  341. * a bnx2x_rx_mode_ramrod_params.
  342. */
  343. enum {
  344. BNX2X_RX_MODE_FCOE_ETH,
  345. BNX2X_RX_MODE_ISCSI_ETH,
  346. };
  347. enum {
  348. BNX2X_ACCEPT_UNICAST,
  349. BNX2X_ACCEPT_MULTICAST,
  350. BNX2X_ACCEPT_ALL_UNICAST,
  351. BNX2X_ACCEPT_ALL_MULTICAST,
  352. BNX2X_ACCEPT_BROADCAST,
  353. BNX2X_ACCEPT_UNMATCHED,
  354. BNX2X_ACCEPT_ANY_VLAN
  355. };
  356. struct bnx2x_rx_mode_ramrod_params {
  357. struct bnx2x_rx_mode_obj *rx_mode_obj;
  358. unsigned long *pstate;
  359. int state;
  360. u8 cl_id;
  361. u32 cid;
  362. u8 func_id;
  363. unsigned long ramrod_flags;
  364. unsigned long rx_mode_flags;
  365. /*
  366. * rdata is either a pointer to eth_filter_rules_ramrod_data(e2) or to
  367. * a tstorm_eth_mac_filter_config (e1x).
  368. */
  369. void *rdata;
  370. dma_addr_t rdata_mapping;
  371. /* Rx mode settings */
  372. unsigned long rx_accept_flags;
  373. /* internal switching settings */
  374. unsigned long tx_accept_flags;
  375. };
  376. struct bnx2x_rx_mode_obj {
  377. int (*config_rx_mode)(struct bnx2x *bp,
  378. struct bnx2x_rx_mode_ramrod_params *p);
  379. int (*wait_comp)(struct bnx2x *bp,
  380. struct bnx2x_rx_mode_ramrod_params *p);
  381. };
  382. /********************** Set multicast group ***********************************/
  383. struct bnx2x_mcast_list_elem {
  384. struct list_head link;
  385. u8 *mac;
  386. };
  387. union bnx2x_mcast_config_data {
  388. u8 *mac;
  389. u8 bin; /* used in a RESTORE flow */
  390. };
  391. struct bnx2x_mcast_ramrod_params {
  392. struct bnx2x_mcast_obj *mcast_obj;
  393. /* Relevant options are RAMROD_COMP_WAIT and RAMROD_DRV_CLR_ONLY */
  394. unsigned long ramrod_flags;
  395. struct list_head mcast_list; /* list of struct bnx2x_mcast_list_elem */
  396. /** TODO:
  397. * - rename it to macs_num.
  398. * - Add a new command type for handling pending commands
  399. * (remove "zero semantics").
  400. *
  401. * Length of mcast_list. If zero and ADD_CONT command - post
  402. * pending commands.
  403. */
  404. int mcast_list_len;
  405. };
  406. enum {
  407. BNX2X_MCAST_CMD_ADD,
  408. BNX2X_MCAST_CMD_CONT,
  409. BNX2X_MCAST_CMD_DEL,
  410. BNX2X_MCAST_CMD_RESTORE,
  411. };
  412. struct bnx2x_mcast_obj {
  413. struct bnx2x_raw_obj raw;
  414. union {
  415. struct {
  416. #define BNX2X_MCAST_BINS_NUM 256
  417. #define BNX2X_MCAST_VEC_SZ (BNX2X_MCAST_BINS_NUM / 64)
  418. u64 vec[BNX2X_MCAST_VEC_SZ];
  419. /** Number of BINs to clear. Should be updated
  420. * immediately when a command arrives in order to
  421. * properly create DEL commands.
  422. */
  423. int num_bins_set;
  424. } aprox_match;
  425. struct {
  426. struct list_head macs;
  427. int num_macs_set;
  428. } exact_match;
  429. } registry;
  430. /* Pending commands */
  431. struct list_head pending_cmds_head;
  432. /* A state that is set in raw.pstate, when there are pending commands */
  433. int sched_state;
  434. /* Maximal number of mcast MACs configured in one command */
  435. int max_cmd_len;
  436. /* Total number of currently pending MACs to configure: both
  437. * in the pending commands list and in the current command.
  438. */
  439. int total_pending_num;
  440. u8 engine_id;
  441. /**
  442. * @param cmd command to execute (BNX2X_MCAST_CMD_X, see above)
  443. */
  444. int (*config_mcast)(struct bnx2x *bp,
  445. struct bnx2x_mcast_ramrod_params *p, int cmd);
  446. /**
  447. * Fills the ramrod data during the RESTORE flow.
  448. *
  449. * @param bp
  450. * @param o
  451. * @param start_idx Registry index to start from
  452. * @param rdata_idx Index in the ramrod data to start from
  453. *
  454. * @return -1 if we handled the whole registry or index of the last
  455. * handled registry element.
  456. */
  457. int (*hdl_restore)(struct bnx2x *bp, struct bnx2x_mcast_obj *o,
  458. int start_bin, int *rdata_idx);
  459. int (*enqueue_cmd)(struct bnx2x *bp, struct bnx2x_mcast_obj *o,
  460. struct bnx2x_mcast_ramrod_params *p, int cmd);
  461. void (*set_one_rule)(struct bnx2x *bp,
  462. struct bnx2x_mcast_obj *o, int idx,
  463. union bnx2x_mcast_config_data *cfg_data, int cmd);
  464. /** Checks if there are more mcast MACs to be set or a previous
  465. * command is still pending.
  466. */
  467. bool (*check_pending)(struct bnx2x_mcast_obj *o);
  468. /**
  469. * Set/Clear/Check SCHEDULED state of the object
  470. */
  471. void (*set_sched)(struct bnx2x_mcast_obj *o);
  472. void (*clear_sched)(struct bnx2x_mcast_obj *o);
  473. bool (*check_sched)(struct bnx2x_mcast_obj *o);
  474. /* Wait until all pending commands complete */
  475. int (*wait_comp)(struct bnx2x *bp, struct bnx2x_mcast_obj *o);
  476. /**
  477. * Handle the internal object counters needed for proper
  478. * commands handling. Checks that the provided parameters are
  479. * feasible.
  480. */
  481. int (*validate)(struct bnx2x *bp,
  482. struct bnx2x_mcast_ramrod_params *p, int cmd);
  483. /**
  484. * Restore the values of internal counters in case of a failure.
  485. */
  486. void (*revert)(struct bnx2x *bp,
  487. struct bnx2x_mcast_ramrod_params *p,
  488. int old_num_bins);
  489. int (*get_registry_size)(struct bnx2x_mcast_obj *o);
  490. void (*set_registry_size)(struct bnx2x_mcast_obj *o, int n);
  491. };
  492. /*************************** Credit handling **********************************/
  493. struct bnx2x_credit_pool_obj {
  494. /* Current amount of credit in the pool */
  495. atomic_t credit;
  496. /* Maximum allowed credit. put() will check against it. */
  497. int pool_sz;
  498. /*
  499. * Allocate a pool table statically.
  500. *
  501. * Currently the mamimum allowed size is MAX_MAC_CREDIT_E2(272)
  502. *
  503. * The set bit in the table will mean that the entry is available.
  504. */
  505. #define BNX2X_POOL_VEC_SIZE (MAX_MAC_CREDIT_E2 / 64)
  506. u64 pool_mirror[BNX2X_POOL_VEC_SIZE];
  507. /* Base pool offset (initialized differently */
  508. int base_pool_offset;
  509. /**
  510. * Get the next free pool entry.
  511. *
  512. * @return true if there was a free entry in the pool
  513. */
  514. bool (*get_entry)(struct bnx2x_credit_pool_obj *o, int *entry);
  515. /**
  516. * Return the entry back to the pool.
  517. *
  518. * @return true if entry is legal and has been successfully
  519. * returned to the pool.
  520. */
  521. bool (*put_entry)(struct bnx2x_credit_pool_obj *o, int entry);
  522. /**
  523. * Get the requested amount of credit from the pool.
  524. *
  525. * @param cnt Amount of requested credit
  526. * @return true if the operation is successful
  527. */
  528. bool (*get)(struct bnx2x_credit_pool_obj *o, int cnt);
  529. /**
  530. * Returns the credit to the pool.
  531. *
  532. * @param cnt Amount of credit to return
  533. * @return true if the operation is successful
  534. */
  535. bool (*put)(struct bnx2x_credit_pool_obj *o, int cnt);
  536. /**
  537. * Reads the current amount of credit.
  538. */
  539. int (*check)(struct bnx2x_credit_pool_obj *o);
  540. };
  541. /*************************** RSS configuration ********************************/
  542. enum {
  543. /* RSS_MODE bits are mutually exclusive */
  544. BNX2X_RSS_MODE_DISABLED,
  545. BNX2X_RSS_MODE_REGULAR,
  546. BNX2X_RSS_MODE_VLAN_PRI,
  547. BNX2X_RSS_MODE_E1HOV_PRI,
  548. BNX2X_RSS_MODE_IP_DSCP,
  549. BNX2X_RSS_SET_SRCH, /* Setup searcher, E1x specific flag */
  550. BNX2X_RSS_IPV4,
  551. BNX2X_RSS_IPV4_TCP,
  552. BNX2X_RSS_IPV6,
  553. BNX2X_RSS_IPV6_TCP,
  554. };
  555. struct bnx2x_config_rss_params {
  556. struct bnx2x_rss_config_obj *rss_obj;
  557. /* may have RAMROD_COMP_WAIT set only */
  558. unsigned long ramrod_flags;
  559. /* BNX2X_RSS_X bits */
  560. unsigned long rss_flags;
  561. /* Number hash bits to take into an account */
  562. u8 rss_result_mask;
  563. /* Indirection table */
  564. u8 ind_table[T_ETH_INDIRECTION_TABLE_SIZE];
  565. /* RSS hash values */
  566. u32 rss_key[10];
  567. /* valid only iff BNX2X_RSS_UPDATE_TOE is set */
  568. u16 toe_rss_bitmap;
  569. };
  570. struct bnx2x_rss_config_obj {
  571. struct bnx2x_raw_obj raw;
  572. /* RSS engine to use */
  573. u8 engine_id;
  574. /* Last configured indirection table */
  575. u8 ind_table[T_ETH_INDIRECTION_TABLE_SIZE];
  576. int (*config_rss)(struct bnx2x *bp,
  577. struct bnx2x_config_rss_params *p);
  578. };
  579. /*********************** Queue state update ***********************************/
  580. /* UPDATE command options */
  581. enum {
  582. BNX2X_Q_UPDATE_IN_VLAN_REM,
  583. BNX2X_Q_UPDATE_IN_VLAN_REM_CHNG,
  584. BNX2X_Q_UPDATE_OUT_VLAN_REM,
  585. BNX2X_Q_UPDATE_OUT_VLAN_REM_CHNG,
  586. BNX2X_Q_UPDATE_ANTI_SPOOF,
  587. BNX2X_Q_UPDATE_ANTI_SPOOF_CHNG,
  588. BNX2X_Q_UPDATE_ACTIVATE,
  589. BNX2X_Q_UPDATE_ACTIVATE_CHNG,
  590. BNX2X_Q_UPDATE_DEF_VLAN_EN,
  591. BNX2X_Q_UPDATE_DEF_VLAN_EN_CHNG,
  592. BNX2X_Q_UPDATE_SILENT_VLAN_REM_CHNG,
  593. BNX2X_Q_UPDATE_SILENT_VLAN_REM
  594. };
  595. /* Allowed Queue states */
  596. enum bnx2x_q_state {
  597. BNX2X_Q_STATE_RESET,
  598. BNX2X_Q_STATE_INITIALIZED,
  599. BNX2X_Q_STATE_ACTIVE,
  600. BNX2X_Q_STATE_MULTI_COS,
  601. BNX2X_Q_STATE_MCOS_TERMINATED,
  602. BNX2X_Q_STATE_INACTIVE,
  603. BNX2X_Q_STATE_STOPPED,
  604. BNX2X_Q_STATE_TERMINATED,
  605. BNX2X_Q_STATE_FLRED,
  606. BNX2X_Q_STATE_MAX,
  607. };
  608. /* Allowed commands */
  609. enum bnx2x_queue_cmd {
  610. BNX2X_Q_CMD_INIT,
  611. BNX2X_Q_CMD_SETUP,
  612. BNX2X_Q_CMD_SETUP_TX_ONLY,
  613. BNX2X_Q_CMD_DEACTIVATE,
  614. BNX2X_Q_CMD_ACTIVATE,
  615. BNX2X_Q_CMD_UPDATE,
  616. BNX2X_Q_CMD_UPDATE_TPA,
  617. BNX2X_Q_CMD_HALT,
  618. BNX2X_Q_CMD_CFC_DEL,
  619. BNX2X_Q_CMD_TERMINATE,
  620. BNX2X_Q_CMD_EMPTY,
  621. BNX2X_Q_CMD_MAX,
  622. };
  623. /* queue SETUP + INIT flags */
  624. enum {
  625. BNX2X_Q_FLG_TPA,
  626. BNX2X_Q_FLG_STATS,
  627. BNX2X_Q_FLG_ZERO_STATS,
  628. BNX2X_Q_FLG_ACTIVE,
  629. BNX2X_Q_FLG_OV,
  630. BNX2X_Q_FLG_VLAN,
  631. BNX2X_Q_FLG_COS,
  632. BNX2X_Q_FLG_HC,
  633. BNX2X_Q_FLG_HC_EN,
  634. BNX2X_Q_FLG_DHC,
  635. BNX2X_Q_FLG_FCOE,
  636. BNX2X_Q_FLG_LEADING_RSS,
  637. BNX2X_Q_FLG_MCAST,
  638. BNX2X_Q_FLG_DEF_VLAN,
  639. BNX2X_Q_FLG_TX_SWITCH,
  640. BNX2X_Q_FLG_TX_SEC,
  641. BNX2X_Q_FLG_ANTI_SPOOF,
  642. BNX2X_Q_FLG_SILENT_VLAN_REM
  643. };
  644. /* Queue type options: queue type may be a compination of below. */
  645. enum bnx2x_q_type {
  646. /** TODO: Consider moving both these flags into the init()
  647. * ramrod params.
  648. */
  649. BNX2X_Q_TYPE_HAS_RX,
  650. BNX2X_Q_TYPE_HAS_TX,
  651. };
  652. #define BNX2X_PRIMARY_CID_INDEX 0
  653. #define BNX2X_MULTI_TX_COS_E1X 1
  654. #define BNX2X_MULTI_TX_COS_E2_E3A0 2
  655. #define BNX2X_MULTI_TX_COS_E3B0 3
  656. #define BNX2X_MULTI_TX_COS BNX2X_MULTI_TX_COS_E3B0
  657. struct bnx2x_queue_init_params {
  658. struct {
  659. unsigned long flags;
  660. u16 hc_rate;
  661. u8 fw_sb_id;
  662. u8 sb_cq_index;
  663. } tx;
  664. struct {
  665. unsigned long flags;
  666. u16 hc_rate;
  667. u8 fw_sb_id;
  668. u8 sb_cq_index;
  669. } rx;
  670. /* CID context in the host memory */
  671. struct eth_context *cxts[BNX2X_MULTI_TX_COS];
  672. /* maximum number of cos supported by hardware */
  673. u8 max_cos;
  674. };
  675. struct bnx2x_queue_terminate_params {
  676. /* index within the tx_only cids of this queue object */
  677. u8 cid_index;
  678. };
  679. struct bnx2x_queue_cfc_del_params {
  680. /* index within the tx_only cids of this queue object */
  681. u8 cid_index;
  682. };
  683. struct bnx2x_queue_update_params {
  684. unsigned long update_flags; /* BNX2X_Q_UPDATE_XX bits */
  685. u16 def_vlan;
  686. u16 silent_removal_value;
  687. u16 silent_removal_mask;
  688. /* index within the tx_only cids of this queue object */
  689. u8 cid_index;
  690. };
  691. struct rxq_pause_params {
  692. u16 bd_th_lo;
  693. u16 bd_th_hi;
  694. u16 rcq_th_lo;
  695. u16 rcq_th_hi;
  696. u16 sge_th_lo; /* valid iff BNX2X_Q_FLG_TPA */
  697. u16 sge_th_hi; /* valid iff BNX2X_Q_FLG_TPA */
  698. u16 pri_map;
  699. };
  700. /* general */
  701. struct bnx2x_general_setup_params {
  702. /* valid iff BNX2X_Q_FLG_STATS */
  703. u8 stat_id;
  704. u8 spcl_id;
  705. u16 mtu;
  706. u8 cos;
  707. };
  708. struct bnx2x_rxq_setup_params {
  709. /* dma */
  710. dma_addr_t dscr_map;
  711. dma_addr_t sge_map;
  712. dma_addr_t rcq_map;
  713. dma_addr_t rcq_np_map;
  714. u16 drop_flags;
  715. u16 buf_sz;
  716. u8 fw_sb_id;
  717. u8 cl_qzone_id;
  718. /* valid iff BNX2X_Q_FLG_TPA */
  719. u16 tpa_agg_sz;
  720. u16 sge_buf_sz;
  721. u8 max_sges_pkt;
  722. u8 max_tpa_queues;
  723. u8 rss_engine_id;
  724. u8 cache_line_log;
  725. u8 sb_cq_index;
  726. /* valid iff BXN2X_Q_FLG_SILENT_VLAN_REM */
  727. u16 silent_removal_value;
  728. u16 silent_removal_mask;
  729. };
  730. struct bnx2x_txq_setup_params {
  731. /* dma */
  732. dma_addr_t dscr_map;
  733. u8 fw_sb_id;
  734. u8 sb_cq_index;
  735. u8 cos; /* valid iff BNX2X_Q_FLG_COS */
  736. u16 traffic_type;
  737. /* equals to the leading rss client id, used for TX classification*/
  738. u8 tss_leading_cl_id;
  739. /* valid iff BNX2X_Q_FLG_DEF_VLAN */
  740. u16 default_vlan;
  741. };
  742. struct bnx2x_queue_setup_params {
  743. struct bnx2x_general_setup_params gen_params;
  744. struct bnx2x_txq_setup_params txq_params;
  745. struct bnx2x_rxq_setup_params rxq_params;
  746. struct rxq_pause_params pause_params;
  747. unsigned long flags;
  748. };
  749. struct bnx2x_queue_setup_tx_only_params {
  750. struct bnx2x_general_setup_params gen_params;
  751. struct bnx2x_txq_setup_params txq_params;
  752. unsigned long flags;
  753. /* index within the tx_only cids of this queue object */
  754. u8 cid_index;
  755. };
  756. struct bnx2x_queue_state_params {
  757. struct bnx2x_queue_sp_obj *q_obj;
  758. /* Current command */
  759. enum bnx2x_queue_cmd cmd;
  760. /* may have RAMROD_COMP_WAIT set only */
  761. unsigned long ramrod_flags;
  762. /* Params according to the current command */
  763. union {
  764. struct bnx2x_queue_update_params update;
  765. struct bnx2x_queue_setup_params setup;
  766. struct bnx2x_queue_init_params init;
  767. struct bnx2x_queue_setup_tx_only_params tx_only;
  768. struct bnx2x_queue_terminate_params terminate;
  769. struct bnx2x_queue_cfc_del_params cfc_del;
  770. } params;
  771. };
  772. struct bnx2x_queue_sp_obj {
  773. u32 cids[BNX2X_MULTI_TX_COS];
  774. u8 cl_id;
  775. u8 func_id;
  776. /*
  777. * number of traffic classes supported by queue.
  778. * The primary connection of the queue suppotrs the first traffic
  779. * class. Any further traffic class is suppoted by a tx-only
  780. * connection.
  781. *
  782. * Therefore max_cos is also a number of valid entries in the cids
  783. * array.
  784. */
  785. u8 max_cos;
  786. u8 num_tx_only, next_tx_only;
  787. enum bnx2x_q_state state, next_state;
  788. /* bits from enum bnx2x_q_type */
  789. unsigned long type;
  790. /* BNX2X_Q_CMD_XX bits. This object implements "one
  791. * pending" paradigm but for debug and tracing purposes it's
  792. * more convinient to have different bits for different
  793. * commands.
  794. */
  795. unsigned long pending;
  796. /* Buffer to use as a ramrod data and its mapping */
  797. void *rdata;
  798. dma_addr_t rdata_mapping;
  799. /**
  800. * Performs one state change according to the given parameters.
  801. *
  802. * @return 0 in case of success and negative value otherwise.
  803. */
  804. int (*send_cmd)(struct bnx2x *bp,
  805. struct bnx2x_queue_state_params *params);
  806. /**
  807. * Sets the pending bit according to the requested transition.
  808. */
  809. int (*set_pending)(struct bnx2x_queue_sp_obj *o,
  810. struct bnx2x_queue_state_params *params);
  811. /**
  812. * Checks that the requested state transition is legal.
  813. */
  814. int (*check_transition)(struct bnx2x *bp,
  815. struct bnx2x_queue_sp_obj *o,
  816. struct bnx2x_queue_state_params *params);
  817. /**
  818. * Completes the pending command.
  819. */
  820. int (*complete_cmd)(struct bnx2x *bp,
  821. struct bnx2x_queue_sp_obj *o,
  822. enum bnx2x_queue_cmd);
  823. int (*wait_comp)(struct bnx2x *bp,
  824. struct bnx2x_queue_sp_obj *o,
  825. enum bnx2x_queue_cmd cmd);
  826. };
  827. /********************** Function state update *********************************/
  828. /* Allowed Function states */
  829. enum bnx2x_func_state {
  830. BNX2X_F_STATE_RESET,
  831. BNX2X_F_STATE_INITIALIZED,
  832. BNX2X_F_STATE_STARTED,
  833. BNX2X_F_STATE_MAX,
  834. };
  835. /* Allowed Function commands */
  836. enum bnx2x_func_cmd {
  837. BNX2X_F_CMD_HW_INIT,
  838. BNX2X_F_CMD_START,
  839. BNX2X_F_CMD_STOP,
  840. BNX2X_F_CMD_HW_RESET,
  841. BNX2X_F_CMD_MAX,
  842. };
  843. struct bnx2x_func_hw_init_params {
  844. /* A load phase returned by MCP.
  845. *
  846. * May be:
  847. * FW_MSG_CODE_DRV_LOAD_COMMON_CHIP
  848. * FW_MSG_CODE_DRV_LOAD_COMMON
  849. * FW_MSG_CODE_DRV_LOAD_PORT
  850. * FW_MSG_CODE_DRV_LOAD_FUNCTION
  851. */
  852. u32 load_phase;
  853. };
  854. struct bnx2x_func_hw_reset_params {
  855. /* A load phase returned by MCP.
  856. *
  857. * May be:
  858. * FW_MSG_CODE_DRV_LOAD_COMMON_CHIP
  859. * FW_MSG_CODE_DRV_LOAD_COMMON
  860. * FW_MSG_CODE_DRV_LOAD_PORT
  861. * FW_MSG_CODE_DRV_LOAD_FUNCTION
  862. */
  863. u32 reset_phase;
  864. };
  865. struct bnx2x_func_start_params {
  866. /* Multi Function mode:
  867. * - Single Function
  868. * - Switch Dependent
  869. * - Switch Independent
  870. */
  871. u16 mf_mode;
  872. /* Switch Dependent mode outer VLAN tag */
  873. u16 sd_vlan_tag;
  874. /* Function cos mode */
  875. u8 network_cos_mode;
  876. };
  877. struct bnx2x_func_state_params {
  878. struct bnx2x_func_sp_obj *f_obj;
  879. /* Current command */
  880. enum bnx2x_func_cmd cmd;
  881. /* may have RAMROD_COMP_WAIT set only */
  882. unsigned long ramrod_flags;
  883. /* Params according to the current command */
  884. union {
  885. struct bnx2x_func_hw_init_params hw_init;
  886. struct bnx2x_func_hw_reset_params hw_reset;
  887. struct bnx2x_func_start_params start;
  888. } params;
  889. };
  890. struct bnx2x_func_sp_drv_ops {
  891. /* Init tool + runtime initialization:
  892. * - Common Chip
  893. * - Common (per Path)
  894. * - Port
  895. * - Function phases
  896. */
  897. int (*init_hw_cmn_chip)(struct bnx2x *bp);
  898. int (*init_hw_cmn)(struct bnx2x *bp);
  899. int (*init_hw_port)(struct bnx2x *bp);
  900. int (*init_hw_func)(struct bnx2x *bp);
  901. /* Reset Function HW: Common, Port, Function phases. */
  902. void (*reset_hw_cmn)(struct bnx2x *bp);
  903. void (*reset_hw_port)(struct bnx2x *bp);
  904. void (*reset_hw_func)(struct bnx2x *bp);
  905. /* Init/Free GUNZIP resources */
  906. int (*gunzip_init)(struct bnx2x *bp);
  907. void (*gunzip_end)(struct bnx2x *bp);
  908. /* Prepare/Release FW resources */
  909. int (*init_fw)(struct bnx2x *bp);
  910. void (*release_fw)(struct bnx2x *bp);
  911. };
  912. struct bnx2x_func_sp_obj {
  913. enum bnx2x_func_state state, next_state;
  914. /* BNX2X_FUNC_CMD_XX bits. This object implements "one
  915. * pending" paradigm but for debug and tracing purposes it's
  916. * more convinient to have different bits for different
  917. * commands.
  918. */
  919. unsigned long pending;
  920. /* Buffer to use as a ramrod data and its mapping */
  921. void *rdata;
  922. dma_addr_t rdata_mapping;
  923. /* this mutex validates that when pending flag is taken, the next
  924. * ramrod to be sent will be the one set the pending bit
  925. */
  926. struct mutex one_pending_mutex;
  927. /* Driver interface */
  928. struct bnx2x_func_sp_drv_ops *drv;
  929. /**
  930. * Performs one state change according to the given parameters.
  931. *
  932. * @return 0 in case of success and negative value otherwise.
  933. */
  934. int (*send_cmd)(struct bnx2x *bp,
  935. struct bnx2x_func_state_params *params);
  936. /**
  937. * Checks that the requested state transition is legal.
  938. */
  939. int (*check_transition)(struct bnx2x *bp,
  940. struct bnx2x_func_sp_obj *o,
  941. struct bnx2x_func_state_params *params);
  942. /**
  943. * Completes the pending command.
  944. */
  945. int (*complete_cmd)(struct bnx2x *bp,
  946. struct bnx2x_func_sp_obj *o,
  947. enum bnx2x_func_cmd cmd);
  948. int (*wait_comp)(struct bnx2x *bp, struct bnx2x_func_sp_obj *o,
  949. enum bnx2x_func_cmd cmd);
  950. };
  951. /********************** Interfaces ********************************************/
  952. /* Queueable objects set */
  953. union bnx2x_qable_obj {
  954. struct bnx2x_vlan_mac_obj vlan_mac;
  955. };
  956. /************** Function state update *********/
  957. void bnx2x_init_func_obj(struct bnx2x *bp,
  958. struct bnx2x_func_sp_obj *obj,
  959. void *rdata, dma_addr_t rdata_mapping,
  960. struct bnx2x_func_sp_drv_ops *drv_iface);
  961. int bnx2x_func_state_change(struct bnx2x *bp,
  962. struct bnx2x_func_state_params *params);
  963. /******************* Queue State **************/
  964. void bnx2x_init_queue_obj(struct bnx2x *bp,
  965. struct bnx2x_queue_sp_obj *obj, u8 cl_id, u32 *cids,
  966. u8 cid_cnt, u8 func_id, void *rdata,
  967. dma_addr_t rdata_mapping, unsigned long type);
  968. int bnx2x_queue_state_change(struct bnx2x *bp,
  969. struct bnx2x_queue_state_params *params);
  970. /********************* VLAN-MAC ****************/
  971. void bnx2x_init_mac_obj(struct bnx2x *bp,
  972. struct bnx2x_vlan_mac_obj *mac_obj,
  973. u8 cl_id, u32 cid, u8 func_id, void *rdata,
  974. dma_addr_t rdata_mapping, int state,
  975. unsigned long *pstate, bnx2x_obj_type type,
  976. struct bnx2x_credit_pool_obj *macs_pool);
  977. void bnx2x_init_vlan_obj(struct bnx2x *bp,
  978. struct bnx2x_vlan_mac_obj *vlan_obj,
  979. u8 cl_id, u32 cid, u8 func_id, void *rdata,
  980. dma_addr_t rdata_mapping, int state,
  981. unsigned long *pstate, bnx2x_obj_type type,
  982. struct bnx2x_credit_pool_obj *vlans_pool);
  983. void bnx2x_init_vlan_mac_obj(struct bnx2x *bp,
  984. struct bnx2x_vlan_mac_obj *vlan_mac_obj,
  985. u8 cl_id, u32 cid, u8 func_id, void *rdata,
  986. dma_addr_t rdata_mapping, int state,
  987. unsigned long *pstate, bnx2x_obj_type type,
  988. struct bnx2x_credit_pool_obj *macs_pool,
  989. struct bnx2x_credit_pool_obj *vlans_pool);
  990. int bnx2x_config_vlan_mac(struct bnx2x *bp,
  991. struct bnx2x_vlan_mac_ramrod_params *p);
  992. int bnx2x_vlan_mac_move(struct bnx2x *bp,
  993. struct bnx2x_vlan_mac_ramrod_params *p,
  994. struct bnx2x_vlan_mac_obj *dest_o);
  995. /********************* RX MODE ****************/
  996. void bnx2x_init_rx_mode_obj(struct bnx2x *bp,
  997. struct bnx2x_rx_mode_obj *o);
  998. /**
  999. * Send and RX_MODE ramrod according to the provided parameters.
  1000. *
  1001. * @param bp
  1002. * @param p Command parameters
  1003. *
  1004. * @return 0 - if operation was successfull and there is no pending completions,
  1005. * positive number - if there are pending completions,
  1006. * negative - if there were errors
  1007. */
  1008. int bnx2x_config_rx_mode(struct bnx2x *bp,
  1009. struct bnx2x_rx_mode_ramrod_params *p);
  1010. /****************** MULTICASTS ****************/
  1011. void bnx2x_init_mcast_obj(struct bnx2x *bp,
  1012. struct bnx2x_mcast_obj *mcast_obj,
  1013. u8 mcast_cl_id, u32 mcast_cid, u8 func_id,
  1014. u8 engine_id, void *rdata, dma_addr_t rdata_mapping,
  1015. int state, unsigned long *pstate,
  1016. bnx2x_obj_type type);
  1017. /**
  1018. * Configure multicast MACs list. May configure a new list
  1019. * provided in p->mcast_list (BNX2X_MCAST_CMD_ADD), clean up
  1020. * (BNX2X_MCAST_CMD_DEL) or restore (BNX2X_MCAST_CMD_RESTORE) a current
  1021. * configuration, continue to execute the pending commands
  1022. * (BNX2X_MCAST_CMD_CONT).
  1023. *
  1024. * If previous command is still pending or if number of MACs to
  1025. * configure is more that maximum number of MACs in one command,
  1026. * the current command will be enqueued to the tail of the
  1027. * pending commands list.
  1028. *
  1029. * @param bp
  1030. * @param p
  1031. * @param command to execute: BNX2X_MCAST_CMD_X
  1032. *
  1033. * @return 0 is operation was sucessfull and there are no pending completions,
  1034. * negative if there were errors, positive if there are pending
  1035. * completions.
  1036. */
  1037. int bnx2x_config_mcast(struct bnx2x *bp,
  1038. struct bnx2x_mcast_ramrod_params *p, int cmd);
  1039. /****************** CREDIT POOL ****************/
  1040. void bnx2x_init_mac_credit_pool(struct bnx2x *bp,
  1041. struct bnx2x_credit_pool_obj *p, u8 func_id,
  1042. u8 func_num);
  1043. void bnx2x_init_vlan_credit_pool(struct bnx2x *bp,
  1044. struct bnx2x_credit_pool_obj *p, u8 func_id,
  1045. u8 func_num);
  1046. /****************** RSS CONFIGURATION ****************/
  1047. void bnx2x_init_rss_config_obj(struct bnx2x *bp,
  1048. struct bnx2x_rss_config_obj *rss_obj,
  1049. u8 cl_id, u32 cid, u8 func_id, u8 engine_id,
  1050. void *rdata, dma_addr_t rdata_mapping,
  1051. int state, unsigned long *pstate,
  1052. bnx2x_obj_type type);
  1053. /**
  1054. * Updates RSS configuration according to provided parameters.
  1055. *
  1056. * @param bp
  1057. * @param p
  1058. *
  1059. * @return 0 in case of success
  1060. */
  1061. int bnx2x_config_rss(struct bnx2x *bp,
  1062. struct bnx2x_config_rss_params *p);
  1063. /**
  1064. * Return the current ind_table configuration.
  1065. *
  1066. * @param bp
  1067. * @param ind_table buffer to fill with the current indirection
  1068. * table content. Should be at least
  1069. * T_ETH_INDIRECTION_TABLE_SIZE bytes long.
  1070. */
  1071. void bnx2x_get_rss_ind_table(struct bnx2x_rss_config_obj *rss_obj,
  1072. u8 *ind_table);
  1073. #endif /* BNX2X_SP_VERBS */