forked from Minki/linux
i40e/i40evf: Use u64 values instead of casting them in TSO function
Instead of casing u32 values to u64 it makes more sense to just start out with u64 values in the first place. This way we don't need to create a mess with all of the casts needed to populate a 64b value. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
a9c9a81f58
commit
03f9d6a59f
@ -2267,7 +2267,7 @@ out:
|
|||||||
static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
|
static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
|
||||||
u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
|
u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
|
||||||
{
|
{
|
||||||
u32 cd_cmd, cd_tso_len, cd_mss;
|
u64 cd_cmd, cd_tso_len, cd_mss;
|
||||||
struct ipv6hdr *ipv6h;
|
struct ipv6hdr *ipv6h;
|
||||||
struct tcphdr *tcph;
|
struct tcphdr *tcph;
|
||||||
struct iphdr *iph;
|
struct iphdr *iph;
|
||||||
@ -2309,10 +2309,9 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
|
|||||||
cd_cmd = I40E_TX_CTX_DESC_TSO;
|
cd_cmd = I40E_TX_CTX_DESC_TSO;
|
||||||
cd_tso_len = skb->len - *hdr_len;
|
cd_tso_len = skb->len - *hdr_len;
|
||||||
cd_mss = skb_shinfo(skb)->gso_size;
|
cd_mss = skb_shinfo(skb)->gso_size;
|
||||||
*cd_type_cmd_tso_mss |= ((u64)cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |
|
*cd_type_cmd_tso_mss |= (cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |
|
||||||
((u64)cd_tso_len <<
|
(cd_tso_len << I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |
|
||||||
I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |
|
(cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);
|
||||||
((u64)cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1527,7 +1527,7 @@ out:
|
|||||||
static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
|
static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
|
||||||
u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
|
u8 *hdr_len, u64 *cd_type_cmd_tso_mss)
|
||||||
{
|
{
|
||||||
u32 cd_cmd, cd_tso_len, cd_mss;
|
u64 cd_cmd, cd_tso_len, cd_mss;
|
||||||
struct ipv6hdr *ipv6h;
|
struct ipv6hdr *ipv6h;
|
||||||
struct tcphdr *tcph;
|
struct tcphdr *tcph;
|
||||||
struct iphdr *iph;
|
struct iphdr *iph;
|
||||||
@ -1569,10 +1569,9 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
|
|||||||
cd_cmd = I40E_TX_CTX_DESC_TSO;
|
cd_cmd = I40E_TX_CTX_DESC_TSO;
|
||||||
cd_tso_len = skb->len - *hdr_len;
|
cd_tso_len = skb->len - *hdr_len;
|
||||||
cd_mss = skb_shinfo(skb)->gso_size;
|
cd_mss = skb_shinfo(skb)->gso_size;
|
||||||
*cd_type_cmd_tso_mss |= ((u64)cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |
|
*cd_type_cmd_tso_mss |= (cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |
|
||||||
((u64)cd_tso_len <<
|
(cd_tso_len << I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |
|
||||||
I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |
|
(cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);
|
||||||
((u64)cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user