Skip to content

Commit

Permalink
net:ethernet:aquantia: Fix for LSO with IPv6.
Browse files Browse the repository at this point in the history
Fix Context Command bit: L3 type = "0" for IPv4, "1" for IPv6.

Fixes: bab6de8 ("net: ethernet: aquantia:
 Atlantic A0 and B0 specific functions.")

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Belous authored and David S. Miller committed Mar 24, 2017
1 parent 9f0dd8c commit 386aff8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/aquantia/atlantic/aq_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
dx_buff->mss = skb_shinfo(skb)->gso_size;
dx_buff->is_txc = 1U;

dx_buff->is_ipv6 =
(ip_hdr(skb)->version == 6) ? 1U : 0U;

dx = aq_ring_next_dx(ring, dx);
dx_buff = &ring->buff_ring[dx];
++ret;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/aquantia/atlantic/aq_ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ struct __packed aq_ring_buff_s {
u8 len_l2;
u8 len_l3;
u8 len_l4;
u8 rsvd2;
u8 is_ipv6:1;
u8 rsvd2:7;
u32 len_pkt;
};
};
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@ static int hw_atl_a0_hw_ring_tx_xmit(struct aq_hw_s *self,
buff->len_l3 +
buff->len_l2);
is_gso = true;

if (buff->is_ipv6)
txd->ctl |= HW_ATL_A0_TXD_CTL_CMD_IPV6;
} else {
buff_pa_len = buff->len;

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self,
buff->len_l3 +
buff->len_l2);
is_gso = true;

if (buff->is_ipv6)
txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_IPV6;
} else {
buff_pa_len = buff->len;

Expand Down

0 comments on commit 386aff8

Please sign in to comment.