From 2c8e687c549f08522ee79918d3cf3003503ca1c5 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Tue, 24 Jun 2014 10:03:02 +0200 Subject: [PATCH] explicit shared code naming as base driver Intel PMDs are built on top of the base drivers which are provided by Intel and shouldn't be modified to allow easy batch upgrade from Intel. The base driver is a "shared code" between many projects. But in DPDK, the "base driver" naming makes more sense. Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- lib/librte_pmd_e1000/Makefile | 13 ++++++----- lib/librte_pmd_e1000/igb_ethdev.c | 2 +- lib/librte_pmd_i40e/Makefile | 34 ++++++++++++++--------------- lib/librte_pmd_i40e/i40e_ethdev.c | 12 +++++----- lib/librte_pmd_ixgbe/Makefile | 13 ++++++----- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 4 ++-- lib/librte_pmd_vmxnet3/Makefile | 6 ++--- 7 files changed, 43 insertions(+), 41 deletions(-) diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile index 3d4e7e5932..14bc4a24fa 100644 --- a/lib/librte_pmd_e1000/Makefile +++ b/lib/librte_pmd_e1000/Makefile @@ -43,20 +43,21 @@ ifeq ($(CC), icc) # # CFLAGS for icc # -CFLAGS_LAD = -wd177 -wd181 -wd188 -wd869 -wd2259 +CFLAGS_BASE_DRIVER = -wd177 -wd181 -wd188 -wd869 -wd2259 else # # CFLAGS for gcc # -CFLAGS_LAD = -Wno-uninitialized -Wno-unused-parameter -CFLAGS_LAD += -Wno-unused-variable +CFLAGS_BASE_DRIVER = -Wno-uninitialized -Wno-unused-parameter +CFLAGS_BASE_DRIVER += -Wno-unused-variable endif # -# Add extra flags for LAD source files to disable warnings in them +# Add extra flags for base driver files (also known as shared code) +# to disable warnings in them # -LAD_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_e1000/e1000/*.c))) -$(foreach obj, $(LAD_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_LAD))) +BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_e1000/e1000/*.c))) +$(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) VPATH += $(RTE_SDK)/lib/librte_pmd_e1000/e1000 diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index e633a5d4f8..86f2d0ca2d 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -618,7 +618,7 @@ eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, hw->vendor_id = pci_dev->id.vendor_id; hw->hw_addr = (void *)pci_dev->mem_resource[0].addr; - /* Initialize the shared code */ + /* Initialize the shared code (base driver) */ diag = e1000_setup_init_funcs(hw, TRUE); if (diag != 0) { PMD_INIT_LOG(ERR, "Shared code init failed for igbvf: %d", diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile index 09f2087a85..618fb8a9ce 100644 --- a/lib/librte_pmd_i40e/Makefile +++ b/lib/librte_pmd_i40e/Makefile @@ -39,26 +39,26 @@ LIB = librte_pmd_i40e.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +# +# Add extra flags for base driver files (also known as shared code) +# to disable warnings +# ifeq ($(CC), icc) -CFLAGS_SHARED_DRIVERS = -wd593 +CFLAGS_BASE_DRIVER = -wd593 else -CFLAGS_SHARED_DRIVERS = -Wno-unused-but-set-variable -CFLAGS_SHARED_DRIVERS += -Wno-sign-compare -CFLAGS_SHARED_DRIVERS += -Wno-unused-value -CFLAGS_SHARED_DRIVERS += -Wno-unused-parameter -CFLAGS_SHARED_DRIVERS += -Wno-strict-aliasing -CFLAGS_SHARED_DRIVERS += -Wno-format -CFLAGS_SHARED_DRIVERS += -Wno-missing-field-initializers -CFLAGS_SHARED_DRIVERS += -Wno-pointer-to-int-cast -CFLAGS_SHARED_DRIVERS += -Wno-format-nonliteral -CFLAGS_SHARED_DRIVERS += -Wno-format-security +CFLAGS_BASE_DRIVER = -Wno-unused-but-set-variable +CFLAGS_BASE_DRIVER += -Wno-sign-compare +CFLAGS_BASE_DRIVER += -Wno-unused-value +CFLAGS_BASE_DRIVER += -Wno-unused-parameter +CFLAGS_BASE_DRIVER += -Wno-strict-aliasing +CFLAGS_BASE_DRIVER += -Wno-format +CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers +CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast +CFLAGS_BASE_DRIVER += -Wno-format-nonliteral +CFLAGS_BASE_DRIVER += -Wno-format-security endif - -# -# Add extra flags for ND source files to disable warnings -# -SHARED_DRIVERS_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_i40e/i40e/*.c))) -$(foreach obj, $(SHARED_DRIVERS_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_SHARED_DRIVERS))) +OBJS_BASE_DRIVER=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_i40e/i40e/*.c))) +$(foreach obj, $(OBJS_BASE_DRIVER), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) VPATH += $(RTE_SDK)/lib/librte_pmd_i40e/i40e diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index 3311d734ea..6bc3998e1f 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -387,10 +387,10 @@ eth_i40e_dev_init(__rte_unused struct eth_driver *eth_drv, return ret; } - /* Initialize the shared code */ + /* Initialize the shared code (base driver) */ ret = i40e_init_shared_code(hw); if (ret) { - PMD_INIT_LOG(ERR, "Failed to init shared code: %d", ret); + PMD_INIT_LOG(ERR, "Failed to init shared code (base driver): %d", ret); return ret; } @@ -1497,7 +1497,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev, } /** - * i40e_allocate_dma_mem_d - specific memory alloc for shared code + * i40e_allocate_dma_mem_d - specific memory alloc for shared code (base driver) * @hw: pointer to the HW structure * @mem: pointer to mem struct to fill out * @size: size of memory requested @@ -1531,7 +1531,7 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw, } /** - * i40e_free_dma_mem_d - specific memory free for shared code + * i40e_free_dma_mem_d - specific memory free for shared code (base driver) * @hw: pointer to the HW structure * @mem: ptr to mem struct to free **/ @@ -1549,7 +1549,7 @@ i40e_free_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw, } /** - * i40e_allocate_virt_mem_d - specific memory alloc for shared code + * i40e_allocate_virt_mem_d - specific memory alloc for shared code (base driver) * @hw: pointer to the HW structure * @mem: pointer to mem struct to fill out * @size: size of memory requested @@ -1572,7 +1572,7 @@ i40e_allocate_virt_mem_d(__attribute__((unused)) struct i40e_hw *hw, } /** - * i40e_free_virt_mem_d - specific memory free for shared code + * i40e_free_virt_mem_d - specific memory free for shared code (base driver) * @hw: pointer to the HW structure * @mem: pointer to mem struct to free **/ diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile index b48d0b716e..df4771516a 100644 --- a/lib/librte_pmd_ixgbe/Makefile +++ b/lib/librte_pmd_ixgbe/Makefile @@ -43,7 +43,7 @@ ifeq ($(CC), icc) # # CFLAGS for icc # -CFLAGS_LAD = -wd174 -wd593 -wd869 -wd981 -wd2259 +CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259 else # # CFLAGS for gcc @@ -51,8 +51,8 @@ else ifneq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 3 && echo 1), 1) CFLAGS += -Wno-deprecated endif -CFLAGS_LAD = -Wno-unused-parameter -Wno-unused-value -CFLAGS_LAD += -Wno-strict-aliasing -Wno-format-extra-args +CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value +CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args ifeq ($(shell test $(GCC_MAJOR_VERSION) -ge 4 -a $(GCC_MINOR_VERSION) -ge 6 && echo 1), 1) CFLAGS_ixgbe_common.o += -Wno-unused-but-set-variable @@ -60,10 +60,11 @@ endif endif # -# Add extra flags for LAD source files to disable warnings in them +# Add extra flags for base driver files (also known as shared code) +# to disable warnings in them # -LAD_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_ixgbe/ixgbe/*.c))) -$(foreach obj, $(LAD_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_LAD))) +BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_ixgbe/ixgbe/*.c))) +$(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) VPATH += $(RTE_SDK)/lib/librte_pmd_ixgbe/ixgbe diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 618488a6a4..e0c80b37d3 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -729,7 +729,7 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, hw->allow_unsupported_sfp = 1; #endif - /* Initialize the shared code */ + /* Initialize the shared code (base driver) */ #ifdef RTE_NIC_BYPASS diag = ixgbe_bypass_init_shared_code(hw); #else @@ -960,7 +960,7 @@ eth_ixgbevf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, /* initialize the hw strip bitmap*/ memset(hwstrip, 0, sizeof(*hwstrip)); - /* Initialize the shared code */ + /* Initialize the shared code (base driver) */ diag = ixgbe_init_shared_code(hw); if (diag != IXGBE_SUCCESS) { PMD_INIT_LOG(ERR, "Shared code init failed for ixgbevf: %d", diag); diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile index e0c0067023..a44abe149c 100644 --- a/lib/librte_pmd_vmxnet3/Makefile +++ b/lib/librte_pmd_vmxnet3/Makefile @@ -43,7 +43,7 @@ ifeq ($(CC), icc) # # CFLAGS for icc # -CFLAGS_LAD = -wd174 -wd593 -wd869 -wd981 -wd2259 +CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259 else # # CFLAGS for gcc @@ -51,8 +51,8 @@ else ifneq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 3 && echo 1), 1) CFLAGS += -Wno-deprecated endif -CFLAGS_LAD = -Wno-unused-parameter -Wno-unused-value -CFLAGS_LAD += -Wno-strict-aliasing -Wno-format-extra-args +CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value +CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args endif -- 2.20.1