Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159327
b: refs/heads/master
c: ff67df5
h: refs/heads/master
i:
  159325: 1d302de
  159323: f6bb7c2
  159319: 30cb932
  159311: 1a0ca14
  159295: 3a34d69
v: v3
  • Loading branch information
Benjamin LaHaise authored and David S. Miller committed Aug 5, 2009
1 parent 0882b31 commit da85d4c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 33 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: 4403b371888d5947ed08200ee6351441a188a5c7
refs/heads/master: ff67df55f6bde9de5e508bf1f09509c843accd54
7 changes: 5 additions & 2 deletions trunk/drivers/net/vxge/vxge-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,9 @@ struct __vxge_hw_fifo {
void *txdlh,
enum vxge_hw_fifo_tcode t_code,
void *userdata,
void **skb_ptr);
struct sk_buff ***skb_ptr,
int nr_skb,
int *more);

void (*txdl_term)(
void *txdlh,
Expand Down Expand Up @@ -1779,7 +1781,8 @@ struct vxge_hw_fifo_attr {
void *txdlh,
enum vxge_hw_fifo_tcode t_code,
void *userdata,
void **skb_ptr);
struct sk_buff ***skb_ptr,
int nr_skb, int *more);

void (*txdl_term)(
void *txdlh,
Expand Down
53 changes: 28 additions & 25 deletions trunk/drivers/net/vxge/vxge-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,25 @@ static inline int is_vxge_card_up(struct vxgedev *vdev)
static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo)
{
unsigned long flags = 0;
struct sk_buff *skb_ptr = NULL;
struct sk_buff **temp, *head, *skb;

if (spin_trylock_irqsave(&fifo->tx_lock, flags)) {
vxge_hw_vpath_poll_tx(fifo->handle, (void **)&skb_ptr);
spin_unlock_irqrestore(&fifo->tx_lock, flags);
}
/* free SKBs */
head = skb_ptr;
while (head) {
skb = head;
temp = (struct sk_buff **)&skb->cb;
head = *temp;
*temp = NULL;
dev_kfree_skb_irq(skb);
}
struct sk_buff **skb_ptr = NULL;
struct sk_buff **temp;
#define NR_SKB_COMPLETED 128
struct sk_buff *completed[NR_SKB_COMPLETED];
int more;

do {
more = 0;
skb_ptr = completed;

if (spin_trylock_irqsave(&fifo->tx_lock, flags)) {
vxge_hw_vpath_poll_tx(fifo->handle, &skb_ptr,
NR_SKB_COMPLETED, &more);
spin_unlock_irqrestore(&fifo->tx_lock, flags);
}
/* free SKBs */
for (temp = completed; temp != skb_ptr; temp++)
dev_kfree_skb_irq(*temp);
} while (more) ;
}

static inline void VXGE_COMPLETE_ALL_TX(struct vxgedev *vdev)
Expand Down Expand Up @@ -600,11 +603,10 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
enum vxge_hw_status
vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
enum vxge_hw_fifo_tcode t_code, void *userdata,
void **skb_ptr)
struct sk_buff ***skb_ptr, int nr_skb, int *more)
{
struct vxge_fifo *fifo = (struct vxge_fifo *)userdata;
struct sk_buff *skb, *head = NULL;
struct sk_buff **temp;
struct sk_buff *skb, **done_skb = *skb_ptr;
int pkt_cnt = 0;

vxge_debug_entryexit(VXGE_TRACE,
Expand Down Expand Up @@ -657,9 +659,12 @@ vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
fifo->stats.tx_frms++;
fifo->stats.tx_bytes += skb->len;

temp = (struct sk_buff **)&skb->cb;
*temp = head;
head = skb;
*done_skb++ = skb;

if (--nr_skb <= 0) {
*more = 1;
break;
}

pkt_cnt++;
if (pkt_cnt > fifo->indicate_max_pkts)
Expand All @@ -668,11 +673,9 @@ vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
} while (vxge_hw_fifo_txdl_next_completed(fifo_hw,
&dtr, &t_code) == VXGE_HW_OK);

*skb_ptr = done_skb;
vxge_wake_tx_queue(fifo, skb);

if (skb_ptr)
*skb_ptr = (void *) head;

vxge_debug_entryexit(VXGE_TRACE,
"%s: %s:%d Exiting...",
fifo->ndev->name, __func__, __LINE__);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/vxge/vxge-main.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,

enum vxge_hw_status
vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
enum vxge_hw_fifo_tcode t_code, void *userdata, void **skb_ptr);
enum vxge_hw_fifo_tcode t_code, void *userdata,
struct sk_buff ***skb_ptr, int nr_skbs, int *more);

int vxge_close(struct net_device *dev);

Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/net/vxge/vxge-traffic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,8 @@ enum vxge_hw_status vxge_hw_vpath_poll_rx(struct __vxge_hw_ring *ring)
* See also: vxge_hw_vpath_poll_tx().
*/
enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo,
void **skb_ptr)
struct sk_buff ***skb_ptr, int nr_skb,
int *more)
{
enum vxge_hw_fifo_tcode t_code;
void *first_txdlh;
Expand All @@ -2520,8 +2521,8 @@ enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo,
status = vxge_hw_fifo_txdl_next_completed(fifo,
&first_txdlh, &t_code);
if (status == VXGE_HW_OK)
if (fifo->callback(fifo, first_txdlh,
t_code, channel->userdata, skb_ptr) != VXGE_HW_OK)
if (fifo->callback(fifo, first_txdlh, t_code,
channel->userdata, skb_ptr, nr_skb, more) != VXGE_HW_OK)
status = VXGE_HW_COMPLETIONS_REMAIN;

return status;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/vxge/vxge-traffic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2326,7 +2326,7 @@ enum vxge_hw_status vxge_hw_vpath_poll_rx(

enum vxge_hw_status vxge_hw_vpath_poll_tx(
struct __vxge_hw_fifo *fifoh,
void **skb_ptr);
struct sk_buff ***skb_ptr, int nr_skb, int *more);

enum vxge_hw_status vxge_hw_vpath_alarm_process(
struct __vxge_hw_vpath_handle *vpath_handle,
Expand Down

0 comments on commit da85d4c

Please sign in to comment.