aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/device.c
AgeCommit message (Collapse)AuthorFilesLines
2022-12-21af_packet: move to pluginMohsin Kazmi1-836/+0
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I3ec857adb3a9e8a778072a202a4d23f4101e83b2
2022-10-25devices: fix the l2 hdr offset in af_packet transmit sideMohsin Kazmi1-4/+2
Type: fix af_packet transmit node uses header offsets to set the appropriate metadata for packet with offload. But l2_hdr_offset is not correctly set by previous node. This patch makes use of curren_data field as l2_hdr_offset. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I751a725af5c231a443eed22231a867eb7f3894e0
2022-10-21devices: add support for af-packet v2Mohsin Kazmi1-108/+246
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I2ccaf1d512dcb72e414be8c69cbb538ebbe0e933
2022-10-17devices: fix the header offsets in af_packetMohsin Kazmi1-8/+18
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I7fc645c46d285ceb13903f5835c99e9b6a9e5b07
2022-08-31devices: add support for polling modeMohsin Kazmi1-0/+35
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I8d84dc8b7f5c5e863c32838cfafc3d366e2a7e00
2022-08-08devices: af_packet, fix tx stall by retrying failed sendtoMohammed Hawari1-6/+22
Change-Id: I6bed66f740b34673a4883eda1c7f7310c57e131b Type: fix Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Signed-off-by: BenoƮt Ganne <bganne@cisco.com>
2022-04-11devices: refactor fanout supportMohsin Kazmi1-0/+2
Type: refactor Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I9e68ecb91f6433f68a8a87dd066f3e369f25a3c9
2022-04-08devices: fix the offset for af-packetMohsin Kazmi1-14/+7
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I12b2e53ddb797cc809a2d742d17a1a60edde385d
2022-04-07devices: add cli support for checksum and gso disableMohsin Kazmi1-0/+2
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I33a29cf11998736347eca5016eee112619d847c1
2022-04-06devices: add cli support to disable qdisc bypassMohsin Kazmi1-0/+3
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ie5f2bdb8fb559680bab863a7c24a49360e005b58
2022-04-04devices: add multi-queue support for af-packetMohsin Kazmi1-57/+92
Type: feature Change-Id: I0f4e6517fcfa07ffb0aba89b159ac1337937a508 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-23devices: add tx trace for af-packetMohsin Kazmi1-6/+82
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ib96ee54eaf967bf435d6da910a6b582e87fbedc0
2022-03-23devices: add support for offloadsMohsin Kazmi1-11/+128
Type: improvement This patch adds support for: 1) GSO 2) checksum offload Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ib00629888c62da04d58db36ce021993769e736c9
2022-03-23devices: af-packet v3 supportMohsin Kazmi1-11/+10
Type: feature CPU usage ~20% less than v2. Performance improvement 20% more than v2. High vector rate. Change-Id: I24bc594200f42664b59d07b44d44578e61068bbc Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-27devices: fix coverity warning/don't leak fdKlement Sekera1-1/+2
Move socket creation past code which returns from function to avoid leaking the socket in case of an early error return. Type: fix Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I9e18bd32022441c17ca920d1c2458b058b76c3c0
2021-10-22devices: add support for l3 af_packet interfaceMohsin Kazmi1-0/+8
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ia6b9d4ac55be2216887bfdb99be4021f6a96f166
2021-09-28devices: Add queues params in create_ifNathan Skrzypczak1-10/+17
Type: feature Change-Id: I027ff2c5c905a7ccebd3705a58e35218a94f4880 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-07devices: restore regular af-packet tx pathMohammed Hawari1-21/+19
This change restores the af_packet tx path prior in use prior to Change Idf0bdd88990254a614962c2f7bc3e0292ccfd61a but fixes the stalling issue by ensuring that the next tx frame pointer is only incremented when a new tx frame is used. This change also enables the af_packet PACKET_QDISC_BYPASS option, for better performance. Change-Id: I65dde648ed66d21654847a900ceda5a8980ae6ec Type: improvement Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-02-05devices: af-packet gso mtuNathan Skrzypczak1-22/+66
Type: fix Set the GSO flag when buffer length exceeds the linux mtu. Don't listen for mtu changes on linux side for now. This also fixes a TX issue, as we only search for valid frames on tx to the extent of n_left, we might stay stuck. Change-Id: Idf0bdd88990254a614962c2f7bc3e0292ccfd61a Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-03-13deprecate VLIB_DEVICE_TX_FUNCTION_MULTIARCHFilip Tehlar1-7/+5
Change-Id: I8819bcb9e228e7a432f4a7b67b6107f984927cd4 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-3/+3
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-13vlib rename vlib_frame_args(...) to vlib_frame_scalar_args(..)Damjan Marion1-2/+2
Typically we have scalar_size == 0, so it doesn't matter but vlib_frame_args was providing pointer to scalar frame data, not vector data. To avoid future confusion function is renamed to vlib_frame_scalar_args(...) Change-Id: I48b75523b46d487feea24f3f3cb10c528dde516f Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-09-08L2 BVI/FIB: Update L2 FIB table when BVI's MAC changesNeale Ranns1-1/+1
also some moving of l2 headers to reduce dependencies Change-Id: I7a700a411a91451ef13fd65f9c90de2432b793bb Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-05-28af-packet: Add support for loggingMohsin Kazmi1-14/+17
Change-Id: I4cc6a20b69cce2aa52768a27c5d455eb098224c8 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-02-07af_packet: Fix lock positionPierre Pfister1-2/+1
In multi-worker cases, af-packet tx was subject to a pretty serious race condition as the device lock was obtained after some queue values were read from queue. Result could go from packet loss to queue inconsistency, leading to tx being stuck for 'some time'. The fix is really simple. Finding the problem was not... Change-Id: Ib18967b7459a8609428a56de934c577cea87b165 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2018-02-06vlib: epoll on worker threadsDamjan Marion1-1/+1
This patch teaches worer threads to sleep and to be waken up by kernel if there is activity on file desctiptors assigned to that thread. It also adds counters to epoll file descriptors and new debug cli 'show unix file'. Change-Id: Iaf67869f4aa88ff5b0a08982e1c08474013107c4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-11-30af_packet: update tx_frame even when ring exhaustedFlorin Coras1-2/+2
Change-Id: I2fde74b53d6b4dc54d4af7020130f7b22463d70f Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-11Revert "VPP-1001 - update AF Packet Driver to for modern kernels"Damjan Marion1-29/+1
Issues observed with specific kernel versions, e.g. stock Ubuntu 16.04 kernel. This reverts commit 3eab064e3fadaf2a6a128f167ad04ca0319b4e17. Change-Id: I24241f3b580df749fc686af3a319011ca035fb5e Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-10-04VPP-1001 - update AF Packet Driver to for modern kernelsAnton Ivanov1-1/+29
1. Add VNET headers support for checksumming - required to operate correctly on any recent Linux 2. Bypass QDISC on transmit - improves performance by ~ 5%. Enabled only if the macro is detected - apparently not present on archaic distributions. This still does not solve all issues with TSO - it can be fixed only by going to tpacket v3 and dynamic rx ring as well as significant changes in the TX (sendmmsg?). Change-Id: Iea14ade12586c0a8da49e6dd1012108a08bc85b3 Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
2017-05-25af_packet: fix coverity errorRay Kinsella1-2/+19
Fix coverity error associated with fd. Change-Id: I0648aebaf356308bc03cc7217922479bfc4e22f7 Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
2017-05-20af_packet: set mac address supportRay Kinsella1-1/+47
Added support to the interfaces mac address. Resolved an fd leak when the interface is a bridge. Change-Id: I6608c51b11a50bd0ae4aabe0dc5788c4301b5a1e Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
2017-04-28af_packet: reflect admin device state on hostRay Kinsella1-3/+39
Setting the interface state in VPP on an af_packet device, was not being reflected on the host. This implied the user had to set the device state in VPP and then on the host, in order to put the interface into an 'up' state. This changes makes the device state consisent in VPP and the host. Change-Id: I6dc6aee79503e04576683db937b861337a2b375b Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
2017-03-30vppinfra: add spinlock inline functionsDamjan Marion1-7/+2
Change-Id: I86089e9bb604adfc260a111685001be1c897ce53 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-03-28af_packet driver needs to check VLIB_BUFFER_NEXT_PRESENT flag is setJim Gibson1-1/+2
when walking vlib_buffer_t next_buffer chain on transmit. On buffer allocation: - next_buffer is not and may contain a stale invalid value that should be ignored if not overwritten by a valid value. - VLIB_BUFFER_NEXT_PRESENT flag is cleared and only set if a valid value is written to next_buffer. Change-Id: I9b0ccdc54f4f7456f8328ce7c4a0d52d0fba8caa Signed-off-by: Jim Gibson <gibson+fdio@cisco.com>
2017-01-19af_packet: multithreading supportMohsin KAZMI1-0/+9
This patch adds multithreading support for af_packet interfaces. Change-Id: Ief5d1117e7ffeaa59dbc2831e583d5d8e8d4fa7a Signed-off-by: Mohsin KAZMI <sykazmi@cisco.com>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+250
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>