Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200868
b: refs/heads/master
c: 9b2c2ff
h: refs/heads/master
v: v3
  • Loading branch information
Saeed Bishara authored and David S. Miller committed Jun 30, 2010
1 parent 1281b8f commit 11df358
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08e554b17bfdc2682599c8c2770b088a0187a405
refs/heads/master: 9b2c2ff7a1c04e69842254dd4afe0f8ad4efa439
9 changes: 7 additions & 2 deletions trunk/drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ struct mv643xx_eth_shared_private {
unsigned int t_clk;
int extended_rx_coal_limit;
int tx_bw_control;
int tx_csum_limit;
};

#define TX_BW_CONTROL_ABSENT 0
Expand Down Expand Up @@ -776,13 +777,16 @@ static int txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb)
l4i_chk = 0;

if (skb->ip_summed == CHECKSUM_PARTIAL) {
int hdr_len;
int tag_bytes;

BUG_ON(skb->protocol != htons(ETH_P_IP) &&
skb->protocol != htons(ETH_P_8021Q));

tag_bytes = (void *)ip_hdr(skb) - (void *)skb->data - ETH_HLEN;
if (unlikely(tag_bytes & ~12)) {
hdr_len = (void *)ip_hdr(skb) - (void *)skb->data;
tag_bytes = hdr_len - ETH_HLEN;
if (skb->len - hdr_len > mp->shared->tx_csum_limit ||
unlikely(tag_bytes & ~12)) {
if (skb_checksum_help(skb) == 0)
goto no_csum;
kfree_skb(skb);
Expand Down Expand Up @@ -2666,6 +2670,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
* Detect hardware parameters.
*/
msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000;
msp->tx_csum_limit = pd->tx_csum_limit ? pd->tx_csum_limit : 9 * 1024;
infer_hw_params(msp);

platform_set_drvdata(pdev, msp);
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/mv643xx_eth.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ struct mv643xx_eth_shared_platform_data {
struct mbus_dram_target_info *dram;
struct platform_device *shared_smi;
unsigned int t_clk;
/*
* Max packet size for Tx IP/Layer 4 checksum, when set to 0, default
* limit of 9KiB will be used.
*/
int tx_csum_limit;
};

#define MV643XX_ETH_PHY_ADDR_DEFAULT 0
Expand Down

0 comments on commit 11df358

Please sign in to comment.