Let's try to enforce the convention where most drivers use a pmd. logtype
with their class reflected in it, and libraries use a lib. logtype.
Introduce two new macros:
- RTE_LOG_REGISTER_DEFAULT can be used when a single logtype is
used in a component. It is associated to the default name provided
by the build system,
- RTE_LOG_REGISTER_SUFFIX can be used when multiple logtypes are used,
and then the passed name is appended to the default name,
RTE_LOG_REGISTER is left untouched for existing external users
and for components that do not comply with the convention.
There is a new Meson variable log_prefix to adapt the default name
for baseband (pmd.bb.), bus (no pmd.) and mempool (no pmd.) classes.
Note: achieved with below commands + reverted change on net/bonding +
edits on crypto/virtio, compress/mlx5, regex/mlx5
$ git grep -l RTE_LOG_REGISTER drivers/ |
while read file; do
pattern=${file##drivers/};
class=${pattern%%/*};
pattern=${pattern#$class/};
drv=${pattern%%/*};
case "$class" in
baseband) pattern=pmd.bb.$drv;;
bus) pattern=bus.$drv;;
mempool) pattern=mempool.$drv;;
*) pattern=pmd.$class.$drv;;
esac
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file;
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file;
done
$ git grep -l RTE_LOG_REGISTER lib/ |
while read file; do
pattern=${file##lib/};
pattern=lib.${pattern%%/*};
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file;
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file;
done
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Fixes a few different things:
* Remove 'fw_version' NULL checks, it is allowed if the 'fw_size' is
zero, 'fw_version' being NULL but 'fw_size' not zero condition checked
in ethdev layer
* Be sure required buffer size is returned if provided one is not big
enough, instead of returning success (0)
* Document in doxygen comment the '-EINVAL' is a valid return type
* Take into account that 'snprintf' can return negative value
* Cast length to 'size_t' to compare it with 'fw_size'
Fixes: bb42aa9ffe ("net/atlantic: configure device start/stop")
Fixes: ff70acdf42 ("net/axgbe: support reading FW version")
Fixes: e2652b0a20 ("net/bnxt: support get FW version")
Fixes: cf0fab1d2c ("net/dpaa: support firmware version get API")
Fixes: 748eccb97c ("net/dpaa2: add support for firmware version get")
Fixes: b883c0644a ("net/e1000: add firmware version get")
Fixes: 293430677e ("net/enic: add handler to return firmware version")
Fixes: 1f5ca0b460 ("net/hns3: support some device operations")
Fixes: bd5b86732b ("net/hns3: modify format for firmware version")
Fixes: ed0dfdd0e9 ("net/i40e: add firmware version get")
Fixes: e31cb9a362 ("net/ice: support FW version getting")
Fixes: 4f09bc55ac ("net/igc: implement device base operations")
Fixes: eec10fb0ce ("net/ionic: support FW version")
Fixes: 8b0b565742 ("net/ixgbe: add firmware version get")
Fixes: 4d9f5b8adc ("net/octeontx2: add FW version get operation")
Fixes: f97b56f9f1 ("net/qede: support FW version query")
Fixes: 83fef46a22 ("net/sfc: add callback to retrieve FW version")
Fixes: bc84ac0fad ("net/txgbe: support getting FW version")
Fixes: 2191347120 ("ethdev: add firmware version get")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
The page size is often retrieved from the macro PAGE_SIZE.
If PAGE_SIZE is not defined, it is either using hard coded default,
or getting the system value from the UNIX-only function sysconf().
Such definitions are replaced with the generic function
rte_mem_page_size() defined for each supported OS.
Removing PAGE_SIZE definitions will fix dlb drivers for musl libc,
because #ifdef checks were missing, causing redefinition errors.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Boyer <aboyer@pensando.io>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
The completion type was wrong.
Don't check the completion if the wait timed out.
Fixes: 669c8de67c ("net/ionic: support basic LIF")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
A future patch will allow Tx scatter/gather to be disabled. Store the
value in the queue so it can be changed at runtime based on the
configuration.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Rather than dropping the whole burst if some don't fit.
This improves performance.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Vishwas Danivas <vishwas@pensando.io>
This improves debuggability.
To see the logs, use EAL arg: --log-level=pmd.net.ionic,debug
While here, stop counting fragments, but start counting mtods.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Create a unique Q-CQ struct for adminq, notifyq, rxq, and txq to
reduce the size of each object.
Minimize the size of each field to squeeze into as few cachelines
as possible.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Drop the callback part of the object and store only the pointers.
This saves a bit of space and simplifies the code.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
The adminq is the only caller of ionic_q_service(), so absorb it
into ionic_adminq_service().
Move all of the adminq code together into ionic_main.c.
Staticize a few things.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Add Q_NEXT_TO_POST() and Q_NEXT_TO_SRVC() macros.
Use a precomputed size mask.
This will conserve resources.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
The reported nb_seg_max should include the main fragment in the
descriptor and the fragments in the accompanying SGL.
Update the Tx prep check as well.
These were missed when updating to the v1 Tx queue structures.
Fixes: 5611763610 ("net/ionic: clean up Tx queue version support")
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
The ionic PMD only supports Tx queue version 1 or greater.
Version 1 introduced a new SGL format with support for more
fragments per descriptor.
Add release notes and an explanation to the docs.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Don't assume standard headroom.
Use helper variables to improve readability.
Fixes: a27d901331 ("net/ionic: add Rx and Tx handling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
One function marked cold is in the hot path.
Make sure to always inline hot path functions.
Fixes: a27d901331 ("net/ionic: add Rx and Tx handling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
This will conserve resources by reducing struct ionic_qcq.
Saving a cacheline or two in the rxq and txq structs helps when
running in embedded configurations where CPU cache space is at a
premium.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
DTS, at least, expects to be able to specify L4 checksum offload
without L3 csum offload. Split up the flag checks.
Fixes: a27d901331 ("net/ionic: add Rx and Tx handling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
The IONIC firmware is little-endian.
Add a new field to struct ionic_rx_filter to store the CPU-endian
match type.
Use a local variable for the VLAN when searching the hash table.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Only the NotifyQ uses an interrupt, so simplify the other queues.
Simplify ionic_dev_cmd_adminq_init() and ionic_cq_init().
Move ionic_intr_alloc() into ionic_notify_qcq_alloc().
Create ionic_lif_notifyq_deinit().
Simplify ionic_lif_qcq_deinit().
Remove unneeded flags and defines.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
The rte_ethdev_driver.h, rte_ethdev_vdev.h and rte_ethdev_pci.h files are
for drivers only and should be a private to DPDK and not installed.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Steven Webster <steven.webster@windriver.com>
Don't assume autoneg in link_update().
Always call ionic_dev_cmd_port_autoneg() in start().
This allows the client to specify the link settings.
Fixes: 598f672639 ("net/ionic: add basic port operations")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
The address is not needed in the firmware.
This reduces the startup time a bit.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
Adding F_ENA to the q_init command has the same effect as q_enable.
This reduces the startup time a bit.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
Configuration flags come to the driver in dev_configure(). From there,
the driver calls ionic_lif_configure() to update the lif->feature
bitfield, and then programs the port.
Features like VLAN_RX_FILTER and RX_HASH cannot be disabled in the
device, so do nothing in response to requests to disable them. (The
device config would ideally show them enabled by default, but some
DTS tests fail if RSS_HASH is set but RSS is not.)
Move features from the per-queue to per-port lists. IONIC does not
really support per-queue configuration: the stack disallows disabling
a queue feature if it is enabled on the port, while the device
disallows enabling a queue feature if it is disabled on the port.
Thus all configuration is per-port.
Move the guts of ionic_vlan_offload_set() into a new function,
ionic_lif_configure_vlan_offload(), so it can be called by
ionic_lif_configure().
Move the check for DEV_RX_OFFLOAD_SCATTER from rx_queue_setup() up
into ionic_lif_configure().
Warn if rx_drop_en is not set.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Allows i40e and mlx5 PMDs to compile on Windows and disable other drivers.
Disable few i40e warnings with Clang such as comparison of integers of
different signs and macro redefinitions.
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Otherwise they cannot be restarted, because the FW will reject INIT
or ENA commands on queues which are already running.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Skip ionic_lif_[rxq|txq]_init() in queue start if it's already done.
Move ionic_lif_[rxq|txq]_deinit() from queue stop to queue release.
This allows the queues to be restarted.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Add UP and FW_RESET state flags.
Update the stack info when the link state changes.
Convert set_link_up/set_link_down to lif_start/lif_stop.
Condition reported link state on UP flag.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
ionic_dev_close() is responsible for destroying the ethdev, lif, and
adapter. eth_ionic_dev_remove() calls ionic_dev_close().
Remove-on-close is now required behavior for a PMD.
Remove the UNMAINTAINED flag.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Otherwise, non-default settings (like PROMISC) get reset.
This will become important when link toggling is tied to LIF stop/start.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
This preserves settings across a LIF stop/start.
This will become important when link toggling is tied to LIF stop/start.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Expose ionic_opcode_to_str() so it can be used for dev cmds, too.
Store the device name in struct adapter.
Switch to memcpy() to work around gcc false positives.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This makes the code clearer and conserves resources.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>