Skip to content

Commit 65d51f2

Browse files
committed
Merge tag 'mlx5-updates-2018-01-08' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
mlx5-updates-2018-01-08 Four patches from Or that add Hairpin support to mlx5: =========================================================== From: Or Gerlitz <[email protected]> We refer the ability of NIC HW to fwd packet received on one port to the other port (also from a port to itself) as hairpin. The application API is based on ingress tc/flower rules set on the NIC with the mirred redirect action. Other actions can apply to packets during the redirect. Hairpin allows to offload the data-path of various SW DDoS gateways, load-balancers, etc to HW. Packets go through all the required processing in HW (header re-write, encap/decap, push/pop vlan) and then forwarded, CPU stays at practically zero usage. HW Flow counters are used by the control plane for monitoring and accounting. Hairpin is implemented by pairing a receive queue (RQ) to send queue (SQ). All the flows that share <recv NIC, mirred NIC> are redirected through the same hairpin pair. Currently, only header-rewrite is supported as a packet modification action. I'd like to thanks Elijah Shakkour <[email protected]> for implementing this functionality on HW simulator, before it was avail in the FW so the driver code could be tested early. =========================================================== From Feras three patches that provide very small changes that allow IPoIB to support RX timestamping for child interfaces, simply by hooking the mlx5e timestamping PTP ioctl to IPoIB child interface netdev profile. One patch from Gal to fix a spilling mistake. Two patches from Eugenia adds drop counters to VF statistics to be reported as part of VF statistics in netlink (iproute2) and implemented them in mlx5 eswitch. Signed-off-by: David S. Miller <[email protected]>
2 parents 45f8982 + b8a0dbe commit 65d51f2

File tree

17 files changed

+649
-27
lines changed

17 files changed

+649
-27
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ struct mlx5e_tc_table {
659659
struct rhashtable ht;
660660

661661
DECLARE_HASHTABLE(mod_hdr_tbl, 8);
662+
DECLARE_HASHTABLE(hairpin_tbl, 8);
662663
};
663664

664665
struct mlx5e_vlan_table {

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,9 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
11751175
u32 cqe_bcnt,
11761176
struct sk_buff *skb)
11771177
{
1178+
struct hwtstamp_config *tstamp;
11781179
struct net_device *netdev;
1180+
struct mlx5e_priv *priv;
11791181
char *pseudo_header;
11801182
u32 qpn;
11811183
u8 *dgid;
@@ -1194,6 +1196,9 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
11941196
return;
11951197
}
11961198

1199+
priv = mlx5i_epriv(netdev);
1200+
tstamp = &priv->tstamp;
1201+
11971202
g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3;
11981203
dgid = skb->data + MLX5_IB_GRH_DGID_OFFSET;
11991204
if ((!g) || dgid[0] != 0xff)
@@ -1214,7 +1219,7 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
12141219
skb->ip_summed = CHECKSUM_COMPLETE;
12151220
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
12161221

1217-
if (unlikely(mlx5e_rx_hw_stamp(rq->tstamp)))
1222+
if (unlikely(mlx5e_rx_hw_stamp(tstamp)))
12181223
skb_hwtstamps(skb)->hwtstamp =
12191224
mlx5_timecounter_cyc2time(rq->clock, get_cqe_ts(cqe));
12201225

0 commit comments

Comments
 (0)