diff options
author | David S. Miller <davem@davemloft.net> | 2011-04-11 16:44:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-11 16:44:25 -0400 |
commit | 1c01a80cfec6f806246f31ff2680cd3639b30e67 (patch) | |
tree | 0b554aad2ec1da71ecf6339d4ba51617bfe1dc3c /drivers/net/netxen | |
parent | c44d79950b2daa1025e62eede73e4e4a274d1ef3 (diff) | |
parent | 4a9f65f6304a00f6473e83b19c1e83caa1e42530 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/smsc911x.c
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 4 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hdr.h | 2 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 17 |
3 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 15595b3a54c6..77220687b92a 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -174,7 +174,7 @@ | |||
174 | 174 | ||
175 | #define MAX_NUM_CARDS 4 | 175 | #define MAX_NUM_CARDS 4 |
176 | 176 | ||
177 | #define MAX_BUFFERS_PER_CMD 32 | 177 | #define NETXEN_MAX_FRAGS_PER_TX 14 |
178 | #define MAX_TSO_HEADER_DESC 2 | 178 | #define MAX_TSO_HEADER_DESC 2 |
179 | #define MGMT_CMD_DESC_RESV 4 | 179 | #define MGMT_CMD_DESC_RESV 4 |
180 | #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ | 180 | #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ |
@@ -558,7 +558,7 @@ struct netxen_recv_crb { | |||
558 | */ | 558 | */ |
559 | struct netxen_cmd_buffer { | 559 | struct netxen_cmd_buffer { |
560 | struct sk_buff *skb; | 560 | struct sk_buff *skb; |
561 | struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; | 561 | struct netxen_skb_frag frag_array[MAX_SKB_FRAGS + 1]; |
562 | u32 frag_count; | 562 | u32 frag_count; |
563 | }; | 563 | }; |
564 | 564 | ||
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index d8bd73d7e296..dc1967c1f312 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -780,7 +780,7 @@ enum { | |||
780 | 780 | ||
781 | /* | 781 | /* |
782 | * capabilities register, can be used to selectively enable/disable features | 782 | * capabilities register, can be used to selectively enable/disable features |
783 | * for backward compability | 783 | * for backward compatibility |
784 | */ | 784 | */ |
785 | #define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) | 785 | #define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) |
786 | #define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270) | 786 | #define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270) |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 201b944bd463..b644383017f9 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -1877,6 +1877,8 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1877 | struct cmd_desc_type0 *hwdesc, *first_desc; | 1877 | struct cmd_desc_type0 *hwdesc, *first_desc; |
1878 | struct pci_dev *pdev; | 1878 | struct pci_dev *pdev; |
1879 | int i, k; | 1879 | int i, k; |
1880 | int delta = 0; | ||
1881 | struct skb_frag_struct *frag; | ||
1880 | 1882 | ||
1881 | u32 producer; | 1883 | u32 producer; |
1882 | int frag_count, no_of_desc; | 1884 | int frag_count, no_of_desc; |
@@ -1884,6 +1886,21 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1884 | 1886 | ||
1885 | frag_count = skb_shinfo(skb)->nr_frags + 1; | 1887 | frag_count = skb_shinfo(skb)->nr_frags + 1; |
1886 | 1888 | ||
1889 | /* 14 frags supported for normal packet and | ||
1890 | * 32 frags supported for TSO packet | ||
1891 | */ | ||
1892 | if (!skb_is_gso(skb) && frag_count > NETXEN_MAX_FRAGS_PER_TX) { | ||
1893 | |||
1894 | for (i = 0; i < (frag_count - NETXEN_MAX_FRAGS_PER_TX); i++) { | ||
1895 | frag = &skb_shinfo(skb)->frags[i]; | ||
1896 | delta += frag->size; | ||
1897 | } | ||
1898 | |||
1899 | if (!__pskb_pull_tail(skb, delta)) | ||
1900 | goto drop_packet; | ||
1901 | |||
1902 | frag_count = 1 + skb_shinfo(skb)->nr_frags; | ||
1903 | } | ||
1887 | /* 4 fragments per cmd des */ | 1904 | /* 4 fragments per cmd des */ |
1888 | no_of_desc = (frag_count + 3) >> 2; | 1905 | no_of_desc = (frag_count + 3) >> 2; |
1889 | 1906 | ||