net/cxgbe: define symbols only when not available
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Wed, 19 Dec 2018 16:28:25 +0000 (21:58 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 21 Dec 2018 15:22:41 +0000 (16:22 +0100)
commit9986d380fd9b702d0cb25345d9d107f25376ee14
tree03eaf5dc645f32814fed0fe993cfd18a5eaf088f
parentb5c3a5fd577af3b91c99b0ab88748e04ff96e363
net/cxgbe: define symbols only when not available

Define symbols only when they are not available.

This fixes following types of issues reported by Intel C++ compiler
in Windows build.

C:\> cxgbe_compat.h(154): warning #47: incompatible redefinition of
macro "min"
        #define min(a, b) RTE_MIN(a, b)
                ^

C:\> t4_hw.c(338): warning #266: function "bzero" declared implicitly
            bzero(p, 0, size);
            ^

C:\> t4_hw.c(5337): warning #266: function "htonl" declared implicitly
            rvc.op_to_viid = htonl(V_FW_CMD_OP(FW_RSS_VI_CONFIG_CMD) |
                             ^

C:\> sge.c(361): error : expected an expression
        struct sge_eth_rxq *rxq = container_of(q, struct sge_eth_rxq, fl);
                                  ^

C:\> sge.c(1350): error : identifier "caddr_t" is undefined
  static void inline_tx_mbuf(const struct sge_txq *q, caddr_t from,
                                                      ^
[...]

Build Environment:
1. Target OS: Microsoft Windows Server 2016
2. Compiler: Intel C++ Compiler from Intel Parallel Studio XE 2019 [1]
3. Development Tools:
   3.1 Microsoft Visual Studio 2017 Professional
   3.2 Windows Software Development Kit (SDK) v10.0.17763
   3.3 Windows Driver Kit (WDK) v10.0.17763

[1] https://software.intel.com/en-us/parallel-studio-xe

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/base/t4_hw.c
drivers/net/cxgbe/base/t4vf_hw.c
drivers/net/cxgbe/cxgbe_compat.h