aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet
AgeCommit message (Collapse)AuthorFilesLines
2022-12-21af_packet: move to pluginMohsin Kazmi9-3524/+0
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I3ec857adb3a9e8a778072a202a4d23f4101e83b2
2022-11-25interface: remove the pending interrupt from deleting interfaceMohsin Kazmi1-5/+4
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I3138f97519d216b89a9c46865271db1f9ddd53cd
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 Kazmi7-186/+645
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: fix coverity warningMohsin Kazmi1-1/+1
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I0a58c0f54d8be31a0a78bef00152fb2cc193840e
2022-08-31devices: add support for polling modeMohsin Kazmi3-6/+45
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 Hawari3-6/+24
Change-Id: I6bed66f740b34673a4883eda1c7f7310c57e131b Type: fix Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-05-24devices: add af-packet v3 apiMohsin Kazmi2-0/+114
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I4679acbe4fd4400d57c0a79b0a6c74c8f1639703
2022-05-08devices: fix crash on invalid interfaceGabriel Ganne1-2/+5
Type: fix A simple "create host-interface name xxx" is enough to trigger the bug: The interface is not found, and we goto error with apif=NULL Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com> Change-Id: I2f894176d39b3d15efab054dc7340e7a0600a2e8
2022-04-19devices: remove redundant access in af-packet inputMohsin Kazmi1-5/+5
Type: fix current_data is set to 0 for each packet in af-packet input node. It is not required to include it to calculate the headers offset. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I538d8c04e24c758155b3f8d6a1532472ef549459
2022-04-11devices: refactor fanout supportMohsin Kazmi3-27/+37
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 Kazmi5-20/+29
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I33a29cf11998736347eca5016eee112619d847c1
2022-04-06devices: add cli support to disable qdisc bypassMohsin Kazmi5-12/+39
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ie5f2bdb8fb559680bab863a7c24a49360e005b58
2022-04-05devices: remove redundant code af-packetMohsin Kazmi2-23/+3
Type: refactor Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Id485f525057163582dc7a83f7dab7a8b2e759270
2022-04-05devices: fix the received blocks countersMohsin Kazmi1-5/+4
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: If7d9c94dcdc32fa66763e18bd3be7d28b2d17946
2022-04-05devices: fix the coverity warnings for af-packet v3Mohsin Kazmi1-9/+14
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ie647fb280831af23925c4b5f659f1dade6d37eff
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion1-2/+3
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04devices: add multi-queue support for af-packetMohsin Kazmi6-270/+571
Type: feature Change-Id: I0f4e6517fcfa07ffb0aba89b159ac1337937a508 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-25devices: fix high vector rate per dispatchMohsin Kazmi3-13/+44
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ibd23648483b38696271154237e81081480bb16e0
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 Kazmi5-117/+301
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 Kazmi4-198/+274
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>
2022-03-10devices: remove the unused code from af_packetMohsin Kazmi2-6/+0
Type: refactor Change-Id: If180816303909b92c9aa4ff9fd70dc7938a6cfbe Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-01-18vnet: distinguish between max_frame_size and MTUDamjan Marion1-4/+6
Type: improvement Change-Id: I3659de6599f402c92e3855e3bf0e5e3388f2bea0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-17interface: improve MTU handlingDamjan Marion1-21/+16
- per hw-interface-class handlers - ethernet set_mtu callback - driver can now refuse MTU change Type: improvement Change-Id: I3d37c9129930ebec7bb70caf4263025413873048 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-10interface: refactor interface capabilities code, part 2Damjan Marion1-10/+6
Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ie595e69af8657b0ee18a84ac71c5d433108d9ef8
2022-01-07ethernet: new interface registration functionDamjan Marion1-15/+6
Prep for supporting multiple callbacks, optional args, etc. Type: improvement Change-Id: I96244c098712e8213374678623f12527b0e7f387 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-05interface: refactor interface capabilities codeDamjan Marion1-5/+3
Make it shorter to type, easier to debug, make adding callbacks in future simpler. Type: improvement Change-Id: I6cdd6375e36da23bd452a7c7273ff42789e94433 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-11-27devices: fix af_packet GSO checkNathan Skrzypczak1-1/+6
Type: fix This fixes the GSO size calculation in af_packet which didn't include the ethernet size. This is not ideal, as we default to the host side mtu to check whether a packet is GSO or not and to set the GSO size. But there doesn't seem to be more info passed with the packets. Change-Id: I9769e1dd21d5989b4cf67295352b5535454f88d1 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-11-23devices: support build on older kernelsFlorin Coras1-0/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I10af028b5e57b36b8015b02240f1e4e9a42d0898
2021-10-29devices: default mode eth in the apiNathan Skrzypczak2-2/+4
Type: fix https://gerrit.fd.io/r/c/vpp/+/34027 added support for l3 mode, but as the eth_mode constant was set to 1 we did default to l3 mode in the api. This reverts to the original logic. Change-Id: If8b90b300d3868de5233dfa1f33ec975853cba11 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.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 Kazmi5-37/+106
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ia6b9d4ac55be2216887bfdb99be4021f6a96f166
2021-10-01devices: add support for pseudo header checksumMohsin Kazmi1-4/+0
Type: improvement Linux uses pseudo header checksum when checksum of l4 is offloaded. This patch adds similar support in virtual interfaces. Change-Id: I6a94d1104e59356f95057e7c122e3be9cd8659a3 Signed-off-by: Aloys Augustin <aloaugus@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-09-28devices: Add queues params in create_ifNathan Skrzypczak7-96/+185
Type: feature Change-Id: I027ff2c5c905a7ccebd3705a58e35218a94f4880 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-07devices: restore regular af-packet tx pathMohammed Hawari2-21/+28
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-06-22devices: af_packet api cleanupFilip Tehlar1-53/+8
Use autogenerated code. Does not change API definitions. Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ic7979755494a2fd23b9fa3d74e14f6b9ea0a46d0
2021-05-06vlib: fix the offload flags sizeMohsin Kazmi1-1/+1
Type: fix Change-Id: I433fe3799975fe3ba00fa30226f6e8dae34e88fc Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-1/+0
trajectory trace has been broken for a while because we used to save the buffer trajectory in a vector pointed to in opaque2. This does not work well when opaque2 is copied (eg. because of a clone) as 2 buffers end up sharing the same vector. This dedicates a full cacheline in the buffer metadata instead when trajectory is compiled in. No dynamic allocation, no sharing, no tears. Type: refactor Change-Id: I6a028ca1b48d38f393a36979e5e452c2dd48ad3f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-04-08devices: af_packet - use netlink to get/set mtuAloys Augustin1-12/+6
The /sys filesystem is not always accurate when switching network namespaces. Using netlink should work in more situations. Type: improvement Change-Id: I71611f14319820469ea7794eec5b7c6c70e2be6d Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2021-03-19interface: add capabilities flagsMohsin Kazmi1-4/+9
Type: improvement This patch adds flags to represent the modern NICs capabilities. Change-Id: I96d38d9ab7eac55974d72795cd100d8337168e1e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-02-15vlib: refactor checksum offload supportMohsin Kazmi1-4/+9
Type: refactor This patch refactors the offload flags in vlib_buffer_t. There are two main reasons behind this refactoring. First, offload flags are insufficient to represent outer and inner headers offloads. Second, room for these flags in first cacheline of vlib_buffer_t is also limited. This patch introduces a generic offload flag in first cacheline. And detailed offload flags in 2nd cacheline of the structure for performance optimization. Change-Id: Icc363a142fb9208ec7113ab5bbfc8230181f6004 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-02-05devices: af-packet gso mtuNathan Skrzypczak4-38/+126
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>
2021-01-22devices: adapt af_packet to new rxq frameworkMohammed Hawari3-32/+32
Change-Id: If8077280cef501599f810ad9255efa2a5a451ced Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-3/+3
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-09vlib: fix trace number accountingBenoît Ganne1-3/+3
When using classifier to filter traces, not all packets will be traced. In that case, we should only count traced packets. Type: fix Change-Id: I87d1e217b580ebff8c6ade7860eb43950420ae78 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-10-08interface: shorten vnet_hw_if_rx_modeDamjan Marion1-1/+1
This is part of bigger refactor. Type: refactor Change-Id: I6fc2c0a1e2d217a70952901bcf775b8485bd3c20 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-27ethernet: fix DMAC check and skip unnecessary ones (VPP-1868)John Lo1-1/+1
Fix and optimize DMAC check in ethernet-input node to utilize NIC or driver which support L3 DMAC-filtering mode so that DMAC check can be bypassed safely for interfaces/sub-interfaces in L3 mode. Checking of interface in L3-DMAC-filtering state to avoid DMAC check require the following: a) Fix interface driver init sequence for devices which supports L3 DMAC-filtering to indicate its capability and initialize interface to L3 DMAC-filtering state. b) Fix ethernet_set_flags() function and its associated callback flags_change() functions registered by various drivers in interface infra to provide proper L3 DMAC filtering status. Maintain interface/sub-interface L3 config count so DMAC checks can be bypassed if L3 forwarding is not setup on any main/sub-interfaces. Type: fix Ticket: VPP-1868 Signed-off-by: John Lo <loj@cisco.com> Change-Id: I204d90459c13e9e486cfcba4e64e3d479bc9f2ae