Commit Graph

314 Commits

Author SHA1 Message Date
Yunjian Wang
eb00a7f123 net/e1000: use macro for PCI log format
Use PCI_PRI_FMT instead of "%04d:%02d:%02d:%d" print format.

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-02-05 09:51:21 +01:00
Chenxu Di
6bcf194ad1 net/e1000: cleanup Tx buffers
Add support to the igb vf for the API rte_eth_tx_done_cleanup to force
free consumed buffers on Tx ring.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-01-17 19:46:26 +01:00
Dharmik Thakkar
ecf8c855e4 net/e1000: remove local bool type
Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-01-17 19:46:02 +01:00
Lunyuan Cui
a407d7c2dd net/e1000: fix link status
The link status got from link status register was not correct,
because register has been reset when ports reset.
After port reset, set the link status down.

Fixes: c431ec66c5 ("net/igb: support setting link up or down")
Cc: stable@dpdk.org

Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-11-26 18:05:15 +01:00
Lunyuan Cui
e7c1d6b2d8 net/e1000: fix link status update
Meaningless to judge the link state according to the memset'ed
link variable, this patch fixes this logical issue.

In addition, this patch changes the variable from link_check to link_up
according to its real meaning.

Fixes: 80ba61115e ("net/e1000: use link status helper functions")
Cc: stable@dpdk.org

Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-11-26 18:05:15 +01:00
Pawel Modrak
85ff364f3b build: align symbols with global ABI version
Merge all versions in linker version script files to DPDK_20.0.

This commit was generated by running the following command:

:~/DPDK$ buildtools/update-abi.sh 20.0

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-20 23:05:39 +01:00
Anatoly Burakov
fbaf943887 build: remove individual library versions
Since the library versioning for both stable and experimental ABI's is
now managed globally, the LIBABIVER and version variables no longer
serve any useful purpose, and can be removed.

The replacement in Makefiles was done using the following regex:

	^(#.*\n)?LIBABIVER\s*:=\s*\d+\n(\s*\n)?

(LIBABIVER := numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

The replacement for meson files was done using the following regex:

	^(#.*\n)?version\s*=\s*\d+\n(\s*\n)?

(version = numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

[David]: those variables are manually removed for the files:
- drivers/common/qat/Makefile
- lib/librte_eal/meson.build
[David]: the LIBABIVER is restored for the external ethtool example
library.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-20 23:05:39 +01:00
Andrew Rybchenko
73fb89dd6a drivers/net: fix RSS hash offload flag if no RSS
By default RSS hash delivery (offload) is bound to RSS mode and
it is incorrect to advertise it as enabled if Rx multi-queue mode
has no RSS.

Fixes: 8b945a7f7d ("drivers/net: update Rx RSS hash offload capabilities")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-20 17:36:06 +01:00
Pavan Nikhilesh
8b945a7f7d drivers/net: update Rx RSS hash offload capabilities
Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-11 16:15:37 +01:00
Shweta Choudaha
260dd69526 net/igb: fix PHY status if PHY reset is not blocked
When PHY reset is blocked as is the case when BMC is connected via NC-SI
do not set GO_LINKD bit in PHY power management register in dev_stop as
this will disconnect the PHY. Also, in dev_close clear the GO_LINKD
bit only if PHY reset is not blocked

Fixes: 3af34dec0b ("igb: force phy power up/down")
Cc: stable@dpdk.org

Signed-off-by: Shweta Choudaha <shweta.choudaha@att.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-11-08 23:15:04 +01:00
Andrzej Ostruszka
46136031f1 net/e1000: clean LTO warnings
During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘link’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  if (link) {

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
2019-11-08 15:23:41 +01:00
Congwen Zhang
0e4949639b net/e1000: fix zeroing of RSS config
The type of rss_conf is struct igb_rte_flow_rss_conf *,
 not struct rte_eth_rss_conf *.

Fixes: 424ae915ba ("net/e1000: move RSS to flow API")
Cc: stable@dpdk.org

Signed-off-by: Congwen Zhang <zhang.congwen@zte.com.cn>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-10-25 19:20:47 +02:00
Ferruh Yigit
b6730d93a1 net/igb: fix global variable multiple definitions
Filtering related global variables are defined in a header file which
was causing multiple definitions of the variables, fixed it by moving
them to the .c file.

Issue has been detected by '-fno-common' gcc flag.

Fixes: 22bb13410c ("net/igb: create consistent filter")
Fixes: 424ae915ba ("net/e1000: move RSS to flow API")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-25 23:16:23 +02:00
Stephen Hemminger
7f40546b34 net/e1000: use dynamic log type for Tx/Rx debug
The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver should register the logtypes
for itself.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 15:00:57 +02:00
Chenxu Di
b394acbb17 net/e1000: release port upon close
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
 for the port can be freed by rte_eth_dev_close().

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2019-10-07 15:00:57 +02:00
Ivan Ilchenko
ca041cd44f ethdev: change allmulticast callbacks to return status
Enabling/disabling of allmulticast mode is not always successful and
it should be taken into account to be able to handle it properly.

When correct return status is unclear from driver code, -EAGAIN is used.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2019-10-07 15:00:55 +02:00
Igor Romanov
9970a9ad07 ethdev: make stats and xstats reset callbacks return int
Change return value of the callbacks from void to int. Make
implementations across all drivers return negative errno
values in case of error conditions.

Both callbacks are updated together because a large number of
drivers assign the same function to both callbacks.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 15:00:54 +02:00
Andrew Rybchenko
9039c81257 ethdev: change promiscuous callbacks to return status
Enabling/disabling of promiscuous mode is not always successful and
it should be taken into account to be able to handle it properly.

When correct return status is unclear from driver code, -EAGAIN is used.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2019-10-07 15:00:54 +02:00
Ivan Ilchenko
bdad90d12e ethdev: change device info get callback to return int
Change eth_dev_infos_get_t return value from void to int.
Make eth_dev_infos_get_t implementations across all drivers to return
negative errno values if case of error conditions.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 14:45:35 +02:00
Xiao Zhang
d6956e9239 net/e1000: fix memory barrier usage in Tx
Use rte_cio_wmb instead of rte_wmb when writing TX descriptor since it's
CIO memory.
Replace rte_io_wmb and E1000_PCI_REG_WRITE_RELAXED with
E1000_PCI_REG_WRITE since it has rte_io_wmb inside, which will be more
clear.

Fixes: 1fc9701238 ("net/e1000: fix i219 hang on reset/close")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-09-20 10:19:41 +02:00
Xiao Zhang
675f65dc66 net/e1000: fix MAC type checking
The mac types of i219 are e1000_pch_spt and e1000_pch_cnp, correct the
checking code of mac type when flushing i219 descriptor rings.

Fixes: 1fc9701238 ("net/e1000: fix i219 hang on reset/close")
Cc: stable@dpdk.org

Reported-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-09-20 10:19:41 +02:00
Xiao Zhang
08141dc7e1 net/e1000: fix PCI config read check
Add return value checking when reading configure information from PCI
register to avoid Coverity issue.

Fixes: 1fc97012 ("net/e1000: fix i219 hang on reset/close")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-08-06 13:07:54 +02:00
Xiaolong Ye
bb4a49fa4b net/e1000: replace license text with SPDX tag
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-07-29 13:31:45 +02:00
Xiaolong Ye
41ede22ecf net/e1000: replace license text with SPDX tag
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-07-24 18:44:40 +02:00
Xiao Zhang
1fc9701238 net/e1000: fix i219 hang on reset/close
Unit hang may occur if multiple descriptors are available in the rings
during reset or close. This state can be detected by configure status
by bit 8 in register. If the bit is set and there are pending
descriptors in one of the rings, we must flush them before reset or
close.

Fixes: 805803445a ("e1000: support EM devices (also known as e1000/e1000e)")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-07-24 16:00:57 +02:00
Xiao Zhang
f0027fa182 net/e1000: fix buffer overrun while i219 processing DMA
Intel® 100/200 Series Chipset platforms reduced the round-trip
latency for the LAN Controller DMA accesses, causing in some high
performance cases a buffer overrun while the I219 LAN Connected
Device is processing the DMA transactions. I219LM and I219V devices
can fall into unrecovered Tx hang under very stressfully UDP traffic
and multiple reconnection of Ethernet cable. This Tx hang of the LAN
Controller is only recovered if the system is rebooted. Slightly slow
down DMA access by reducing the number of outstanding requests.
This workaround could have an impact on TCP traffic performance
on the platform. Disabling TSO eliminates performance loss for TCP
traffic without a noticeable impact on CPU performance.

Please, refer to I218/I219 specification update:
https://www.intel.com/content/www/us/en/embedded/products/networking/
ethernet-connection-i218-family-documentation.html

Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-07-23 14:31:36 +02:00
Nithin Dabilpuram
6bee9d5f45 drivers/net: use ack in interrupt handlers
Replace rte_intr_enable() with rte_intr_ack() API
for acking an interrupt in interrupt handlers and
rx_queue_intr_enable() callbacks of PMD's.

This is inline with original intent of this change in PMDs
to ack interrupts after handling is completed if
device is backed by UIO, IGB_UIO or VFIO(with INTx).

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Shahed Shaikh <shshaikh@marvell.com>
Tested-by: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2019-07-23 12:00:23 +02:00
David Marchand
b76fafb174 eal: fix IOVA mode selection as VA for PCI drivers
The incriminated commit broke the use of RTE_PCI_DRV_IOVA_AS_VA which
was intended to mean "driver only supports VA" but had been understood
as "driver supports both PA and VA" by most net drivers and used to let
dpdk processes to run as non root (which do not have access to physical
addresses on recent kernels).

The check on physical addresses actually closed the gap for those
drivers. We don't need to mark them with RTE_PCI_DRV_IOVA_AS_VA and this
flag can retain its intended meaning.
Document explicitly its meaning.

We can check that a driver requirement wrt to IOVA mode is fulfilled
before trying to probe a device.

Finally, document the heuristic used to select the IOVA mode and hope
that we won't break it again.

Fixes: 703458e19c ("bus/pci: consider only usable devices for IOVA mode")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-07-22 17:45:52 +02:00
Morten Brørup
f0c2dc8201 net: move TCP flags from ethdev header
TCP flags were moved to the TCP header file from the Ethernet control
header file, and the RTE prefix was added to their names.

Missing TCP ECN flags were added.

The ALL mask did not include TCP ECN flags, so it was renamed to reflect
that it applies to N-tuple filtering only.

Updated other files affected by the renaming accordingly.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-07-03 12:57:30 +02:00
Andrew Rybchenko
ecafec261e net/e1000: fix Tx prepare to set positive rte_errno
Fixes: 2b76648872 ("net/e1000: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Stephen Hemminger
130d2b77f0 net/e1000: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
David Marchand
0c9da7555d net: replace IPv4/v6 constants with uppercase name
Since we change these macros, we might as well avoid triggering complaints
from checkpatch because of mixed case.

old=RTE_IPv4
new=RTE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv4
new=RTE_ETHER_TYPE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv6
new=RTE_ETHER_TYPE_IPV6
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2019-06-03 16:54:54 +02:00
Olivier Matz
e73e3547ce net: add rte prefix to UDP structure
Add 'rte_' prefix to structures:
- rename struct udp_hdr as struct rte_udp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
f41b5156fe net: add rte prefix to TCP structure
Add 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
09d9ae1ac9 net: add rte prefix to SCTP structure
Add 'rte_' prefix to structures:
- rename struct sctp_hdr as struct rte_sctp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
a7c528e5d7 net: add rte prefix to IP structure
Add 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
35b2d13fd6 net: add rte prefix to ether defines
Add 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
Add 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
6d13ea8e8e net: add rte prefix to ether structures
Add 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Bruce Richardson
6723c0fc72 replace snprintf with strlcpy
Do a global replace of snprintf(..."%s",...) with strlcpy, adding in the
rte_string_fns.h header if needed.  The function changes in this patch were
auto-generated via command:

  spatch --sp-file devtools/cocci/strlcpy.cocci --dir . --in-place

and then the files edited using awk to add in the missing header:

  gawk -i inplace '/include <rte_/ && ! seen { \
  	print "#include <rte_string_fns.h>"; seen=1} {print}'

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-04-04 22:46:05 +02:00
Ian Stokes
ae35fd61fc net/e1000: set min and max MTU
This commit sets the min and max supported MTU values for igb devices
via the eth_igb_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max MTU is calculated as the max packet length
supported minus the transport overhead. To aid in these calculations
a new MACRO 'E1000_ETH_OVERHEAD' has been introduced to consolidate
overhead calculation and avoid duplication.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-03-29 19:00:35 +01:00
Andrius Sirvys
902f389f9b drivers/net: fix shifting 32-bit signed variable 31 times
Shifting signed 32-bit values by 31-bits has the potential for
unexpected  outcomes as compiler can overwrite a bit.
Specified that values are unsigned.

Errors are observed from running cppcheck.

Bugzilla ID: 58
Fixes: 69e209be54 ("net/axgbe: add register map and related macros")
Fixes: b5bf771922 ("bnx2x: driver support routines")
Fixes: ed2ced6fe9 ("net/bnxt: check initialization before accessing stats")
Fixes: 6fda3f0ddd ("net/cxgbe: add API to program hardware MPS table")
Fixes: bdb244b969 ("e1000: whitespace changes")
Fixes: 5a32a257f9 ("e1000: more NICs in base driver")
Fixes: 2fe669f4bc ("net/nfp: support MAC address change")
Fixes: defb9a5dd1 ("nfp: introduce driver initialization")
Fixes: ec94dbc573 ("qede: add base driver")
Fixes: d2e7d931d0 ("net/qede/base: formatting changes")
Fixes: cdc07e83bb ("net/tap: add eBPF program file")
Cc: stable@dpdk.org

Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-03-01 18:17:36 +01:00
Didier Pallard
d6db681bf9 drivers/net: fix several Tx prepare functions
Since below commit, several tx_prep functions are broken, they fail to
pass supported Tx offload features check:
PKT_TX_IPVx must be set when any PKT_TX_L4 checksum is requested,
but these values are not present in the mask of supported Tx offloads
of several drivers that advertise PKT_TX_L4_MASK.
So any packet sent to those drivers with a L4 checksum request and
one of PKT_TX_IPVx bit set is rejected by the tx prepare function.

Fixes: 1037ed842c ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-12-13 17:53:50 +00:00
Timmons C. Player
7f5c81d568 net/igb: fix LSC interrupt when using MSI-X
Take the 'other interrupt' into account when setting up
MSI-X interrupts and use the proper mask when enabling it.
Also, rearm the MSI-X vector after the LSC interrupt fires.

This change allows both LSC and RXQ interrupts to work at
the same time when using MSI-X interrupts.

Cc: stable@dpdk.org

Signed-off-by: Timmons C. Player <timmons.player@spirent.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2018-12-03 12:57:33 +00:00
Yunjian Wang
ba46f5e60f net/e1000/base: fix uninitialized variable
This patch fixes the variable 'phy_word' may be used uninitialized.

Fixes: 5b6439cf03 ("e1000/base: support different EEARBC for i210")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-11-14 00:35:53 +01:00
Zhirun Yan
ac60b2de4f net/igb: update Tx offload mask
Tx offload mask is updated in following commit 1037ed842c
("mbuf: fix Tx offload mask") Currently, the new added offload
flags are not supported in PMD and application will fail to call
PMD transmit prepare function.

This patch updates IGB_TX_OFFFLOAD_MASK.

Fixes: 1037ed842c ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-05 15:01:25 +01:00
Ilya Maximets
fd61c749db drivers/net: use sleep delay by default for Intel NICs
NICs uses different delays up to a second during their
configuration. It makes no sense to busy-wait so long wasting
CPU cycles and preventing any other threads to execute on the
same CPU core. These busy polling are the rudiments that came
from the kernel drivers where you can not sleep in interrupt
context, but as we're in userspace, we're able and should
sleep to allow other threads to run.
Delays never called on rx/tx path, so this should not affect
performance.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
e16adf08e5 ethdev: free all common data when releasing port
This is a clean-up of common ethdev data freeing.
All data freeing are moved to rte_eth_dev_release_port()
and done only in case of primary process.

It is probably fixing some memory leaks for PMDs which were
not freeing all data.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Luca Boccassi
362488e631 net/e1000: enable MSI-x for linkup and other events in 82574
Linux supports 82574 MSI-x interrupt for linkup and other link
conditions. Enable the same feature in the e1000 PMD in order to
allow this card to work properly, as it requires interrupt
handling for link negotiations among other things.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2018-10-11 18:56:02 +02:00
Luca Boccassi
d7812ffd83 net/e1000: do not error out if Rx drop enable is set
rx_drop_en is an optimization that does nothing on single-queue
devices like e1000. Do not force applications that do not care to
select per-devices optimizations flags by returning an error, just
log it and carry on.

Fixes: 805803445a ("e1000: support EM devices (also known as e1000/e1000e)")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2018-10-11 18:56:02 +02:00