Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108401
b: refs/heads/master
c: df0f234
h: refs/heads/master
i:
  108399: 732ecfe
v: v3
  • Loading branch information
Vladislav Zolotarov authored and David S. Miller committed Aug 13, 2008
1 parent 56c7064 commit d849cee
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 29 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: 353029896a5ed6cf42f4ce45729851b23c94d874
refs/heads/master: df0f23439a69eb5ca30668612f1c4e20041b5341
67 changes: 39 additions & 28 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8272,33 +8272,6 @@ static int bnx2x_set_coalesce(struct net_device *dev,
return 0;
}

static int bnx2x_set_flags(struct net_device *dev, u32 data)
{
struct bnx2x *bp = netdev_priv(dev);
int changed = 0;
int rc = 0;

if (data & ETH_FLAG_LRO) {
if (!(dev->features & NETIF_F_LRO)) {
dev->features |= NETIF_F_LRO;
bp->flags |= TPA_ENABLE_FLAG;
changed = 1;
}

} else if (dev->features & NETIF_F_LRO) {
dev->features &= ~NETIF_F_LRO;
bp->flags &= ~TPA_ENABLE_FLAG;
changed = 1;
}

if (changed && netif_running(dev)) {
bnx2x_nic_unload(bp, UNLOAD_NORMAL);
rc = bnx2x_nic_load(bp, LOAD_NORMAL);
}

return rc;
}

static void bnx2x_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
{
Expand Down Expand Up @@ -8400,6 +8373,34 @@ static int bnx2x_set_pauseparam(struct net_device *dev,
return 0;
}

static int bnx2x_set_flags(struct net_device *dev, u32 data)
{
struct bnx2x *bp = netdev_priv(dev);
int changed = 0;
int rc = 0;

/* TPA requires Rx CSUM offloading */
if ((data & ETH_FLAG_LRO) && bp->rx_csum) {
if (!(dev->features & NETIF_F_LRO)) {
dev->features |= NETIF_F_LRO;
bp->flags |= TPA_ENABLE_FLAG;
changed = 1;
}

} else if (dev->features & NETIF_F_LRO) {
dev->features &= ~NETIF_F_LRO;
bp->flags &= ~TPA_ENABLE_FLAG;
changed = 1;
}

if (changed && netif_running(dev)) {
bnx2x_nic_unload(bp, UNLOAD_NORMAL);
rc = bnx2x_nic_load(bp, LOAD_NORMAL);
}

return rc;
}

static u32 bnx2x_get_rx_csum(struct net_device *dev)
{
struct bnx2x *bp = netdev_priv(dev);
Expand All @@ -8410,9 +8411,19 @@ static u32 bnx2x_get_rx_csum(struct net_device *dev)
static int bnx2x_set_rx_csum(struct net_device *dev, u32 data)
{
struct bnx2x *bp = netdev_priv(dev);
int rc = 0;

bp->rx_csum = data;
return 0;

/* Disable TPA, when Rx CSUM is disabled. Otherwise all
TPA'ed packets will be discarded due to wrong TCP CSUM */
if (!data) {
u32 flags = ethtool_op_get_flags(dev);

rc = bnx2x_set_flags(dev, (flags & ~ETH_FLAG_LRO));
}

return rc;
}

static int bnx2x_set_tso(struct net_device *dev, u32 data)
Expand Down

0 comments on commit d849cee

Please sign in to comment.