Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194565
b: refs/heads/master
c: 87b6cf5
h: refs/heads/master
i:
  194563: 50952b5
v: v3
  • Loading branch information
Dimitris Michailidis authored and David S. Miller committed Apr 27, 2010
1 parent 3f37524 commit 89a9dbd
Show file tree
Hide file tree
Showing 4 changed files with 22 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: 8cd9b13207f9a38e4da2d69bba51eb8dcbe1ead9
refs/heads/master: 87b6cf51acb4999fff7e6841986874b108679cb4
15 changes: 14 additions & 1 deletion trunk/drivers/net/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,18 @@ static int set_tso(struct net_device *dev, u32 value)
return 0;
}

static int set_flags(struct net_device *dev, u32 flags)
{
if (flags & ~ETH_FLAG_RXHASH)
return -EOPNOTSUPP;

if (flags & ETH_FLAG_RXHASH)
dev->features |= NETIF_F_RXHASH;
else
dev->features &= ~NETIF_F_RXHASH;
return 0;
}

static struct ethtool_ops cxgb_ethtool_ops = {
.get_settings = get_settings,
.set_settings = set_settings,
Expand Down Expand Up @@ -1741,6 +1753,7 @@ static struct ethtool_ops cxgb_ethtool_ops = {
.get_wol = get_wol,
.set_wol = set_wol,
.set_tso = set_tso,
.set_flags = set_flags,
.flash_device = set_flash,
};

Expand Down Expand Up @@ -3203,7 +3216,7 @@ static int __devinit init_one(struct pci_dev *pdev,

netdev->features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6;
netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
netdev->features |= NETIF_F_GRO | highdma;
netdev->features |= NETIF_F_GRO | NETIF_F_RXHASH | highdma;
netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
netdev->vlan_features = netdev->features & VLAN_FEAT;

Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/net/cxgb4/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,8 @@ static void do_gro(struct sge_eth_rxq *rxq, const struct pkt_gl *gl,
skb->truesize += skb->data_len;
skb->ip_summed = CHECKSUM_UNNECESSARY;
skb_record_rx_queue(skb, rxq->rspq.idx);
if (rxq->rspq.netdev->features & NETIF_F_RXHASH)
skb->rxhash = (__force u32)pkt->rsshdr.hash_val;

if (unlikely(pkt->vlan_ex)) {
struct port_info *pi = netdev_priv(rxq->rspq.netdev);
Expand Down Expand Up @@ -1565,7 +1567,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
if (unlikely(*(u8 *)rsp == CPL_TRACE_PKT))
return handle_trace_pkt(q->adap, si);

pkt = (void *)&rsp[1];
pkt = (const struct cpl_rx_pkt *)rsp;
csum_ok = pkt->csum_calc && !pkt->err_vec;
if ((pkt->l2info & htonl(RXF_TCP)) &&
(q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) {
Expand All @@ -1583,6 +1585,9 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
__skb_pull(skb, RX_PKT_PAD); /* remove ethernet header padding */
skb->protocol = eth_type_trans(skb, q->netdev);
skb_record_rx_queue(skb, q->idx);
if (skb->dev->features & NETIF_F_RXHASH)
skb->rxhash = (__force u32)pkt->rsshdr.hash_val;

pi = netdev_priv(skb->dev);
rxq->stats.pkts++;

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/cxgb4/t4_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ struct cpl_rx_data_ack {
};

struct cpl_rx_pkt {
struct rss_header rsshdr;
u8 opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
u8 iff:4;
Expand Down

0 comments on commit 89a9dbd

Please sign in to comment.