diff options
author | Sreenivasa Honnur <Sreenivasa.Honnur@neterion.com> | 2008-04-28 21:08:45 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-29 01:55:30 -0400 |
commit | 0425b46a4beef234c522f183d5c2934edbb0f625 (patch) | |
tree | 429f3eca8dde628cd6d4b9ceca421222445c9adf /drivers/net/s2io.h | |
parent | dfd44151e8888b964b7f2400f26794154a58c86b (diff) |
S2io: Enable multi ring support
- Seperate ring specific data
- Initialize all configured rings with equal priority.
- Updated boundary check for number of Rings.
- Updated per ring statistics of rx_bytes and rx_packets.
- Moved lro struct from struct s2io_nic to struct ring_info.
- Access respective rx ring directly in fill_rx_buffers.
- Moved rx_bufs_left struct s2io_nic to struct ring_info.
- Added per ring variables - rxd_mode, rxd_count, dev, pdev.
Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/s2io.h')
-rw-r--r-- | drivers/net/s2io.h | 82 |
1 files changed, 53 insertions, 29 deletions
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index ce53a02105f2..0709ebae9139 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -678,11 +678,53 @@ struct rx_block_info { | |||
678 | struct rxd_info *rxds; | 678 | struct rxd_info *rxds; |
679 | }; | 679 | }; |
680 | 680 | ||
681 | /* Data structure to represent a LRO session */ | ||
682 | struct lro { | ||
683 | struct sk_buff *parent; | ||
684 | struct sk_buff *last_frag; | ||
685 | u8 *l2h; | ||
686 | struct iphdr *iph; | ||
687 | struct tcphdr *tcph; | ||
688 | u32 tcp_next_seq; | ||
689 | __be32 tcp_ack; | ||
690 | int total_len; | ||
691 | int frags_len; | ||
692 | int sg_num; | ||
693 | int in_use; | ||
694 | __be16 window; | ||
695 | u16 vlan_tag; | ||
696 | u32 cur_tsval; | ||
697 | __be32 cur_tsecr; | ||
698 | u8 saw_ts; | ||
699 | } ____cacheline_aligned; | ||
700 | |||
681 | /* Ring specific structure */ | 701 | /* Ring specific structure */ |
682 | struct ring_info { | 702 | struct ring_info { |
683 | /* The ring number */ | 703 | /* The ring number */ |
684 | int ring_no; | 704 | int ring_no; |
685 | 705 | ||
706 | /* per-ring buffer counter */ | ||
707 | u32 rx_bufs_left; | ||
708 | |||
709 | #define MAX_LRO_SESSIONS 32 | ||
710 | struct lro lro0_n[MAX_LRO_SESSIONS]; | ||
711 | u8 lro; | ||
712 | |||
713 | /* copy of sp->rxd_mode flag */ | ||
714 | int rxd_mode; | ||
715 | |||
716 | /* Number of rxds per block for the rxd_mode */ | ||
717 | int rxd_count; | ||
718 | |||
719 | /* copy of sp pointer */ | ||
720 | struct s2io_nic *nic; | ||
721 | |||
722 | /* copy of sp->dev pointer */ | ||
723 | struct net_device *dev; | ||
724 | |||
725 | /* copy of sp->pdev pointer */ | ||
726 | struct pci_dev *pdev; | ||
727 | |||
686 | /* | 728 | /* |
687 | * Place holders for the virtual and physical addresses of | 729 | * Place holders for the virtual and physical addresses of |
688 | * all the Rx Blocks | 730 | * all the Rx Blocks |
@@ -703,10 +745,16 @@ struct ring_info { | |||
703 | */ | 745 | */ |
704 | struct rx_curr_get_info rx_curr_get_info; | 746 | struct rx_curr_get_info rx_curr_get_info; |
705 | 747 | ||
748 | /* interface MTU value */ | ||
749 | unsigned mtu; | ||
750 | |||
706 | /* Buffer Address store. */ | 751 | /* Buffer Address store. */ |
707 | struct buffAdd **ba; | 752 | struct buffAdd **ba; |
708 | struct s2io_nic *nic; | 753 | |
709 | }; | 754 | /* per-Ring statistics */ |
755 | unsigned long rx_packets; | ||
756 | unsigned long rx_bytes; | ||
757 | } ____cacheline_aligned; | ||
710 | 758 | ||
711 | /* Fifo specific structure */ | 759 | /* Fifo specific structure */ |
712 | struct fifo_info { | 760 | struct fifo_info { |
@@ -813,26 +861,6 @@ struct msix_info_st { | |||
813 | u64 data; | 861 | u64 data; |
814 | }; | 862 | }; |
815 | 863 | ||
816 | /* Data structure to represent a LRO session */ | ||
817 | struct lro { | ||
818 | struct sk_buff *parent; | ||
819 | struct sk_buff *last_frag; | ||
820 | u8 *l2h; | ||
821 | struct iphdr *iph; | ||
822 | struct tcphdr *tcph; | ||
823 | u32 tcp_next_seq; | ||
824 | __be32 tcp_ack; | ||
825 | int total_len; | ||
826 | int frags_len; | ||
827 | int sg_num; | ||
828 | int in_use; | ||
829 | __be16 window; | ||
830 | u16 vlan_tag; | ||
831 | u32 cur_tsval; | ||
832 | __be32 cur_tsecr; | ||
833 | u8 saw_ts; | ||
834 | } ____cacheline_aligned; | ||
835 | |||
836 | /* These flags represent the devices temporary state */ | 864 | /* These flags represent the devices temporary state */ |
837 | enum s2io_device_state_t | 865 | enum s2io_device_state_t |
838 | { | 866 | { |
@@ -872,8 +900,6 @@ struct s2io_nic { | |||
872 | /* Space to back up the PCI config space */ | 900 | /* Space to back up the PCI config space */ |
873 | u32 config_space[256 / sizeof(u32)]; | 901 | u32 config_space[256 / sizeof(u32)]; |
874 | 902 | ||
875 | atomic_t rx_bufs_left[MAX_RX_RINGS]; | ||
876 | |||
877 | #define PROMISC 1 | 903 | #define PROMISC 1 |
878 | #define ALL_MULTI 2 | 904 | #define ALL_MULTI 2 |
879 | 905 | ||
@@ -950,8 +976,6 @@ struct s2io_nic { | |||
950 | #define XFRAME_II_DEVICE 2 | 976 | #define XFRAME_II_DEVICE 2 |
951 | u8 device_type; | 977 | u8 device_type; |
952 | 978 | ||
953 | #define MAX_LRO_SESSIONS 32 | ||
954 | struct lro lro0_n[MAX_LRO_SESSIONS]; | ||
955 | unsigned long clubbed_frms_cnt; | 979 | unsigned long clubbed_frms_cnt; |
956 | unsigned long sending_both; | 980 | unsigned long sending_both; |
957 | u8 lro; | 981 | u8 lro; |
@@ -1118,9 +1142,9 @@ static int do_s2io_add_mc(struct s2io_nic *sp, u8 *addr); | |||
1118 | static int do_s2io_add_mac(struct s2io_nic *sp, u64 addr, int offset); | 1142 | static int do_s2io_add_mac(struct s2io_nic *sp, u64 addr, int offset); |
1119 | static int do_s2io_delete_unicast_mc(struct s2io_nic *sp, u64 addr); | 1143 | static int do_s2io_delete_unicast_mc(struct s2io_nic *sp, u64 addr); |
1120 | 1144 | ||
1121 | static int | 1145 | static int s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, |
1122 | s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro, | 1146 | u8 **tcp, u32 *tcp_len, struct lro **lro, struct RxD_t *rxdp, |
1123 | struct RxD_t *rxdp, struct s2io_nic *sp); | 1147 | struct s2io_nic *sp); |
1124 | static void clear_lro_session(struct lro *lro); | 1148 | static void clear_lro_session(struct lro *lro); |
1125 | static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag); | 1149 | static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag); |
1126 | static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro); | 1150 | static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro); |