net/dpaa2: configure jumbo frames
[dpdk.git] / drivers / net / sfc / sfc_tso.c
index 68d84c9..fb79d74 100644 (file)
@@ -1,5 +1,7 @@
 /*-
- * Copyright (c) 2016 Solarflare Communications Inc.
+ *   BSD LICENSE
+ *
+ * Copyright (c) 2016-2017 Solarflare Communications Inc.
  * All rights reserved.
  *
  * This software was jointly developed between OKTET Labs (under contract
 #define SFC_TSO_OPDESCS_IDX_SHIFT      2
 
 int
-sfc_tso_alloc_tsoh_objs(struct sfc_tx_sw_desc *sw_ring,
-                       unsigned int txq_entries, unsigned int socket_id)
+sfc_efx_tso_alloc_tsoh_objs(struct sfc_efx_tx_sw_desc *sw_ring,
+                           unsigned int txq_entries, unsigned int socket_id)
 {
        unsigned int i;
 
        for (i = 0; i < txq_entries; ++i) {
-               sw_ring[i].tsoh = rte_malloc_socket("sfc-txq-tsoh-obj",
+               sw_ring[i].tsoh = rte_malloc_socket("sfc-efx-txq-tsoh-obj",
                                                    SFC_TSOH_STD_LEN,
-                                                   SFC_TX_SEG_BOUNDARY,
+                                                   RTE_CACHE_LINE_SIZE,
                                                    socket_id);
                if (sw_ring[i].tsoh == NULL)
                        goto fail_alloc_tsoh_objs;
@@ -66,7 +68,8 @@ fail_alloc_tsoh_objs:
 }
 
 void
-sfc_tso_free_tsoh_objs(struct sfc_tx_sw_desc *sw_ring, unsigned int txq_entries)
+sfc_efx_tso_free_tsoh_objs(struct sfc_efx_tx_sw_desc *sw_ring,
+                          unsigned int txq_entries)
 {
        unsigned int i;
 
@@ -77,8 +80,8 @@ sfc_tso_free_tsoh_objs(struct sfc_tx_sw_desc *sw_ring, unsigned int txq_entries)
 }
 
 static void
-sfc_tso_prepare_header(struct sfc_txq *txq, struct rte_mbuf **in_seg,
-                      size_t *in_off, unsigned int idx, size_t bytes_left)
+sfc_efx_tso_prepare_header(struct sfc_efx_txq *txq, struct rte_mbuf **in_seg,
+                          size_t *in_off, unsigned int idx, size_t bytes_left)
 {
        struct rte_mbuf *m = *in_seg;
        size_t bytes_to_copy = 0;
@@ -109,14 +112,13 @@ sfc_tso_prepare_header(struct sfc_txq *txq, struct rte_mbuf **in_seg,
 }
 
 int
-sfc_tso_do(struct sfc_txq *txq, unsigned int idx, struct rte_mbuf **in_seg,
-          size_t *in_off, efx_desc_t **pend, unsigned int *pkt_descs,
-          size_t *pkt_len)
+sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
+              struct rte_mbuf **in_seg, size_t *in_off, efx_desc_t **pend,
+              unsigned int *pkt_descs, size_t *pkt_len)
 {
        uint8_t *tsoh;
        const struct tcp_hdr *th;
        efsys_dma_addr_t header_paddr;
-       efsys_dma_addr_t paddr_next_frag;
        uint16_t packet_id;
        uint32_t sent_seq;
        struct rte_mbuf *m = *in_seg;
@@ -140,18 +142,17 @@ sfc_tso_do(struct sfc_txq *txq, unsigned int idx, struct rte_mbuf **in_seg,
                return EMSGSIZE;
 
        header_paddr = rte_pktmbuf_mtophys(m);
-       paddr_next_frag = P2ROUNDUP(header_paddr + 1, SFC_TX_SEG_BOUNDARY);
 
        /*
         * Sometimes headers may be split across multiple mbufs. In such cases
         * we need to glue those pieces and store them in some temporary place.
         * Also, packet headers must be contiguous in memory, so that
-        * they can be referred to with a single DMA descriptor. Hence, handle
-        * the case where the original header crosses a 4K memory boundary
+        * they can be referred to with a single DMA descriptor. EF10 has no
+        * limitations on address boundaries crossing by DMA descriptor data.
         */
-       if ((m->data_len < header_len) ||
-           ((paddr_next_frag - header_paddr) < header_len)) {
-               sfc_tso_prepare_header(txq, in_seg, in_off, idx, header_len);
+       if (m->data_len < header_len) {
+               sfc_efx_tso_prepare_header(txq, in_seg, in_off, idx,
+                                          header_len);
                tsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;
 
                header_paddr = rte_malloc_virt2phy((void *)tsoh);