Skip to content

Commit

Permalink
r8169: use Giant Send
Browse files Browse the repository at this point in the history
Replace large send with giant send for TSO for RTL8111C and later ICs.
The large send setting of the RTL8111DP is different from the other
chips. However, the giant send setting is the same for all the chips
which support it. Use the giant send to synchronize the settings.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
hayeswang authored and David S. Miller committed Jul 11, 2014
1 parent 5888d3f commit bdfa4ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,10 @@ enum rtl_tx_desc_bit_0 {

/* 8102e, 8168c and beyond. */
enum rtl_tx_desc_bit_1 {
/* First doubleword. */
TD1_GTSENV4 = (1 << 26), /* Giant Send for IPv4 */
#define GTTCPHO_SHIFT 18

/* Second doubleword. */
#define TD1_MSS_SHIFT 18 /* MSS position (11 bits) */
TD1_IP_CS = (1 << 29), /* Calculate IP checksum */
Expand Down Expand Up @@ -5941,10 +5945,12 @@ static bool rtl8169_tso_csum_v1(struct rtl8169_private *tp,
static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
struct sk_buff *skb, u32 *opts)
{
u32 transport_offset = (u32)skb_transport_offset(skb);
u32 mss = skb_shinfo(skb)->gso_size;

if (mss) {
opts[0] |= TD_LSO;
opts[0] |= TD1_GTSENV4;
opts[0] |= transport_offset << GTTCPHO_SHIFT;
opts[1] |= min(mss, TD_MSS_MAX) << TD1_MSS_SHIFT;
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
const struct iphdr *ip = ip_hdr(skb);
Expand Down

0 comments on commit bdfa4ed

Please sign in to comment.