mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-17 03:58:36 +00:00
Merge branch 'netvsc-RSS-related-patches'
Stephen Hemminger says: ==================== netvsc: RSS related patches Address a couple of issues related to recording RSS hash value in skb. These were found by reviewing RSS support. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
b8fed591df
3 changed files with 15 additions and 5 deletions
|
@ -853,6 +853,7 @@ struct multi_recv_comp {
|
||||||
struct nvsc_rsc {
|
struct nvsc_rsc {
|
||||||
const struct ndis_pkt_8021q_info *vlan;
|
const struct ndis_pkt_8021q_info *vlan;
|
||||||
const struct ndis_tcp_ip_checksum_info *csum_info;
|
const struct ndis_tcp_ip_checksum_info *csum_info;
|
||||||
|
const u32 *hash_info;
|
||||||
u8 is_last; /* last RNDIS msg in a vmtransfer_page */
|
u8 is_last; /* last RNDIS msg in a vmtransfer_page */
|
||||||
u32 cnt; /* #fragments in an RSC packet */
|
u32 cnt; /* #fragments in an RSC packet */
|
||||||
u32 pktlen; /* Full packet length */
|
u32 pktlen; /* Full packet length */
|
||||||
|
|
|
@ -285,9 +285,9 @@ static inline u32 netvsc_get_hash(
|
||||||
else if (flow.basic.n_proto == htons(ETH_P_IPV6))
|
else if (flow.basic.n_proto == htons(ETH_P_IPV6))
|
||||||
hash = jhash2((u32 *)&flow.addrs.v6addrs, 8, hashrnd);
|
hash = jhash2((u32 *)&flow.addrs.v6addrs, 8, hashrnd);
|
||||||
else
|
else
|
||||||
hash = 0;
|
return 0;
|
||||||
|
|
||||||
skb_set_hash(skb, hash, PKT_HASH_TYPE_L3);
|
__skb_set_sw_hash(skb, hash, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
|
@ -766,6 +766,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
|
||||||
const struct ndis_pkt_8021q_info *vlan = nvchan->rsc.vlan;
|
const struct ndis_pkt_8021q_info *vlan = nvchan->rsc.vlan;
|
||||||
const struct ndis_tcp_ip_checksum_info *csum_info =
|
const struct ndis_tcp_ip_checksum_info *csum_info =
|
||||||
nvchan->rsc.csum_info;
|
nvchan->rsc.csum_info;
|
||||||
|
const u32 *hash_info = nvchan->rsc.hash_info;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -795,14 +796,16 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
|
||||||
skb->protocol == htons(ETH_P_IP))
|
skb->protocol == htons(ETH_P_IP))
|
||||||
netvsc_comp_ipcsum(skb);
|
netvsc_comp_ipcsum(skb);
|
||||||
|
|
||||||
/* Do L4 checksum offload if enabled and present.
|
/* Do L4 checksum offload if enabled and present. */
|
||||||
*/
|
|
||||||
if (csum_info && (net->features & NETIF_F_RXCSUM)) {
|
if (csum_info && (net->features & NETIF_F_RXCSUM)) {
|
||||||
if (csum_info->receive.tcp_checksum_succeeded ||
|
if (csum_info->receive.tcp_checksum_succeeded ||
|
||||||
csum_info->receive.udp_checksum_succeeded)
|
csum_info->receive.udp_checksum_succeeded)
|
||||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hash_info)
|
||||||
|
skb_set_hash(skb, *hash_info, PKT_HASH_TYPE_L4);
|
||||||
|
|
||||||
if (vlan) {
|
if (vlan) {
|
||||||
u16 vlan_tci = vlan->vlanid | (vlan->pri << VLAN_PRIO_SHIFT) |
|
u16 vlan_tci = vlan->vlanid | (vlan->pri << VLAN_PRIO_SHIFT) |
|
||||||
(vlan->cfi ? VLAN_CFI_MASK : 0);
|
(vlan->cfi ? VLAN_CFI_MASK : 0);
|
||||||
|
|
|
@ -358,6 +358,7 @@ static inline
|
||||||
void rsc_add_data(struct netvsc_channel *nvchan,
|
void rsc_add_data(struct netvsc_channel *nvchan,
|
||||||
const struct ndis_pkt_8021q_info *vlan,
|
const struct ndis_pkt_8021q_info *vlan,
|
||||||
const struct ndis_tcp_ip_checksum_info *csum_info,
|
const struct ndis_tcp_ip_checksum_info *csum_info,
|
||||||
|
const u32 *hash_info,
|
||||||
void *data, u32 len)
|
void *data, u32 len)
|
||||||
{
|
{
|
||||||
u32 cnt = nvchan->rsc.cnt;
|
u32 cnt = nvchan->rsc.cnt;
|
||||||
|
@ -368,6 +369,7 @@ void rsc_add_data(struct netvsc_channel *nvchan,
|
||||||
nvchan->rsc.vlan = vlan;
|
nvchan->rsc.vlan = vlan;
|
||||||
nvchan->rsc.csum_info = csum_info;
|
nvchan->rsc.csum_info = csum_info;
|
||||||
nvchan->rsc.pktlen = len;
|
nvchan->rsc.pktlen = len;
|
||||||
|
nvchan->rsc.hash_info = hash_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
nvchan->rsc.data[cnt] = data;
|
nvchan->rsc.data[cnt] = data;
|
||||||
|
@ -385,6 +387,7 @@ static int rndis_filter_receive_data(struct net_device *ndev,
|
||||||
const struct ndis_tcp_ip_checksum_info *csum_info;
|
const struct ndis_tcp_ip_checksum_info *csum_info;
|
||||||
const struct ndis_pkt_8021q_info *vlan;
|
const struct ndis_pkt_8021q_info *vlan;
|
||||||
const struct rndis_pktinfo_id *pktinfo_id;
|
const struct rndis_pktinfo_id *pktinfo_id;
|
||||||
|
const u32 *hash_info;
|
||||||
u32 data_offset;
|
u32 data_offset;
|
||||||
void *data;
|
void *data;
|
||||||
bool rsc_more = false;
|
bool rsc_more = false;
|
||||||
|
@ -411,6 +414,8 @@ static int rndis_filter_receive_data(struct net_device *ndev,
|
||||||
|
|
||||||
csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO, 0);
|
csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO, 0);
|
||||||
|
|
||||||
|
hash_info = rndis_get_ppi(rndis_pkt, NBL_HASH_VALUE, 0);
|
||||||
|
|
||||||
pktinfo_id = rndis_get_ppi(rndis_pkt, RNDIS_PKTINFO_ID, 1);
|
pktinfo_id = rndis_get_ppi(rndis_pkt, RNDIS_PKTINFO_ID, 1);
|
||||||
|
|
||||||
data = (void *)msg + data_offset;
|
data = (void *)msg + data_offset;
|
||||||
|
@ -441,7 +446,8 @@ static int rndis_filter_receive_data(struct net_device *ndev,
|
||||||
* rndis_pkt->data_len tell us the real data length, we only copy
|
* rndis_pkt->data_len tell us the real data length, we only copy
|
||||||
* the data packet to the stack, without the rndis trailer padding
|
* the data packet to the stack, without the rndis trailer padding
|
||||||
*/
|
*/
|
||||||
rsc_add_data(nvchan, vlan, csum_info, data, rndis_pkt->data_len);
|
rsc_add_data(nvchan, vlan, csum_info, hash_info,
|
||||||
|
data, rndis_pkt->data_len);
|
||||||
|
|
||||||
if (rsc_more)
|
if (rsc_more)
|
||||||
return NVSP_STAT_SUCCESS;
|
return NVSP_STAT_SUCCESS;
|
||||||
|
|
Loading…
Add table
Reference in a new issue