Skip to content

Commit

Permalink
ionic: expand the descriptor bufs array
Browse files Browse the repository at this point in the history
When processing a TSO we may have frags spread across several
descriptors, and the total count of frags in one skb may exceed
our per descriptor IONIC_MAX_FRAGS: this is fine as long as
each descriptor has fewer frags than the limit.  Since the skb
could have as many as MAX_SKB_FRAGS, and the first descriptor
is where we track and map the frag buffers, we need to be sure
we can map buffers for all of the frags plus the TSO header in
the first descriptor's buffer array.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Shannon Nelson authored and David S. Miller committed Sep 20, 2023
1 parent 40d8353 commit 529cdfd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/pensando/ionic/ionic_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/atomic.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include <linux/skbuff.h>

#include "ionic_if.h"
#include "ionic_regs.h"
Expand Down Expand Up @@ -216,7 +217,7 @@ struct ionic_desc_info {
};
unsigned int bytes;
unsigned int nbufs;
struct ionic_buf_info bufs[IONIC_MAX_FRAGS];
struct ionic_buf_info bufs[MAX_SKB_FRAGS + 1];
ionic_desc_cb cb;
void *cb_arg;
};
Expand Down

0 comments on commit 529cdfd

Please sign in to comment.