ionic: expand the descriptor bufs array
authorShannon Nelson <shannon.nelson@amd.com>
Mon, 18 Sep 2023 22:21:36 +0000 (15:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Sep 2023 09:52:31 +0000 (10:52 +0100)
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>
drivers/net/ethernet/pensando/ionic/ionic_dev.h

index 6aac98bcb9f4b9f2e16503acc28590ce598779f4..b51febf86504f6ac3cb294253df8d9f64bd113d5 100644 (file)
@@ -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"
@@ -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;
 };