DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 00/13] net/ionic: fixes and optimizations
@ 2021-01-18 20:34 Andrew Boyer
  2021-01-18 20:34 ` [dpdk-dev] [PATCH 01/13] net/ionic: strip out unneeded interrupt code Andrew Boyer
                   ` (13 more replies)
  0 siblings, 14 replies; 37+ messages in thread
From: Andrew Boyer @ 2021-01-18 20:34 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer

This patch series fixes some transmit issues, adds (better) support for
big-endian systems, and improves performance by stripping down some
structures and inlining a few functions.

The endianness code has been reviewed internally but not really tested -
I do not have access to a big-endian system to test on.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>

Andrew Boyer (13):
  net/ionic: strip out unneeded interrupt code
  net/ionic: observe endianness in firmware commands
  net/ionic: observe endianness in Rx filter code
  net/ionic: add an array-size macro
  net/ionic: query firmware for supported queue versions
  net/ionic: clean up Tx queue version support
  net/ionic: inline queue flush function
  net/ionic: inline queue space function
  net/ionic: observe endiannness in ioread/iowrite
  net/ionic: fix to allow separate L3 and L4 csum offload
  net/ionic: convert per-queue offloads into queue flags
  net/ionic: fix up function attribute tags
  net/ionic: fix address handling in transmit code

 drivers/net/ionic/ionic_dev.c       |  85 +++----
 drivers/net/ionic/ionic_dev.h       |  41 +++-
 drivers/net/ionic/ionic_ethdev.c    |  38 +--
 drivers/net/ionic/ionic_lif.c       | 361 ++++++++++++++++++----------
 drivers/net/ionic/ionic_lif.h       |  21 +-
 drivers/net/ionic/ionic_main.c      |  38 ++-
 drivers/net/ionic/ionic_osdep.h     |   7 +-
 drivers/net/ionic/ionic_rx_filter.c |  22 +-
 drivers/net/ionic/ionic_rx_filter.h |   1 +
 drivers/net/ionic/ionic_rxtx.c      |  87 ++++---
 10 files changed, 414 insertions(+), 287 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 37+ messages in thread
* [dpdk-dev] [PATCH] net: redefine array size macros
@ 2021-01-29 22:44 Andrew Boyer
  2021-02-01 22:28 ` Thomas Monjalon
  0 siblings, 1 reply; 37+ messages in thread
From: Andrew Boyer @ 2021-01-29 22:44 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer

Replace copies of size(arr)/size(arr[0]) with RTE_DIM().
Eventually all of these macro definitions should be removed.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 drivers/net/atlantic/atl_hw_regs.h                | 2 +-
 drivers/net/axgbe/axgbe_common.h                  | 2 +-
 drivers/net/bnx2x/bnx2x.h                         | 2 +-
 drivers/net/bnx2x/elink.h                         | 2 +-
 drivers/net/ena/ena_ethdev.c                      | 2 +-
 drivers/net/enic/base/vnic_devcmd.h               | 2 +-
 drivers/net/hns3/hns3_ethdev.h                    | 2 +-
 drivers/net/i40e/base/i40e_osdep.h                | 2 +-
 drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h | 2 +-
 drivers/net/thunderx/base/nicvf_hw.h              | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/atlantic/atl_hw_regs.h b/drivers/net/atlantic/atl_hw_regs.h
index a2d6ca804e..4f6cd35774 100644
--- a/drivers/net/atlantic/atl_hw_regs.h
+++ b/drivers/net/atlantic/atl_hw_regs.h
@@ -26,7 +26,7 @@
 
 #define mdelay rte_delay_ms
 #define udelay rte_delay_us
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#define ARRAY_SIZE(arr) RTE_DIM(arr)
 #define BIT(x)	(1UL << (x))
 
 #define AQ_HW_WAIT_FOR(_B_, _US_, _N_) \
diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h
index 91404ca01c..ef8706cf0f 100644
--- a/drivers/net/axgbe/axgbe_common.h
+++ b/drivers/net/axgbe/axgbe_common.h
@@ -42,7 +42,7 @@
 
 #define BIT(nr)	                       (1 << (nr))
 #ifndef ARRAY_SIZE
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#define ARRAY_SIZE(arr) RTE_DIM(arr)
 #endif
 
 #define AXGBE_HZ				250
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 69cc1430a4..e13ab15574 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -81,7 +81,7 @@
 #endif
 
 #ifndef ARRAY_SIZE
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#define ARRAY_SIZE(arr) RTE_DIM(arr)
 #endif
 #ifndef DIV_ROUND_UP
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
diff --git a/drivers/net/bnx2x/elink.h b/drivers/net/bnx2x/elink.h
index dd70ac6c66..6b2e85f1e1 100644
--- a/drivers/net/bnx2x/elink.h
+++ b/drivers/net/bnx2x/elink.h
@@ -86,7 +86,7 @@ extern void elink_cb_notify_link_changed(struct bnx2x_softc *sc);
 #define ELINK_EVENT_ID_SFP_UNQUALIFIED_MODULE 	1
 #define ELINK_EVENT_ID_SFP_POWER_FAULT 		2
 
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
+#define ARRAY_SIZE(x) RTE_DIM(x)
 /* Debug prints */
 #ifdef ELINK_DEBUG
 
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 20ff3653c6..b4b8794bcc 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -47,7 +47,7 @@
 #define ENA_HASH_KEY_SIZE	40
 #define ETH_GSTRING_LEN	32
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define ARRAY_SIZE(x) RTE_DIM(x)
 
 #define ENA_MIN_RING_DESC	128
 
diff --git a/drivers/net/enic/base/vnic_devcmd.h b/drivers/net/enic/base/vnic_devcmd.h
index 96a7c22b21..3157bc8cb5 100644
--- a/drivers/net/enic/base/vnic_devcmd.h
+++ b/drivers/net/enic/base/vnic_devcmd.h
@@ -63,7 +63,7 @@
 #define _CMD_VTYPE(cmd)          (((cmd) >> _CMD_VTYPESHIFT) & _CMD_VTYPEMASK)
 #define _CMD_N(cmd)              (((cmd) >> _CMD_NSHIFT) & _CMD_NMASK)
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define ARRAY_SIZE(x) RTE_DIM(x)
 
 enum vnic_devcmd_cmd {
 	CMD_NONE                = _CMDC(_CMD_DIR_NONE, _CMD_VTYPE_NONE, 0),
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 0d17170fa7..db80c2391c 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -887,7 +887,7 @@ static inline uint32_t hns3_read_reg(void *base, uint32_t reg)
 #define hns3_read_dev(a, reg) \
 	hns3_read_reg((a)->io_base, (reg))
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define ARRAY_SIZE(x) RTE_DIM(x)
 
 #define NEXT_ITEM_OF_ACTION(act, actions, index)                        \
 	do {								\
diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h
index ec9712c3a7..230d400149 100644
--- a/drivers/net/i40e/base/i40e_osdep.h
+++ b/drivers/net/i40e/base/i40e_osdep.h
@@ -175,7 +175,7 @@ static inline uint64_t i40e_read64_addr(volatile void *addr)
 	I40E_PCI_REG_WRITE(I40E_PCI_REG_ADDR((a), (reg)), (value))
 #define flush(a) i40e_read_addr(I40E_PCI_REG_ADDR((a), (I40E_GLGEN_STAT)))
 
-#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
+#define ARRAY_SIZE(arr) RTE_DIM(arr)
 
 /* memory allocation tracking */
 struct i40e_dma_mem {
diff --git a/drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h b/drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h
index d46574b10e..7b64e2d32b 100644
--- a/drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h
+++ b/drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h
@@ -23,7 +23,7 @@
 #endif
 
 #ifndef ARRAY_SIZE
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define ARRAY_SIZE(x) RTE_DIM(x)
 #endif
 
 #define NFP_ERRNO(err) (errno = (err), -1)
diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h
index fd13ea84b6..d6f3a57703 100644
--- a/drivers/net/thunderx/base/nicvf_hw.h
+++ b/drivers/net/thunderx/base/nicvf_hw.h
@@ -17,7 +17,7 @@
 #define	PCI_SUB_DEVICE_ID_CN81XX_NICVF			0xA234
 #define	PCI_SUB_DEVICE_ID_CN83XX_NICVF			0xA334
 
-#define NICVF_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#define NICVF_ARRAY_SIZE(arr) RTE_DIM(arr)
 
 #define NICVF_GET_RX_STATS(reg) \
 	nicvf_reg_read(nic, NIC_VNIC_RX_STAT_0_13 | (reg << 3))
-- 
2.17.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2021-02-22 17:09 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 20:34 [dpdk-dev] [PATCH 00/13] net/ionic: fixes and optimizations Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 01/13] net/ionic: strip out unneeded interrupt code Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 02/13] net/ionic: observe endianness in firmware commands Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 03/13] net/ionic: observe endianness in Rx filter code Andrew Boyer
2021-01-18 20:34 ` [dpdk-dev] [PATCH 04/13] net/ionic: add an array-size macro Andrew Boyer
2021-01-27 17:22   ` Ferruh Yigit
2021-01-27 17:40     ` Andrew Boyer
2021-01-29 22:44   ` [dpdk-dev] [PATCH v2 4/13] net/ionic: use the existing " Andrew Boyer
2021-02-02 12:45     ` Ferruh Yigit
2021-01-18 20:35 ` [dpdk-dev] [PATCH 05/13] net/ionic: query firmware for supported queue versions Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 06/13] net/ionic: clean up Tx queue version support Andrew Boyer
2021-01-27 17:30   ` Ferruh Yigit
2021-01-27 17:46     ` Andrew Boyer
2021-01-29 22:44   ` [dpdk-dev] [PATCH v2 6/13] " Andrew Boyer
2021-02-02 12:46     ` Ferruh Yigit
2021-02-05 20:20     ` Thomas Monjalon
2021-02-05 20:26       ` Andrew Boyer
2021-02-05 20:34         ` Thomas Monjalon
2021-01-18 20:35 ` [dpdk-dev] [PATCH 07/13] net/ionic: inline queue flush function Andrew Boyer
2021-01-27 17:36   ` Ferruh Yigit
2021-01-27 17:43     ` Andrew Boyer
2021-01-27 17:50       ` Ferruh Yigit
2021-01-18 20:35 ` [dpdk-dev] [PATCH 08/13] net/ionic: inline queue space function Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 09/13] net/ionic: observe endiannness in ioread/iowrite Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 10/13] net/ionic: fix to allow separate L3 and L4 csum offload Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 11/13] net/ionic: convert per-queue offloads into queue flags Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 12/13] net/ionic: fix up function attribute tags Andrew Boyer
2021-01-18 20:35 ` [dpdk-dev] [PATCH 13/13] net/ionic: fix address handling in transmit code Andrew Boyer
2021-01-27 18:02 ` [dpdk-dev] [PATCH 00/13] net/ionic: fixes and optimizations Ferruh Yigit
2021-01-27 18:10   ` Andrew Boyer
2021-01-27 22:23     ` Ferruh Yigit
2021-01-27 22:25       ` Ferruh Yigit
2021-01-29 22:44 [dpdk-dev] [PATCH] net: redefine array size macros Andrew Boyer
2021-02-01 22:28 ` Thomas Monjalon
2021-02-01 22:32   ` Andrew Boyer
2021-02-02 12:30     ` Ferruh Yigit
2021-02-22 17:09       ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).