Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipvs: add the support of fnat46. #746

Closed
wants to merge 1 commit into from

Conversation

andrewhit
Copy link

  • Introduce "xoa" for toa mode and uoa mode as below in dpvs.conf.
    tcp {
    toa_mode {normal|extra|xoa}
    ...
    }

    uoa {
    uoa_mode {opp|xoa} # "ipo" mode is removed.
    }

    Also, "extra" as one toa mode is introduced for ipv4, that includes
    (cip/cport, vip/vport) in tcp option.

  • Consolidate the inbound and outbounding processing for
    fnat44/fnat66/fnat46/fnat64.

Comment on lines +58 to +66
struct tcpopt_ip4_addr_extra {
uint8_t opcode;
uint8_t opsize;
__be16 src_port;
struct in_addr src_addr;
uint8_t padding[2];
__be16 dst_port;
struct in_addr dst_addr;
} __attribute__((__packed__));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the extral 2 padding bytes increase failure risk when inserting data into tcp header options?

include/ipvs/xoa.h Outdated Show resolved Hide resolved
src/ipv6/ipv6.c Outdated Show resolved Hide resolved
src/ipv6/route6_lpm.c Outdated Show resolved Hide resolved
src/ipv6/route6_lpm.c Outdated Show resolved Hide resolved
Comment on lines +46 to +49
/*
* "xoa" is only applied to fnat46 and fnat66 modes.
*/
int dp_vs_xoa_get_iplen(struct dp_vs_conn *conn, struct rte_mbuf *mbuf,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are not the fnat44 and fnat 64 supported by this function?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XOA in both fnat44 and fnat64 modes uses the customized IP option that is unfriendly to the switch. And the switch normally drops this kind of packets in the case of high pps.

src/ipvs/ip_vs_proto_tcp.c Outdated Show resolved Hide resolved
Comment on lines +502 to +506
err = dp_vs_xoa_get_iplen(conn, mbuf,
&iphdrlen, &iptot_len, &xoa_len, mtu);
if (err != EDPVS_OK) {
goto standalone_uoa;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dp_vs_xoa_get_iplen doesn't support fnat44 and fnat64, so xoa of udp is not supposed to support the two cases?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • UDP in fnat44 uses the "opp" that is fine to the switch;
  • UDP in fnat64 has two choices: a) xoa: that is unfriendly to the switch; 2) opp is not supported.

Comment on lines -46 to +51
UOA_M_OPP, /* priave "option-protocol" (IPPROTO_OPT) with UOA */
UOA_M_IPO, /* add UOA as IPv4 Option field */
UOA_M_OPP, /* ipv4 and ipv6: [cip/cport] included in private
"option-protocol" (IPPROTO_OPT) */
UOA_M_XOA, /* ipv4 and ipv6: [cip/cport, vip/vport] included in ipv4 option
or ipv6 dst option */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IPO is replaced by XOA for udp, the kernel part of uoa should be modified corespondingly too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the kernel module, toa/uoa, please refer to the below links.

https://github.com/bytedance/toa
https://github.com/bytedance/uoa

src/ipvs/ip_vs_xmit.c Outdated Show resolved Hide resolved
@ywc689
Copy link
Collaborator

ywc689 commented Sep 29, 2022

The kernel module part for xoa is missing, and the uoa kernel module should be modified accordingly. I don't think it's a complete work now. Could you please replenish it?

@ywc689 ywc689 added pr/codes-need-change problems found in the line-by-line code review and need to be fixed and removed pr/to-review-codes review codes line by line and check if problem exists. labels Sep 29, 2022
- Introduce "xoa" for toa mode and uoa mode as below in dpvs.conf.
  tcp {
      toa_mode {normal|extra|xoa}
      ...
  }

  uoa {
     uoa_mode {opp|xoa}  # "ipo" mode is removed.
  }

  Also, "extra" as one toa mode is introduced for ipv4, that includes
  (cip/cport, vip/vport) in tcp option.

- Consolidate the inbound and outbounding processing for
  fnat44/fnat66/fnat46/fnat64.
@ywc689 ywc689 self-requested a review February 14, 2023 09:11
@ywc689 ywc689 added pr/to-test-codes Compile and test the patch of pr to verify if it works. pr/codes-test-failed compile problem exists or specified test cases not passed and removed pr/to-test-codes Compile and test the patch of pr to verify if it works. labels Feb 16, 2023
@andrewhit
Copy link
Author

Closing this PR because dpvs has supported this feature.

@andrewhit andrewhit closed this Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/codes-need-change problems found in the line-by-line code review and need to be fixed pr/codes-test-failed compile problem exists or specified test cases not passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants