瀏覽代碼

[mtnic] Add multiport support and some minor fixes

Signed-off-by: Michael Brown <mcb30@etherboot.org>
tags/v0.9.7
Itay Gazit 15 年之前
父節點
當前提交
750c19466a
共有 2 個文件被更改,包括 702 次插入600 次删除
  1. 555
    464
      src/drivers/net/mtnic.c
  2. 147
    136
      src/drivers/net/mtnic.h

+ 555
- 464
src/drivers/net/mtnic.c
文件差異過大導致無法顯示
查看文件


+ 147
- 136
src/drivers/net/mtnic.h 查看文件

@@ -38,24 +38,28 @@
38 38
 /*
39 39
 * Device setup
40 40
 */
41
-
42
-/*
43
-	Note port number can be changed under mtnic.c !
44
-*/
45 41
 #define MTNIC_MAX_PORTS		2
42
+#define MTNIC_PORT1		0
43
+#define MTNIC_PORT2		1
46 44
 #define NUM_TX_RINGS		1
47 45
 #define NUM_RX_RINGS		1
48 46
 #define NUM_CQS 		(NUM_RX_RINGS + NUM_TX_RINGS)
49 47
 #define GO_BIT_TIMEOUT		6000
50 48
 #define TBIT_RETRIES		100
51 49
 #define UNITS_BUFFER_SIZE 	8 /* can be configured to 4/8/16 */
52
-#define MAX_GAP_PROD_CONS 	(UNITS_BUFFER_SIZE/4)
53
-#define DEF_MTU 		1600
54
-#define DEF_IOBUF_SIZE 		1600
50
+#define MAX_GAP_PROD_CONS 	( UNITS_BUFFER_SIZE / 4 )
51
+#define ETH_DEF_LEN		1540          /* 40 bytes used by the card */
52
+#define ETH_FCS_LEN		14
53
+#define DEF_MTU 		ETH_DEF_LEN + ETH_FCS_LEN
54
+#define DEF_IOBUF_SIZE 		ETH_DEF_LEN
55
+
55 56
 #define MAC_ADDRESS_SIZE 	6
56 57
 #define NUM_EQES 		16
57 58
 #define ROUND_TO_CHECK		0x400
58 59
 
60
+#define DELAY_LINK_CHECK	300
61
+#define CHECK_LINK_TIMES	7
62
+
59 63
 
60 64
 #define XNOR(x,y)		(!(x) == !(y))
61 65
 #define dma_addr_t 		unsigned long
@@ -108,7 +112,7 @@ typedef enum mtnic_if_cmd {
108 112
 	MTNIC_IF_CMD_CONFIG_RX = 0x005, /* general receive configuration */
109 113
 	MTNIC_IF_CMD_CONFIG_TX = 0x006, /* general transmit configuration */
110 114
 	MTNIC_IF_CMD_CONFIG_INT_FREQ = 0x007, /* interrupt timers freq limits */
111
-	MTNIC_IF_CMD_HEART_BEAT	= 0x008, /* NOP command testing liveliness */
115
+	MTNIC_IF_CMD_HEART_BEAT = 0x008, /* NOP command testing liveliness */
112 116
 	MTNIC_IF_CMD_CLOSE_NIC = 0x009, /* release memory and stop the NIC */
113 117
 
114 118
 	/* Port commands: */
@@ -119,22 +123,22 @@ typedef enum mtnic_if_cmd {
119 123
 	MTNIC_IF_CMD_CONFIG_PORT_VLAN_FILTER   = 0x14, /* configure VLAN filter */
120 124
 	MTNIC_IF_CMD_CONFIG_PORT_MCAST_FILTER  = 0x15, /* configure mcast filter */
121 125
 	MTNIC_IF_CMD_ENABLE_PORT_MCAST_FILTER  = 0x16, /* enable/disable */
122
-	MTNIC_IF_CMD_SET_PORT_MTU	       = 0x17, /* set port MTU */
126
+	MTNIC_IF_CMD_SET_PORT_MTU              = 0x17, /* set port MTU */
123 127
 	MTNIC_IF_CMD_SET_PORT_PROMISCUOUS_MODE = 0x18, /* enable/disable promisc */
124 128
 	MTNIC_IF_CMD_SET_PORT_DEFAULT_RING     = 0x19, /* set the default ring */
125
-	MTNIC_IF_CMD_SET_PORT_STATE	       = 0x1a, /* set link up/down */
126
-	MTNIC_IF_CMD_DUMP_STAT		       = 0x1b, /* dump statistics */
129
+	MTNIC_IF_CMD_SET_PORT_STATE            = 0x1a, /* set link up/down */
130
+	MTNIC_IF_CMD_DUMP_STAT                 = 0x1b, /* dump statistics */
127 131
 	MTNIC_IF_CMD_ARM_PORT_STATE_EVENT      = 0x1c, /* arm the port state event */
128 132
 
129 133
 	/* Ring / Completion queue commands: */
130
-	MTNIC_IF_CMD_CONFIG_CQ		  = 0x20,  /* set up completion queue */
131
-	MTNIC_IF_CMD_CONFIG_RX_RING	  = 0x21,  /* setup Rx ring */
132
-	MTNIC_IF_CMD_SET_RX_RING_ADDR	  = 0x22,  /* set Rx ring filter by address */
134
+	MTNIC_IF_CMD_CONFIG_CQ            = 0x20,  /* set up completion queue */
135
+	MTNIC_IF_CMD_CONFIG_RX_RING       = 0x21,  /* setup Rx ring */
136
+	MTNIC_IF_CMD_SET_RX_RING_ADDR     = 0x22,  /* set Rx ring filter by address */
133 137
 	MTNIC_IF_CMD_SET_RX_RING_MCAST    = 0x23,  /* set Rx ring mcast filter */
134
-	MTNIC_IF_CMD_ARM_RX_RING_WM	  = 0x24,  /* one-time low-watermark INT */
135
-	MTNIC_IF_CMD_CONFIG_TX_RING	  = 0x25,  /* set up Tx ring */
138
+	MTNIC_IF_CMD_ARM_RX_RING_WM       = 0x24,  /* one-time low-watermark INT */
139
+	MTNIC_IF_CMD_CONFIG_TX_RING       = 0x25,  /* set up Tx ring */
136 140
 	MTNIC_IF_CMD_ENFORCE_TX_RING_ADDR = 0x26,  /* setup anti spoofing */
137
-	MTNIC_IF_CMD_CONFIG_EQ		  = 0x27,  /* config EQ ring */
141
+	MTNIC_IF_CMD_CONFIG_EQ            = 0x27,  /* config EQ ring */
138 142
 	MTNIC_IF_CMD_RELEASE_RESOURCE     = 0x28,  /* release internal ref to resource */
139 143
 }
140 144
 mtnic_if_cmd_t;
@@ -144,15 +148,15 @@ mtnic_if_cmd_t;
144 148
 typedef enum mtnic_if_caps {
145 149
 	MTNIC_IF_CAP_MAX_TX_RING_PER_PORT = 0x0,
146 150
 	MTNIC_IF_CAP_MAX_RX_RING_PER_PORT = 0x1,
147
-	MTNIC_IF_CAP_MAX_CQ_PER_PORT	  = 0x2,
148
-	MTNIC_IF_CAP_NUM_PORTS		  = 0x3,
149
-	MTNIC_IF_CAP_MAX_TX_DESC	  = 0x4,
150
-	MTNIC_IF_CAP_MAX_RX_DESC	  = 0x5,
151
-	MTNIC_IF_CAP_MAX_CQES		  = 0x6,
152
-	MTNIC_IF_CAP_MAX_TX_SG_ENTRIES	  = 0x7,
153
-	MTNIC_IF_CAP_MAX_RX_SG_ENTRIES	  = 0x8,
154
-	MTNIC_IF_CAP_MEM_KEY  		  = 0x9, /* key to mem (after map_pages) */
155
-	MTNIC_IF_CAP_RSS_HASH_TYPE	  = 0xa, /* one of mtnic_if_rss_types_t */
151
+	MTNIC_IF_CAP_MAX_CQ_PER_PORT      = 0x2,
152
+	MTNIC_IF_CAP_NUM_PORTS            = 0x3,
153
+	MTNIC_IF_CAP_MAX_TX_DESC          = 0x4,
154
+	MTNIC_IF_CAP_MAX_RX_DESC          = 0x5,
155
+	MTNIC_IF_CAP_MAX_CQES             = 0x6,
156
+	MTNIC_IF_CAP_MAX_TX_SG_ENTRIES    = 0x7,
157
+	MTNIC_IF_CAP_MAX_RX_SG_ENTRIES    = 0x8,
158
+	MTNIC_IF_CAP_MEM_KEY              = 0x9, /* key to mem (after map_pages) */
159
+	MTNIC_IF_CAP_RSS_HASH_TYPE        = 0xa, /* one of mtnic_if_rss_types_t */
156 160
 	MTNIC_IF_CAP_MAX_PORT_UCAST_ADDR  = 0xc,
157 161
 	MTNIC_IF_CAP_MAX_RING_UCAST_ADDR  = 0xd, /* only for ADDR steer */
158 162
 	MTNIC_IF_CAP_MAX_PORT_MCAST_ADDR  = 0xe,
@@ -164,20 +168,20 @@ typedef enum mtnic_if_caps {
164 168
 	MTNIC_IF_CAP_EQ_DB_OFFSET         = 0x14, /* offset in bytes for EQ doorbell record */
165 169
 
166 170
 	/* These are per port - using port number from cap modifier field */
167
-	MTNIC_IF_CAP_SPEED		  = 0x20,
168
-	MTNIC_IF_CAP_DEFAULT_MAC	  = 0x21,
169
-	MTNIC_IF_CAP_EQ_OFFSET		  = 0x22,
170
-	MTNIC_IF_CAP_CQ_OFFSET		  = 0x23,
171
+	MTNIC_IF_CAP_SPEED                = 0x20,
172
+	MTNIC_IF_CAP_DEFAULT_MAC          = 0x21,
173
+	MTNIC_IF_CAP_EQ_OFFSET            = 0x22,
174
+	MTNIC_IF_CAP_CQ_OFFSET            = 0x23,
171 175
 	MTNIC_IF_CAP_TX_OFFSET            = 0x24,
172 176
 	MTNIC_IF_CAP_RX_OFFSET            = 0x25,
173 177
 
174 178
 } mtnic_if_caps_t;
175 179
 
176 180
 typedef enum mtnic_if_steer_types {
177
-        MTNIC_IF_STEER_NONE     = 0,
178
-        MTNIC_IF_STEER_PRIORITY = 1,
179
-        MTNIC_IF_STEER_RSS      = 2,
180
-        MTNIC_IF_STEER_ADDRESS  = 3,
181
+	MTNIC_IF_STEER_NONE     = 0,
182
+	MTNIC_IF_STEER_PRIORITY = 1,
183
+	MTNIC_IF_STEER_RSS      = 2,
184
+	MTNIC_IF_STEER_ADDRESS  = 3,
181 185
 } mtnic_if_steer_types_t;
182 186
 
183 187
 /** types of memory access modes */
@@ -188,19 +192,12 @@ typedef enum mtnic_if_memory_types {
188 192
 
189 193
 
190 194
 enum {
191
-	MTNIC_HCR_BASE		= 0x1f000,
192
-	MTNIC_HCR_SIZE		= 0x0001c,
193
-	MTNIC_CLR_INT_SIZE	= 0x00008,
195
+	MTNIC_HCR_BASE          = 0x1f000,
196
+	MTNIC_HCR_SIZE          = 0x0001c,
197
+	MTNIC_CLR_INT_SIZE      = 0x00008,
194 198
 };
195 199
 
196
-#define MELLANOX_VENDOR_ID	0x15b3
197
-#define MTNIC_DEVICE_ID 	0x00a00190
198 200
 #define MTNIC_RESET_OFFSET 	0xF0010
199
-#define MTNIC_DEVICE_ID_OFFSET 	0xF0014
200
-
201
-
202
-
203
-
204 201
 
205 202
 
206 203
 
@@ -265,7 +262,7 @@ struct mtnic_ring {
265 262
 
266 263
 	/* Buffers */
267 264
 	u32 buf_size; /* ring buffer size in bytes */
268
-        dma_addr_t dma;
265
+	dma_addr_t dma;
269 266
 	void *buf;
270 267
 	struct io_buffer *iobuf[UNITS_BUFFER_SIZE];
271 268
 
@@ -274,7 +271,7 @@ struct mtnic_ring {
274 271
 	u32 db_offset;
275 272
 
276 273
 	/* Rx ring only */
277
-        dma_addr_t iobuf_dma;
274
+	dma_addr_t iobuf_dma;
278 275
 	struct mtnic_rx_db_record *db;
279 276
 	dma_addr_t db_dma;
280 277
 };
@@ -351,15 +348,16 @@ struct mtnic_eqe {
351 348
 
352 349
 struct mtnic_eq {
353 350
 	u32 size; /* number of EQEs in ring */
354
-        u32 buf_size; /* EQ size in bytes */
351
+	u32 buf_size; /* EQ size in bytes */
355 352
 	void *buf;
356 353
 	dma_addr_t dma;
357 354
 };
358 355
 
359 356
 enum mtnic_state {
360 357
 	CARD_DOWN,
361
-        CARD_INITIALIZED,
362
-        CARD_UP
358
+	CARD_INITIALIZED,
359
+	CARD_UP,
360
+	CARD_LINK_DOWN,
363 361
 };
364 362
 
365 363
 /* FW */
@@ -375,9 +373,9 @@ struct mtnic_err_buf {
375 373
 
376 374
 
377 375
 struct mtnic_cmd {
378
-	void                     *buf;
379
-	unsigned long             mapping;
380
-	u32	 	      	  tbit;
376
+	void                    *buf;
377
+	unsigned long           mapping;
378
+	u32                     tbit;
381 379
 };
382 380
 
383 381
 
@@ -395,40 +393,52 @@ struct mtnic_txcq_db {
395 393
  * Device private data
396 394
  *
397 395
  */
398
-struct mtnic_priv {
399
-	struct net_device *dev;
400
-	struct pci_device *pdev;
401
-	u8 port;
396
+struct mtnic {
397
+	struct net_device               *netdev[MTNIC_MAX_PORTS];
398
+	struct mtnic_if_cmd_reg         *hcr;
399
+	struct mtnic_cmd                cmd;
400
+	struct pci_device               *pdev;
402 401
 
403
-	enum mtnic_state		state;
404
-        /* Firmware and board info */
405
-	u64              		fw_ver;
402
+	struct mtnic_eq                 eq;
403
+	u32                             *eq_db;
404
+
405
+	/* Firmware and board info */
406
+	u64                             fw_ver;
406 407
 	struct {
407
-		struct mtnic_pages	fw_pages;
408
-		struct mtnic_pages	extra_pages;
409
-		struct mtnic_err_buf 	err_buf;
410
-		u16			ifc_rev;
411
-		u8			num_ports;
412
-                u64			mac[MTNIC_MAX_PORTS];
413
-		u16			cq_offset;
414
-		u16			tx_offset[MTNIC_MAX_PORTS];
415
-		u16			rx_offset[MTNIC_MAX_PORTS];
416
-                u32			mem_type_snoop_be;
417
-                u32			txcq_db_offset;
418
-		u32			eq_db_offset;
419
-        } fw;
420
-
421
-
422
-	struct mtnic_if_cmd_reg 	*hcr;
423
-        struct mtnic_cmd		cmd;
408
+		struct mtnic_pages      fw_pages;
409
+		struct mtnic_pages      extra_pages;
410
+		struct mtnic_err_buf    err_buf;
411
+		u16                     ifc_rev;
412
+		u8                      num_ports;
413
+		u64                     mac[MTNIC_MAX_PORTS];
414
+		u16                     cq_offset;
415
+		u16                     tx_offset[MTNIC_MAX_PORTS];
416
+		u16                     rx_offset[MTNIC_MAX_PORTS];
417
+		u32                     mem_type_snoop_be;
418
+		u32                     txcq_db_offset;
419
+		u32                     eq_db_offset;
420
+	} fw;
421
+};
422
+
423
+
424
+
425
+
426
+
427
+struct mtnic_port {
428
+
429
+	struct mtnic                    *mtnic;
430
+	u8                              port;
431
+
432
+	enum mtnic_state                state;
424 433
 
425 434
 	/* TX, RX, CQs, EQ */
426
-        struct mtnic_ring tx_ring;
427
-	struct mtnic_ring rx_ring;
428
-	struct mtnic_cq cq[NUM_CQS];
429
-	struct mtnic_eq			eq;
430
-	u32 				*eq_db;
431
-	u32				poll_counter;
435
+	struct mtnic_ring               tx_ring;
436
+	struct mtnic_ring               rx_ring;
437
+	struct mtnic_cq                 cq[NUM_CQS];
438
+	u32                             poll_counter;
439
+	struct net_device               *netdev;
440
+
441
+
432 442
 };
433 443
 
434 444
 
@@ -492,33 +502,34 @@ struct mtnic_if_query_fw_out_mbox {
492 502
 /* CMD MTNIC_IF_CMD_QUERY_CAP */
493 503
 struct mtnic_if_query_cap_in_imm {
494 504
 	u16 reserved1;
495
-	u8		 cap_modifier;	 /* a modifier for the particular capability */
496
-	u8		 cap_index;	 /* the index of the capability queried */
505
+	u8               cap_modifier;   /* a modifier for the particular capability */
506
+	u8               cap_index;      /* the index of the capability queried */
497 507
 	u32 reserved2;
498 508
 };
499 509
 
500 510
 /* CMD OPEN_NIC */
501 511
 struct mtnic_if_open_nic_in_mbox {
502
-    u16 reserved1;
503
-    u16 mkey; /* number of mem keys for all chip*/
504
-    u32 mkey_entry; /* mem key entries for each key*/
505
-    u8 log_rx_p1; /* log2 rx rings for port1 */
506
-    u8 log_cq_p1; /* log2 cq for port1 */
507
-    u8 log_tx_p1; /* log2 tx rings for port1 */
508
-    u8 steer_p1;  /* port 1 steering mode */
509
-    u16 reserved2;
510
-    u8 log_vlan_p1; /* log2 vlan per rx port1 */
511
-    u8 log_mac_p1;  /* log2 mac per rx port1 */
512
-
513
-    u8 log_rx_p2; /* log2 rx rings for port1 */
514
-    u8 log_cq_p2; /* log2 cq for port1 */
515
-    u8 log_tx_p2; /* log2 tx rings for port1 */
516
-    u8 steer_p2;  /* port 1 steering mode */
517
-    u16 reserved3;
518
-    u8 log_vlan_p2; /* log2 vlan per rx port1 */
519
-    u8 log_mac_p2;  /* log2 mac per rx port1 */
512
+	u16 reserved1;
513
+	u16 mkey; /* number of mem keys for all chip*/
514
+	u32 mkey_entry; /* mem key entries for each key*/
515
+	u8 log_rx_p1; /* log2 rx rings for port1 */
516
+	u8 log_cq_p1; /* log2 cq for port1 */
517
+	u8 log_tx_p1; /* log2 tx rings for port1 */
518
+	u8 steer_p1;  /* port 1 steering mode */
519
+	u16 reserved2;
520
+	u8 log_vlan_p1; /* log2 vlan per rx port1 */
521
+	u8 log_mac_p1;  /* log2 mac per rx port1 */
522
+
523
+	u8 log_rx_p2; /* log2 rx rings for port1 */
524
+	u8 log_cq_p2; /* log2 cq for port1 */
525
+	u8 log_tx_p2; /* log2 tx rings for port1 */
526
+	u8 steer_p2;  /* port 1 steering mode */
527
+	u16 reserved3;
528
+	u8 log_vlan_p2; /* log2 vlan per rx port1 */
529
+	u8 log_mac_p2;  /* log2 mac per rx port1 */
520 530
 };
521 531
 
532
+
522 533
 /* CMD CONFIG_RX */
523 534
 struct mtnic_if_config_rx_in_imm {
524 535
 	u16 spkt_size; /* size of small packets interrupts enabled on CQ */
@@ -535,9 +546,9 @@ struct mtnic_if_config_send_in_imm {
535 546
 
536 547
 /* CMD HEART_BEAT */
537 548
 struct mtnic_if_heart_beat_out_imm {
538
-    u32 flags; /* several flags */
549
+	u32 flags; /* several flags */
539 550
 #define MTNIC_MASK_HEAR_BEAT_INT_ERROR  MTNIC_BC(31,1)
540
-    u32 reserved;
551
+	u32 reserved;
541 552
 };
542 553
 
543 554
 
@@ -547,14 +558,14 @@ struct mtnic_if_heart_beat_out_imm {
547 558
 /* CMD CONFIG_PORT_VLAN_FILTER */
548 559
 /* in mbox is a 4K bits mask - bit per VLAN */
549 560
 struct mtnic_if_config_port_vlan_filter_in_mbox {
550
-    u64 filter[64]; /* vlans[63:0] sit in filter[0], vlans[127:64] sit in filter[1] ..  */
561
+	u64 filter[64]; /* vlans[63:0] sit in filter[0], vlans[127:64] sit in filter[1] ..  */
551 562
 };
552 563
 
553 564
 
554 565
 /* CMD SET_PORT_MTU */
555 566
 struct mtnic_if_set_port_mtu_in_imm {
556 567
 	u16 reserved1;
557
-	u16 mtu;			/* The MTU of the port in bytes */
568
+	u16 mtu;                        /* The MTU of the port in bytes */
558 569
 	u32 reserved2;
559 570
 };
560 571
 
@@ -574,17 +585,17 @@ struct mtnic_if_set_port_state_in_imm {
574 585
 
575 586
 /* CMD CONFIG_CQ */
576 587
 struct mtnic_if_config_cq_in_mbox {
577
-	u8	     reserved1;
578
-	u8	     cq;
579
-	u8	     size;	  /* Num CQs is 2^size (size <= 22) */
580
-	u8	     offset; /* start address of CQE in first page (11:6) */
581
-	u16  tlast;	 /* interrupt moderation timer from last completion usec */
588
+	u8           reserved1;
589
+	u8           cq;
590
+	u8           size;        /* Num CQs is 2^size (size <= 22) */
591
+	u8           offset; /* start address of CQE in first page (11:6) */
592
+	u16  tlast;      /* interrupt moderation timer from last completion usec */
582 593
 	u8      flags;  /* flags */
583
-	u8	    int_vector; /* MSI index if MSI is enabled, otherwise reserved */
594
+	u8          int_vector; /* MSI index if MSI is enabled, otherwise reserved */
584 595
 	u16 reserved2;
585 596
 	u16 max_cnt;    /* interrupt moderation counter */
586
-	u8	    page_size;	 /* each mapped page is 2^(12+page_size) bytes */
587
-	u8	 reserved4[3];
597
+	u8          page_size;   /* each mapped page is 2^(12+page_size) bytes */
598
+	u8       reserved4[3];
588 599
 	u32 db_record_addr_h;  /*physical address of CQ doorbell record */
589 600
 	u32 db_record_addr_l;  /*physical address of CQ doorbell record */
590 601
 	u32 page_address[0]; /* 64 bit page addresses of CQ buffer */
@@ -592,21 +603,21 @@ struct mtnic_if_config_cq_in_mbox {
592 603
 
593 604
 /* CMD CONFIG_RX_RING */
594 605
 struct mtnic_if_config_rx_ring_in_mbox {
595
-	u8	 reserved1;
596
-	u8	 ring;				/* The ring index (with offset) */
597
-	u8	 stride_size;		/* stride and size */
606
+	u8       reserved1;
607
+	u8       ring;                          /* The ring index (with offset) */
608
+	u8       stride_size;           /* stride and size */
598 609
 	/* Entry size = 16* (2^stride) bytes */
599 610
 #define MTNIC_MASK_CONFIG_RX_RING_STRIDE     MTNIC_BC(4,3)
600 611
 	/* Rx ring size is 2^size entries */
601 612
 #define MTNIC_MASK_CONFIG_RX_RING_SIZE	      MTNIC_BC(0,4)
602
-	u8	 flags;				/* Bit0 - header separation */
603
-	u8	 page_size;			  /* Each mapped page is 2^(12+page_size) bytes */
604
-	u8	 reserved2[2];
605
-	u8	 cq;					  /* CQ associated with this ring */
606
-	u32	 db_record_addr_h;
607
-	u32	 db_record_addr_l;
608
-	u32 	 page_address[0];/* Array of 2^size 64b page descriptor addresses */
609
-								  /* Must hold all Rx descriptors + doorbell record. */
613
+	u8       flags;                         /* Bit0 - header separation */
614
+	u8       page_size;                       /* Each mapped page is 2^(12+page_size) bytes */
615
+	u8       reserved2[2];
616
+	u8       cq;                                      /* CQ associated with this ring */
617
+	u32      db_record_addr_h;
618
+	u32      db_record_addr_l;
619
+	u32      page_address[0];/* Array of 2^size 64b page descriptor addresses */
620
+	/* Must hold all Rx descriptors + doorbell record. */
610 621
 };
611 622
 
612 623
 /* The modifier for SET_RX_RING_ADDR */
@@ -619,27 +630,27 @@ struct mtnic_if_set_rx_ring_modifier {
619 630
 
620 631
 /* CMD SET_RX_RING_ADDR */
621 632
 struct mtnic_if_set_rx_ring_addr_in_imm {
622
-	u16 mac_47_32;		 /* UCAST MAC Address bits 47:32 */
633
+	u16 mac_47_32;           /* UCAST MAC Address bits 47:32 */
623 634
 	u16 flags_vlan_id; /* MAC/VLAN flags and vlan id */
624 635
 #define MTNIC_MASK_SET_RX_RING_ADDR_VLAN_ID MTNIC_BC(0,12)
625 636
 #define MTNIC_MASK_SET_RX_RING_ADDR_BY_MAC  MTNIC_BC(12,1)
626 637
 #define MTNIC_MASK_SET_RX_RING_ADDR_BY_VLAN MTNIC_BC(13,1)
627
-	u32 mac_31_0;	/* UCAST MAC Address bits 31:0 */
638
+	u32 mac_31_0;   /* UCAST MAC Address bits 31:0 */
628 639
 };
629 640
 
630 641
 /* CMD CONFIG_TX_RING */
631 642
 struct mtnic_if_config_send_ring_in_mbox {
632
-	u16 ring;			/* The ring index (with offset) */
643
+	u16 ring;                       /* The ring index (with offset) */
633 644
 #define MTNIC_MASK_CONFIG_TX_RING_INDEX  MTNIC_BC(0,8)
634
-	u8	 size;				/* Tx ring size is 32*2^size bytes */
645
+	u8       size;                          /* Tx ring size is 32*2^size bytes */
635 646
 #define MTNIC_MASK_CONFIG_TX_RING_SIZE	  MTNIC_BC(0,4)
636
-	u8	 reserved;
637
-	u8	 page_size;			/* Each mapped page is 2^(12+page_size) bytes */
638
-	u8	 qos_class;			/* The COS used for this Tx */
639
-	u16 cq;				/* CQ associated with this ring */
647
+	u8       reserved;
648
+	u8       page_size;                     /* Each mapped page is 2^(12+page_size) bytes */
649
+	u8       qos_class;                     /* The COS used for this Tx */
650
+	u16 cq;                         /* CQ associated with this ring */
640 651
 #define MTNIC_MASK_CONFIG_TX_CQ_INDEX	  MTNIC_BC(0,8)
641 652
 	u32 page_address[0]; /* 64 bit page addresses of descriptor buffer. */
642
-			/* The buffer must accommodate all Tx descriptors */
653
+	/* The buffer must accommodate all Tx descriptors */
643 654
 };
644 655
 
645 656
 /* CMD CONFIG_EQ */
@@ -647,9 +658,9 @@ struct mtnic_if_config_eq_in_mbox {
647 658
 	u8 reserved1;
648 659
 	u8 int_vector; /* MSI index if MSI enabled; otherwise reserved */
649 660
 #define MTNIC_MASK_CONFIG_EQ_INT_VEC MTNIC_BC(0,6)
650
-	u8 size;			/* Num CQs is 2^size entries (size <= 22) */
661
+	u8 size;                        /* Num CQs is 2^size entries (size <= 22) */
651 662
 #define MTNIC_MASK_CONFIG_EQ_SIZE	 MTNIC_BC(0,5)
652
-	u8 offset;		/* Start address of CQE in first page (11:6) */
663
+	u8 offset;              /* Start address of CQE in first page (11:6) */
653 664
 #define MTNIC_MASK_CONFIG_EQ_OFFSET	 MTNIC_BC(0,6)
654 665
 	u8 page_size; /* Each mapped page is 2^(12+page_size) bytes*/
655 666
 	u8 reserved[3];

Loading…
取消
儲存