Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132548
b: refs/heads/master
c: ea1dae1
h: refs/heads/master
v: v3
  • Loading branch information
Sathya Perla authored and David S. Miller committed Mar 20, 2009
1 parent 8795463 commit 5064aac
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 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: 170ebf85160dd128e1c4206cc197cce7d1424705
refs/heads/master: ea1dae11e0baca5d633207fe50fc3cd30a5d68ee
1 change: 1 addition & 0 deletions trunk/drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ struct be_adapter {
struct be_eq_obj rx_eq;
struct be_rx_obj rx_obj;
u32 big_page_size; /* Compounded page size shared by rx wrbs */
bool rx_post_starved; /* Zero rx frags have been posted to BE */

struct vlan_group *vlan_grp;
u16 num_vlans;
Expand Down
50 changes: 29 additions & 21 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,26 +273,6 @@ static void be_rx_eqd_update(struct be_adapter *adapter)
rx_eq->cur_eqd = eqd;
}

static void be_worker(struct work_struct *work)
{
struct be_adapter *adapter =
container_of(work, struct be_adapter, work.work);
int status;

/* Check link */
be_link_status_update(adapter);

/* Get Stats */
status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
if (!status)
netdev_stats_update(adapter);

/* Set EQ delay */
be_rx_eqd_update(adapter);

schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
}

static struct net_device_stats *be_get_stats(struct net_device *dev)
{
struct be_adapter *adapter = netdev_priv(dev);
Expand Down Expand Up @@ -900,8 +880,11 @@ static void be_post_rx_frags(struct be_adapter *adapter)
page_info->last_page_user = true;

if (posted) {
be_rxq_notify(&adapter->ctrl, rxq->id, posted);
atomic_add(posted, &rxq->used);
be_rxq_notify(&adapter->ctrl, rxq->id, posted);
} else if (atomic_read(&rxq->used) == 0) {
/* Let be_worker replenish when memory is available */
adapter->rx_post_starved = true;
}

return;
Expand Down Expand Up @@ -1305,6 +1288,31 @@ int be_poll_tx(struct napi_struct *napi, int budget)
return 1;
}

static void be_worker(struct work_struct *work)
{
struct be_adapter *adapter =
container_of(work, struct be_adapter, work.work);
int status;

/* Check link */
be_link_status_update(adapter);

/* Get Stats */
status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
if (!status)
netdev_stats_update(adapter);

/* Set EQ delay */
be_rx_eqd_update(adapter);

if (adapter->rx_post_starved) {
adapter->rx_post_starved = false;
be_post_rx_frags(adapter);
}

schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
}

static void be_msix_enable(struct be_adapter *adapter)
{
int i, status;
Expand Down

0 comments on commit 5064aac

Please sign in to comment.