aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2008-07-21 22:44:08 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-22 17:52:22 -0400
commitd9e651bc06690c5a5326e8d019fa7668409bc819 (patch)
treedf3051523f4c30f5b6da4230c80e70957bb144ed /drivers/net/netxen/netxen_nic.h
parentc9fc891f86c062449116fde8826a0ead650e17ac (diff)
netxen: cut-through rx changes
NX3031 supports cut-through operation where ingress packets are directly dma'ed into host buffers to reduce latency. This requires larger dma buffers (2kb) and different alignemnt. The buffer posting logic is changed a bit. The free rx buffers are maintained in linked list, since the received reference handles can be out of order. However rx descriptors are still posted sequentially, indexed by producer. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r--drivers/net/netxen/netxen_nic.h38
1 files changed, 28 insertions, 10 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index e41f62352b15..705fdf10f95d 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -140,6 +140,7 @@
140#define NX_RX_NORMAL_BUF_MAX_LEN (NX_MAX_ETHERHDR + NX_ETHERMTU) 140#define NX_RX_NORMAL_BUF_MAX_LEN (NX_MAX_ETHERHDR + NX_ETHERMTU)
141#define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU) 141#define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU)
142#define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU) 142#define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU)
143#define NX_CT_DEFAULT_RX_BUF_LEN 2048
143 144
144#define MAX_RX_BUFFER_LENGTH 1760 145#define MAX_RX_BUFFER_LENGTH 1760
145#define MAX_RX_JUMBO_BUFFER_LENGTH 8062 146#define MAX_RX_JUMBO_BUFFER_LENGTH 8062
@@ -391,8 +392,8 @@ struct rcv_desc {
391}; 392};
392 393
393/* opcode field in status_desc */ 394/* opcode field in status_desc */
394#define RCV_NIC_PKT (0xA) 395#define NETXEN_NIC_RXPKT_DESC 0x04
395#define STATUS_NIC_PKT ((RCV_NIC_PKT) << 12) 396#define NETXEN_OLD_RXPKT_DESC 0x3f
396 397
397/* for status field in status_desc */ 398/* for status field in status_desc */
398#define STATUS_NEED_CKSUM (1) 399#define STATUS_NEED_CKSUM (1)
@@ -424,6 +425,8 @@ struct rcv_desc {
424 (((sts_data) >> 28) & 0xFFFF) 425 (((sts_data) >> 28) & 0xFFFF)
425#define netxen_get_sts_prot(sts_data) \ 426#define netxen_get_sts_prot(sts_data) \
426 (((sts_data) >> 44) & 0x0F) 427 (((sts_data) >> 44) & 0x0F)
428#define netxen_get_sts_pkt_offset(sts_data) \
429 (((sts_data) >> 48) & 0x1F)
427#define netxen_get_sts_opcode(sts_data) \ 430#define netxen_get_sts_opcode(sts_data) \
428 (((sts_data) >> 58) & 0x03F) 431 (((sts_data) >> 58) & 0x03F)
429 432
@@ -438,17 +441,30 @@ struct rcv_desc {
438 441
439struct status_desc { 442struct status_desc {
440 /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length 443 /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length
441 28-43 reference_handle, 44-47 protocol, 48-52 unused 444 28-43 reference_handle, 44-47 protocol, 48-52 pkt_offset
442 53-55 desc_cnt, 56-57 owner, 58-63 opcode 445 53-55 desc_cnt, 56-57 owner, 58-63 opcode
443 */ 446 */
444 __le64 status_desc_data; 447 __le64 status_desc_data;
445 __le32 hash_value; 448 union {
446 u8 hash_type; 449 struct {
447 u8 msg_type; 450 __le32 hash_value;
448 u8 unused; 451 u8 hash_type;
449 /* Bit pattern: 0-6 lro_count indicates frag sequence, 452 u8 msg_type;
450 7 last_frag indicates last frag */ 453 u8 unused;
451 u8 lro; 454 union {
455 /* Bit pattern: 0-6 lro_count indicates frag
456 * sequence, 7 last_frag indicates last frag
457 */
458 u8 lro;
459
460 /* chained buffers */
461 u8 nr_frags;
462 };
463 };
464 struct {
465 __le16 frag_handles[4];
466 };
467 };
452} __attribute__ ((aligned(16))); 468} __attribute__ ((aligned(16)));
453 469
454enum { 470enum {
@@ -774,6 +790,7 @@ struct netxen_cmd_buffer {
774 790
775/* In rx_buffer, we do not need multiple fragments as is a single buffer */ 791/* In rx_buffer, we do not need multiple fragments as is a single buffer */
776struct netxen_rx_buffer { 792struct netxen_rx_buffer {
793 struct list_head list;
777 struct sk_buff *skb; 794 struct sk_buff *skb;
778 u64 dma; 795 u64 dma;
779 u16 ref_handle; 796 u16 ref_handle;
@@ -854,6 +871,7 @@ struct nx_host_rds_ring {
854 u32 dma_size; 871 u32 dma_size;
855 u32 skb_size; 872 u32 skb_size;
856 struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ 873 struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */
874 struct list_head free_list;
857 int begin_alloc; 875 int begin_alloc;
858}; 876};
859 877