aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/pensando/ionic/ionic_dev.h
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2021-03-15 19:31:33 -0700
committerDavid S. Miller <davem@davemloft.net>2021-03-15 21:27:06 -0700
commit5b039241fe3a31b67fbffb07082c6d9d972204f8 (patch)
tree2f74b973187fed7c7bc2d72fdd61e34a84df3957 /drivers/net/ethernet/pensando/ionic/ionic_dev.h
parentMerge branch 'net-qualcomm-rmnet-stop-using-C-bit-fields' (diff)
downloadlinux-dev-5b039241fe3a31b67fbffb07082c6d9d972204f8.tar.xz
linux-dev-5b039241fe3a31b67fbffb07082c6d9d972204f8.zip
ionic: simplify TSO descriptor mapping
One issue with the original TSO code was that it was working too hard to deal with skb layouts that were never going to show up, such as an skb->data that was longer than a single descriptor's length. The other issue was trying to arrange the fragment dma mapping at the same time as figuring out the descriptors needed. There was just too much going on at the same time. Now we do the dma mapping first, which sets up the buffers with skb->data in buf[0] and the remaining frags in buf[1..n-1]. Next we spread the bufs across the descriptors needed, where each descriptor gets up to mss number of bytes. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic/ionic_dev.h')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_dev.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
index 339824cfd618..d0c969a6d43e 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
@@ -179,8 +179,11 @@ struct ionic_buf_info {
struct page *page;
dma_addr_t dma_addr;
u32 page_offset;
+ u32 len;
};
+#define IONIC_MAX_FRAGS (1 + IONIC_TX_MAX_SG_ELEMS_V1)
+
struct ionic_desc_info {
union {
void *desc;
@@ -194,7 +197,7 @@ struct ionic_desc_info {
struct ionic_rxq_sg_desc *rxq_sgl_desc;
};
unsigned int nbufs;
- struct ionic_buf_info bufs[IONIC_RX_MAX_SG_ELEMS + 1];
+ struct ionic_buf_info bufs[IONIC_MAX_FRAGS];
ionic_desc_cb cb;
void *cb_arg;
};